aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-10-15 21:38:35 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-11-20 23:08:17 +0200
commita437cd1955186060a8c5768fef739830d2711d0c (patch)
tree2bcaa62922ff318880e8cd0c121f5533a66ebde8 /mesonbuild/mesonmain.py
parentd5a6ab31bfbcec9838805c598be75abb036aff87 (diff)
downloadmeson-a437cd1955186060a8c5768fef739830d2711d0c.zip
meson-a437cd1955186060a8c5768fef739830d2711d0c.tar.gz
meson-a437cd1955186060a8c5768fef739830d2711d0c.tar.bz2
Add command to run Python scripts with the current interpreter.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 8d5fb85..0491322 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -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':