From c3645e2b4568458edd3badae599db5bc232ad773 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 2 Mar 2015 16:19:49 +0200 Subject: [PATCH] Use argparse instead of optparse in run_tests. --- run_tests.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/run_tests.py b/run_tests.py index 900b2f2f0..c9fcd093b 100755 --- a/run_tests.py +++ b/run_tests.py @@ -18,7 +18,8 @@ from glob import glob import os, subprocess, shutil, sys, platform, signal import environment import mesonlib -from optparse import OptionParser +import argparse + from meson import backendlist passing_tests = 0 @@ -328,10 +329,10 @@ def generate_prebuilt_object(): return objectfile if __name__ == '__main__': - parser = OptionParser() - parser.add_option('--backend', default=None, dest='backend', + parser = argparse.ArgumentParser(description="Run the test suite of Meson.") + parser.add_argument('--backend', default=None, dest='backend', choices = backendlist) - (options, args) = parser.parse_args(sys.argv) + options = parser.parse_args() setup_commands(options.backend) script_dir = os.path.split(__file__)[0]