diff -r af2500ced7e0 -r 21df384d6150 eric6/DebugClients/Python/DebugClientBase.py --- a/eric6/DebugClients/Python/DebugClientBase.py Wed Jan 29 18:47:35 2020 +0100 +++ b/eric6/DebugClients/Python/DebugClientBase.py Wed Jan 29 19:38:13 2020 +0100 @@ -79,25 +79,36 @@ DebugClientOrigRawInput = __builtins__.__dict__['raw_input'] __builtins__.__dict__['raw_input'] = DebugClientRawInput except (AttributeError, KeyError): - import __main__ - DebugClientOrigRawInput = __main__.__builtins__.__dict__['raw_input'] - __main__.__builtins__.__dict__['raw_input'] = DebugClientRawInput + try: + import __main__ + DebugClientOrigRawInput = __main__.__builtins__.__dict__[ + 'raw_input' + ] + __main__.__builtins__.__dict__['raw_input'] = DebugClientRawInput + except (AttributeError, KeyError): + DebugClientOrigRawInput = lambda x: '' # __IGNORE_WARNING__ try: DebugClientOrigInput = __builtins__.__dict__['input'] __builtins__.__dict__['input'] = DebugClientInput except (AttributeError, KeyError): - import __main__ - DebugClientOrigInput = __main__.__builtins__.__dict__['input'] - __main__.__builtins__.__dict__['input'] = DebugClientInput + try: + import __main__ + DebugClientOrigInput = __main__.__builtins__.__dict__['input'] + __main__.__builtins__.__dict__['input'] = DebugClientInput + except (AttributeError, KeyError): + DebugClientOrigInput = lambda x: '' # __IGNORE_WARNING__ else: try: DebugClientOrigInput = __builtins__.__dict__['input'] __builtins__.__dict__['input'] = DebugClientRawInput except (AttributeError, KeyError): - import __main__ - DebugClientOrigInput = __main__.__builtins__.__dict__['input'] - __main__.__builtins__.__dict__['input'] = DebugClientRawInput + try: + import __main__ + DebugClientOrigInput = __main__.__builtins__.__dict__['input'] + __main__.__builtins__.__dict__['input'] = DebugClientRawInput + except (AttributeError, KeyError): + DebugClientOrigInput = lambda x: '' # __IGNORE_WARNING__ ############################################################################### @@ -235,6 +246,8 @@ self.defaultCoding = 'utf-8' self.__coding = self.defaultCoding self.noencoding = False + + self.startOptions = None def getCoding(self): """ @@ -2192,6 +2205,13 @@ print("No program given. Aborting!") # __IGNORE_WARNING_M801__ else: + # Store options if a process is spawn + # TODO: check which ones are really needed + self.startOptions = ( + wd, host, port, exceptions, tracePython, redirect, + self.noencoding, self.fork_auto, self.fork_child, + self.pids + ) if not self.noencoding: self.__coding = self.defaultCoding self.startProgInDebugger(args, wd, host, port, @@ -2236,6 +2256,13 @@ sys.path.insert(0, '') if port >= 0: + # Store options if a process is spawn + # TODO: check which ones are really needed + self.startOptions = ( + '', remoteAddress, port, True, False, redirect, + self.noencoding, self.fork_auto, self.fork_child, + self.pids + ) if not self.noencoding: self.__coding = self.defaultCoding self.connectDebugger(port, remoteAddress, redirect)