Show More
@@ -7,8 +7,6 b' import re' | |||||
7 | import subprocess |
|
7 | import subprocess | |
8 | import sys |
|
8 | import sys | |
9 |
|
9 | |||
10 | ispy3 = sys.version_info[0] >= 3 |
|
|||
11 |
|
||||
12 | if 'TERM' in os.environ: |
|
10 | if 'TERM' in os.environ: | |
13 | del os.environ['TERM'] |
|
11 | del os.environ['TERM'] | |
14 |
|
12 | |||
@@ -40,9 +38,7 b' def testmod(name, optionflags=0, testtar' | |||||
40 |
|
38 | |||
41 | # minimal copy of doctest.testmod() |
|
39 | # minimal copy of doctest.testmod() | |
42 | finder = doctest.DocTestFinder() |
|
40 | finder = doctest.DocTestFinder() | |
43 |
checker = |
|
41 | checker = py3docchecker() | |
44 | if ispy3: |
|
|||
45 | checker = py3docchecker() |
|
|||
46 | runner = doctest.DocTestRunner(checker=checker, optionflags=optionflags) |
|
42 | runner = doctest.DocTestRunner(checker=checker, optionflags=optionflags) | |
47 | for test in finder.find(mod, name): |
|
43 | for test in finder.find(mod, name): | |
48 | runner.run(test) |
|
44 | runner.run(test) | |
@@ -91,8 +87,7 b' for f in files:' | |||||
91 | if not re.search(br'\n\s*>>>', fh.read()): |
|
87 | if not re.search(br'\n\s*>>>', fh.read()): | |
92 | continue |
|
88 | continue | |
93 |
|
89 | |||
94 | if ispy3: |
|
90 | f = f.decode() | |
95 | f = f.decode() |
|
|||
96 |
|
91 | |||
97 | modname = f.replace('.py', '').replace('\\', '.').replace('/', '.') |
|
92 | modname = f.replace('.py', '').replace('\\', '.').replace('/', '.') | |
98 |
|
93 |
General Comments 0
You need to be logged in to leave comments.
Login now