##// END OF EJS Templates
Return ValueError catching to raw_input to (kinda) fix sys.stdin.close()i
vivainio -
Show More
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 1788 2006-09-27 07:15:44Z fperez $
9 $Id: iplib.py 1803 2006-10-03 16:29:50Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -1523,6 +1523,9 b' want to merge them back into the new files.""" % locals()'
1523 prompt = self.hooks.generate_prompt(False)
1523 prompt = self.hooks.generate_prompt(False)
1524 try:
1524 try:
1525 line = self.raw_input(prompt,more)
1525 line = self.raw_input(prompt,more)
1526 if self.exit_now:
1527 # quick exit on sys.std[in|out] close
1528 break
1526 if self.autoindent:
1529 if self.autoindent:
1527 self.readline_startup_hook(None)
1530 self.readline_startup_hook(None)
1528 except KeyboardInterrupt:
1531 except KeyboardInterrupt:
@@ -1823,7 +1826,13 b' want to merge them back into the new files.""" % locals()'
1823 continuation in a sequence of inputs.
1826 continuation in a sequence of inputs.
1824 """
1827 """
1825
1828
1826 line = raw_input_original(prompt)
1829 try:
1830 line = raw_input_original(prompt)
1831 except ValueError:
1832 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1833 self.exit_now = True
1834 return ""
1835
1827
1836
1828 # Try to be reasonably smart about not re-indenting pasted input more
1837 # Try to be reasonably smart about not re-indenting pasted input more
1829 # than necessary. We do this by trimming out the auto-indent initial
1838 # than necessary. We do this by trimming out the auto-indent initial
@@ -1,3 +1,9 b''
1 2006-10-03 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py (raw_input, interact): Return ValueError catching for
4 raw_input. Fixes infinite loop for sys.stdin.close() or
5 sys.stdout.close().
6
1 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
7 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2
8
3 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
9 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
General Comments 0
You need to be logged in to leave comments. Login now