bpo-30166: Import command-line parsing modules only when needed. (#1293)
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 0b78544..5e5bc21 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -93,7 +93,6 @@
]
import __future__
-import argparse
import difflib
import inspect
import linecache
@@ -2741,6 +2740,8 @@
def _test():
+ import argparse
+
parser = argparse.ArgumentParser(description="doctest runner")
parser.add_argument('-v', '--verbose', action='store_true', default=False,
help='print very verbose output for all tests')