Skip to content

Commit f4c0d34

Browse files
committed
Run code directly via Python instead of InteractiveInterpreter
We cannot do anything reasonable here anyway, so just let Python handle this case.
1 parent cb66a00 commit f4c0d34

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

bpython/args.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
Module to handle command line argument parsing, for all front-ends.
2626
"""
2727

28-
import code
2928
import importlib.util
3029
import os
3130
import sys
@@ -145,9 +144,8 @@ def callback(group):
145144
raise SystemExit
146145

147146
if not ignore_stdin and not (sys.stdin.isatty() and sys.stdout.isatty()):
148-
interpreter = code.InteractiveInterpreter()
149-
interpreter.runsource(sys.stdin.read())
150-
raise SystemExit
147+
# Just let Python handle this
148+
os.execv(sys.executable, [sys.executable] + args)
151149

152150
config = Struct()
153151
loadini(config, options.config)

0 commit comments

Comments
 (0)