Add command to run Python scripts with the current interpreter.
@@ -303,6 +303,12 @@ def run(args, mainfile=None):
return mconf.run(remaining_args)
elif cmd_name == 'wrap':
return wraptool.run(remaining_args)
+ elif cmd_name == 'runpython':
+ import runpy
+ script_file = remaining_args[0]
+ sys.argv[1:] = remaining_args[1:]
+ runpy.run_path(script_file, run_name='__main__')
+ sys.exit(0)
# No special command? Do the basic setup/reconf.
if len(args) >= 2 and args[0] == '--internal':
