summaryrefslogtreecommitdiffstats
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r--Lib/rlcompleter.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index bca4a7b..c06388e 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -31,6 +31,7 @@ Notes:
import atexit
import builtins
+import inspect
import __main__
__all__ = ["Completer"]
@@ -96,7 +97,13 @@ class Completer:
def _callable_postfix(self, val, word):
if callable(val):
- word = word + "("
+ word += "("
+ try:
+ if not inspect.signature(val).parameters:
+ word += ")"
+ except ValueError:
+ pass
+
return word
def global_matches(self, text):