Show More
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.' | |||
|
6 | 6 | |
|
7 | 7 | This file contains all the classes and helper functions specific to IPython. |
|
8 | 8 | |
|
9 |
$Id: iplib.py 28 |
|
|
9 | $Id: iplib.py 2891 2007-12-12 22:33:50Z vivainio $ | |
|
10 | 10 | """ |
|
11 | 11 | |
|
12 | 12 | #***************************************************************************** |
@@ -79,16 +79,6 b' import IPython.prefilter as prefilter' | |||
|
79 | 79 | import IPython.shadowns |
|
80 | 80 | # Globals |
|
81 | 81 | |
|
82 | # make converting between str and unicode easy, so str() will work most of the | |
|
83 | # time | |
|
84 | ||
|
85 | try: | |
|
86 | sys.setappdefaultencoding(sys.stdin.encoding or 'ascii') | |
|
87 | except: | |
|
88 | # Many python versions don't have sys.setappdefaultencoding | |
|
89 | reload(sys) | |
|
90 | sys.setdefaultencoding(sys.stdin.encoding or 'ascii') | |
|
91 | ||
|
92 | 82 | # store the builtin raw_input globally, and use this always, in case user code |
|
93 | 83 | # overwrites it (like wx.py.PyShell does) |
|
94 | 84 | raw_input_original = raw_input |
@@ -1921,7 +1911,7 b' want to merge them back into the new files.""" % locals()' | |||
|
1921 | 1911 | # this allows execution of indented pasted code. It is tempting |
|
1922 | 1912 | # to add '\n' at the end of source to run commands like ' a=1' |
|
1923 | 1913 | # directly, but this fails for more complicated scenarios |
|
1924 | source = str(source) | |
|
1914 | source=source.encode(self.stdin_encoding) | |
|
1925 | 1915 | if source[:1] in [' ', '\t']: |
|
1926 | 1916 | source = 'if 1:\n%s' % source |
|
1927 | 1917 |
General Comments 0
You need to be logged in to leave comments.
Login now