eric6/DebugClients/Python/DebugClientBase.py

branch
multi_processing
changeset 7564
787684e6f2f3
parent 7563
b0d6b63f2843
parent 7550
e91462fd0838
child 7627
812ee8c0a91a
--- a/eric6/DebugClients/Python/DebugClientBase.py	Sat May 02 14:35:03 2020 +0200
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Sat May 02 14:45:06 2020 +0200
@@ -48,13 +48,17 @@
 
 def DebugClientRawInput(prompt="", echo=True):
     """
-    Replacement for the standard raw_input builtin.
+    Replacement for the standard raw_input() builtin (Python 2) and
+    the standard input() builtin (Python 3).
     
     This function works with the split debugger.
     
-    @param prompt prompt to be shown. (string)
-    @param echo flag indicating echoing of the input (boolean)
-    @return result of the raw_input() call
+    @param prompt prompt to be shown
+    @type str
+    @param echo flag indicating echoing of the input
+    @type bool
+    @return result of the raw_input()/input() call
+    @rtype str
     """
     if DebugClientInstance is None or not DebugClientInstance.redirect:
         return DebugClientOrigRawInput(prompt)
@@ -62,20 +66,21 @@
     return DebugClientInstance.raw_input(prompt, echo)
 
 
-def DebugClientInput(prompt="", echo=True):
+def DebugClientInput(prompt=""):
     """
-    Replacement for the standard input builtin.
+    Replacement for the standard input() builtin (Python 2).
     
     This function works with the split debugger.
     
-    @param prompt prompt to be shown (string)
-    @param echo flag indicating to echo the output (boolean)
+    @param prompt prompt to be shown
+    @type str
     @return result of the input() call
+    @rtype str
     """
     if DebugClientInstance is None or not DebugClientInstance.redirect:
         return DebugClientOrigInput(prompt)
 
-    return DebugClientInstance.input(prompt, echo)
+    return DebugClientInstance.input(prompt)
 
 # Use our own input() and on Python 2 raw_input().
 if sys.version_info[0] == 2:
@@ -105,14 +110,11 @@
 else:
     try:
         DebugClientOrigInput = __builtins__.__dict__['input']
-        __builtins__.__dict__['input'] = DebugClientInput
+        __builtins__.__dict__['input'] = DebugClientRawInput
     except (AttributeError, KeyError):
-        try:
-            import __main__
-            DebugClientOrigInput = __main__.__builtins__.__dict__['input']
-            __main__.__builtins__.__dict__['input'] = DebugClientInput
-        except (AttributeError, KeyError):
-            DebugClientOrigInput = lambda x: ''  # __IGNORE_WARNING__
+        import __main__
+        DebugClientOrigInput = __main__.__builtins__.__dict__['input']
+        __main__.__builtins__.__dict__['input'] = DebugClientRawInput
 
 ###############################################################################
 

eric ide

mercurial