77 if sys.version_info[0] == 2: |
77 if sys.version_info[0] == 2: |
78 try: |
78 try: |
79 DebugClientOrigRawInput = __builtins__.__dict__['raw_input'] |
79 DebugClientOrigRawInput = __builtins__.__dict__['raw_input'] |
80 __builtins__.__dict__['raw_input'] = DebugClientRawInput |
80 __builtins__.__dict__['raw_input'] = DebugClientRawInput |
81 except (AttributeError, KeyError): |
81 except (AttributeError, KeyError): |
82 import __main__ |
82 try: |
83 DebugClientOrigRawInput = __main__.__builtins__.__dict__['raw_input'] |
83 import __main__ |
84 __main__.__builtins__.__dict__['raw_input'] = DebugClientRawInput |
84 DebugClientOrigRawInput = __main__.__builtins__.__dict__[ |
|
85 'raw_input' |
|
86 ] |
|
87 __main__.__builtins__.__dict__['raw_input'] = DebugClientRawInput |
|
88 except (AttributeError, KeyError): |
|
89 DebugClientOrigRawInput = lambda x: '' # __IGNORE_WARNING__ |
85 |
90 |
86 try: |
91 try: |
87 DebugClientOrigInput = __builtins__.__dict__['input'] |
92 DebugClientOrigInput = __builtins__.__dict__['input'] |
88 __builtins__.__dict__['input'] = DebugClientInput |
93 __builtins__.__dict__['input'] = DebugClientInput |
89 except (AttributeError, KeyError): |
94 except (AttributeError, KeyError): |
90 import __main__ |
95 try: |
91 DebugClientOrigInput = __main__.__builtins__.__dict__['input'] |
96 import __main__ |
92 __main__.__builtins__.__dict__['input'] = DebugClientInput |
97 DebugClientOrigInput = __main__.__builtins__.__dict__['input'] |
|
98 __main__.__builtins__.__dict__['input'] = DebugClientInput |
|
99 except (AttributeError, KeyError): |
|
100 DebugClientOrigInput = lambda x: '' # __IGNORE_WARNING__ |
93 else: |
101 else: |
94 try: |
102 try: |
95 DebugClientOrigInput = __builtins__.__dict__['input'] |
103 DebugClientOrigInput = __builtins__.__dict__['input'] |
96 __builtins__.__dict__['input'] = DebugClientRawInput |
104 __builtins__.__dict__['input'] = DebugClientRawInput |
97 except (AttributeError, KeyError): |
105 except (AttributeError, KeyError): |
98 import __main__ |
106 try: |
99 DebugClientOrigInput = __main__.__builtins__.__dict__['input'] |
107 import __main__ |
100 __main__.__builtins__.__dict__['input'] = DebugClientRawInput |
108 DebugClientOrigInput = __main__.__builtins__.__dict__['input'] |
|
109 __main__.__builtins__.__dict__['input'] = DebugClientRawInput |
|
110 except (AttributeError, KeyError): |
|
111 DebugClientOrigInput = lambda x: '' # __IGNORE_WARNING__ |
101 |
112 |
102 ############################################################################### |
113 ############################################################################### |
103 |
114 |
104 |
115 |
105 def DebugClientFork(): |
116 def DebugClientFork(): |
233 |
244 |
234 self.coding_re = re.compile(r"coding[:=]\s*([-\w_.]+)") |
245 self.coding_re = re.compile(r"coding[:=]\s*([-\w_.]+)") |
235 self.defaultCoding = 'utf-8' |
246 self.defaultCoding = 'utf-8' |
236 self.__coding = self.defaultCoding |
247 self.__coding = self.defaultCoding |
237 self.noencoding = False |
248 self.noencoding = False |
|
249 |
|
250 self.startOptions = None |
238 |
251 |
239 def getCoding(self): |
252 def getCoding(self): |
240 """ |
253 """ |
241 Public method to return the current coding. |
254 Public method to return the current coding. |
242 |
255 |
2190 del args[0] |
2203 del args[0] |
2191 if not args: |
2204 if not args: |
2192 print("No program given. Aborting!") |
2205 print("No program given. Aborting!") |
2193 # __IGNORE_WARNING_M801__ |
2206 # __IGNORE_WARNING_M801__ |
2194 else: |
2207 else: |
|
2208 # Store options if a process is spawn |
|
2209 # TODO: check which ones are really needed |
|
2210 self.startOptions = ( |
|
2211 wd, host, port, exceptions, tracePython, redirect, |
|
2212 self.noencoding, self.fork_auto, self.fork_child, |
|
2213 self.pids |
|
2214 ) |
2195 if not self.noencoding: |
2215 if not self.noencoding: |
2196 self.__coding = self.defaultCoding |
2216 self.__coding = self.defaultCoding |
2197 self.startProgInDebugger(args, wd, host, port, |
2217 self.startProgInDebugger(args, wd, host, port, |
2198 exceptions=exceptions, |
2218 exceptions=exceptions, |
2199 tracePython=tracePython, |
2219 tracePython=tracePython, |
2234 sys.argv = [''] |
2254 sys.argv = [''] |
2235 if '' not in sys.path: |
2255 if '' not in sys.path: |
2236 sys.path.insert(0, '') |
2256 sys.path.insert(0, '') |
2237 |
2257 |
2238 if port >= 0: |
2258 if port >= 0: |
|
2259 # Store options if a process is spawn |
|
2260 # TODO: check which ones are really needed |
|
2261 self.startOptions = ( |
|
2262 '', remoteAddress, port, True, False, redirect, |
|
2263 self.noencoding, self.fork_auto, self.fork_child, |
|
2264 self.pids |
|
2265 ) |
2239 if not self.noencoding: |
2266 if not self.noencoding: |
2240 self.__coding = self.defaultCoding |
2267 self.__coding = self.defaultCoding |
2241 self.connectDebugger(port, remoteAddress, redirect) |
2268 self.connectDebugger(port, remoteAddress, redirect) |
2242 self.__interact() |
2269 self.__interact() |
2243 else: |
2270 else: |