Skip to content

Commit f30daa9

Browse files
committed
Patch from Henry Prêcheur to fix py3 support - we don't override runsource() if
py3, so the extra "encode" argument I added is not recognised
1 parent 2c5e362 commit f30daa9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bpython/repl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ def startup(self):
310310
filename = os.environ.get('PYTHONSTARTUP')
311311
if filename and os.path.isfile(filename):
312312
with open(filename, 'r') as f:
313-
self.interp.runsource(f.read(), filename, 'exec', encode=False)
313+
if py3:
314+
self.interp.runsource(f.read(), filename, 'exec')
315+
else:
316+
self.interp.runsource(f.read(), filename, 'exec', encode=False)
314317

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

0 commit comments

Comments
 (0)