From 4b2ff81f880a73cff6a4b9ec67cebeed79bd3382 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 2 Aug 2013 18:37:14 -0700 Subject: [PATCH] runTests: portage.util._argparse --- pym/portage/tests/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py index d90fe6fc5..c0ad112ab 100644 --- a/pym/portage/tests/__init__.py +++ b/pym/portage/tests/__init__.py @@ -7,7 +7,6 @@ from __future__ import print_function import sys import time import unittest -from optparse import OptionParser, OptionValueError try: from unittest.runner import _TextTestResult # new in python-2.7 @@ -18,16 +17,17 @@ import portage from portage import os from portage import _encodings from portage import _unicode_decode +from portage.util._argparse import ArgumentParser def main(): suite = unittest.TestSuite() basedir = os.path.dirname(os.path.realpath(__file__)) usage = "usage: %s [options] [tests to run]" % os.path.basename(sys.argv[0]) - parser = OptionParser(usage=usage) - parser.add_option("-l", "--list", help="list all tests", + parser = ArgumentParser(usage=usage) + parser.add_argument("-l", "--list", help="list all tests", action="store_true", dest="list_tests") - (options, args) = parser.parse_args(args=sys.argv) + options, args = parser.parse_known_args(args=sys.argv) if (os.environ.get('NOCOLOR') in ('yes', 'true') or os.environ.get('TERM') == 'dumb' or -- 2.26.2