mirror of https://github.com/python/cpython.git
Revert accidental checkin.
This commit is contained in:
parent
5942b91759
commit
00b6590821
|
@ -194,9 +194,6 @@ def interaction(self, frame, traceback):
|
||||||
self.cmdloop()
|
self.cmdloop()
|
||||||
self.forget()
|
self.forget()
|
||||||
|
|
||||||
def displayhook(self, item):
|
|
||||||
print item
|
|
||||||
|
|
||||||
def default(self, line):
|
def default(self, line):
|
||||||
if line[:1] == '!': line = line[1:]
|
if line[:1] == '!': line = line[1:]
|
||||||
locals = self.curframe.f_locals
|
locals = self.curframe.f_locals
|
||||||
|
@ -205,16 +202,13 @@ def default(self, line):
|
||||||
code = compile(line + '\n', '<stdin>', 'single')
|
code = compile(line + '\n', '<stdin>', 'single')
|
||||||
save_stdout = sys.stdout
|
save_stdout = sys.stdout
|
||||||
save_stdin = sys.stdin
|
save_stdin = sys.stdin
|
||||||
save_displayhook = sys.displayhook
|
|
||||||
try:
|
try:
|
||||||
sys.stdin = self.stdin
|
sys.stdin = self.stdin
|
||||||
sys.stdout = self.stdout
|
sys.stdout = self.stdout
|
||||||
sys.displayhook = self.displayhook
|
|
||||||
exec code in globals, locals
|
exec code in globals, locals
|
||||||
finally:
|
finally:
|
||||||
sys.stdout = save_stdout
|
sys.stdout = save_stdout
|
||||||
sys.stdin = save_stdin
|
sys.stdin = save_stdin
|
||||||
sys.displayhook = save_displayhook
|
|
||||||
except:
|
except:
|
||||||
t, v = sys.exc_info()[:2]
|
t, v = sys.exc_info()[:2]
|
||||||
if type(t) == type(''):
|
if type(t) == type(''):
|
||||||
|
|
Loading…
Reference in New Issue