remove all references to optparse (deprecated since Python 3.2)

This commit is contained in:
Hans-Christoph Steiner 2024-05-02 14:08:28 +02:00
parent 717df09be0
commit 1e5699e90c
24 changed files with 115 additions and 93 deletions

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import inspect
import optparse
import os
import sys
import pkgutil
@ -265,15 +264,17 @@ class MainTest(unittest.TestCase):
if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))
parser = optparse.OptionParser()
parser.add_option(
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"-v",
"--verbose",
action="store_true",
default=False,
help="Spew out even more information than normal",
)
(common.options, args) = parser.parse_args(['--verbose'])
common.options = parser.parse_args(['--verbose'])
newSuite = unittest.TestSuite()
newSuite.addTest(unittest.makeSuite(MainTest))