Skip to content

Commit 5697d6f

Browse files
committed
screw you simon
1 parent d4a7581 commit 5697d6f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bpython/repl.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ def __init__(self, locals=None, encoding=sys.getdefaultencoding()):
6666

6767
if not py3:
6868

69-
def runsource(self, source, filename='<input>', symbol='single'):
70-
source = '# coding: %s\n%s' % (self.encoding,
71-
source.encode(self.encoding))
69+
def runsource(self, source, filename='<input>', symbol='single',
70+
encode=True):
71+
if encode:
72+
source = '# coding: %s\n%s' % (self.encoding,
73+
source.encode(self.encoding))
7274
return code.InteractiveInterpreter.runsource(self, source,
7375
filename, symbol)
7476

@@ -305,7 +307,7 @@ def __init__(self, interp, config, idle=None):
305307
filename = os.environ.get('PYTHONSTARTUP')
306308
if filename and os.path.isfile(filename):
307309
with open(filename, 'r') as f:
308-
self.interp.runsource(f.read(), filename, 'exec')
310+
self.interp.runsource(f.read(), filename, 'exec', encode=False)
309311

310312
def attr_matches(self, text):
311313
"""Taken from rlcompleter.py and bent to my will."""

0 commit comments

Comments
 (0)