aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/meson_exe.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-03-25 18:22:52 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-27 00:39:45 +0300
commit9b2e533d87ad33c86b23869f2992c5882c8f6f6b (patch)
tree94ff3dfb5659757af6943a045ebdd293747b40ef /mesonbuild/scripts/meson_exe.py
parent977acc94b84077e84da7ddde4099e96f03530038 (diff)
downloadmeson-9b2e533d87ad33c86b23869f2992c5882c8f6f6b.zip
meson-9b2e533d87ad33c86b23869f2992c5882c8f6f6b.tar.gz
meson-9b2e533d87ad33c86b23869f2992c5882c8f6f6b.tar.bz2
Always build parser objects anew to avoid leaking old data.
Diffstat (limited to 'mesonbuild/scripts/meson_exe.py')
-rw-r--r--mesonbuild/scripts/meson_exe.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py
index c43702e..46d501f 100644
--- a/mesonbuild/scripts/meson_exe.py
+++ b/mesonbuild/scripts/meson_exe.py
@@ -21,8 +21,10 @@ import subprocess
options = None
-parser = argparse.ArgumentParser()
-parser.add_argument('args', nargs='+')
+def buildparser():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('args', nargs='+')
+ return parser
def is_windows():
platname = platform.system().lower()
@@ -70,7 +72,7 @@ def run_exe(exe):
def run(args):
global options
- options = parser.parse_args(args)
+ options = buildparser().parse_args(args)
if len(options.args) != 1:
print('Test runner for Meson. Do not run on your own, mmm\'kay?')
print(sys.argv[0] + ' [data file]')