52 @return result of the input() call |
52 @return result of the input() call |
53 @rtype str |
53 @rtype str |
54 """ |
54 """ |
55 if DebugClientInstance is None or not DebugClientInstance.redirect: |
55 if DebugClientInstance is None or not DebugClientInstance.redirect: |
56 return DebugClientOrigInput(prompt) |
56 return DebugClientOrigInput(prompt) |
57 |
57 else: |
58 return DebugClientInstance.input(prompt) |
58 return DebugClientInstance.input(prompt) |
59 |
59 |
60 # Use our own input(). |
60 # Use our own input(). |
61 try: |
61 try: |
62 DebugClientOrigInput = __builtins__.__dict__['input'] |
62 DebugClientOrigInput = __builtins__.__dict__['input'] |
63 __builtins__.__dict__['input'] = DebugClientInput |
63 __builtins__.__dict__['input'] = DebugClientInput |
75 |
75 |
76 @param fd open file descriptor to be closed (integer) |
76 @param fd open file descriptor to be closed (integer) |
77 """ |
77 """ |
78 if DebugClientInstance is None: |
78 if DebugClientInstance is None: |
79 DebugClientOrigClose(fd) |
79 DebugClientOrigClose(fd) |
80 |
80 else: |
81 DebugClientInstance.close(fd) |
81 DebugClientInstance.close(fd) |
82 |
82 |
83 # use our own close(). |
83 # use our own close(). |
84 if 'close' in dir(os): |
84 if 'close' in dir(os): |
85 DebugClientOrigClose = os.close |
85 DebugClientOrigClose = os.close |
86 os.close = DebugClientClose |
86 os.close = DebugClientClose |