tests: drop py2 support from test-doctest.py
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 03 Jan 2023 23:47:29 -0500
changeset 49872 40060267df22
parent 49871 ecde742a5a9d
child 49873 e9d06ed64161
tests: drop py2 support from test-doctest.py
tests/test-doctest.py
--- a/tests/test-doctest.py	Tue Jan 03 23:44:12 2023 -0500
+++ b/tests/test-doctest.py	Tue Jan 03 23:47:29 2023 -0500
@@ -7,8 +7,6 @@
 import subprocess
 import sys
 
-ispy3 = sys.version_info[0] >= 3
-
 if 'TERM' in os.environ:
     del os.environ['TERM']
 
@@ -40,9 +38,7 @@
 
     # minimal copy of doctest.testmod()
     finder = doctest.DocTestFinder()
-    checker = None
-    if ispy3:
-        checker = py3docchecker()
+    checker = py3docchecker()
     runner = doctest.DocTestRunner(checker=checker, optionflags=optionflags)
     for test in finder.find(mod, name):
         runner.run(test)
@@ -91,8 +87,7 @@
         if not re.search(br'\n\s*>>>', fh.read()):
             continue
 
-    if ispy3:
-        f = f.decode()
+    f = f.decode()
 
     modname = f.replace('.py', '').replace('\\', '.').replace('/', '.')