| 1 | --- src/Lib/doctest.py 2011-12-02 06:14:21.000000000 -0800 |
| 2 | +++ src/Lib/doctest.py 2012-03-21 12:44:08.000000000 -0700 |
| 3 | @@ -1,3 +1,6 @@ |
| 4 | +# DocTestRunner updated to be able to aquire timing information. |
| 5 | +# Lines that have been changed are marked with # modified, # added or # removed |
| 6 | + |
| 7 | # Module doctest. |
| 8 | # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). |
| 9 | # Major enhancements and refactoring by: |
| 10 | @@ -1250,8 +1253,9 @@ |
| 11 | # keyboard interrupts.) |
| 12 | try: |
| 13 | # Don't blink! This is where the user's code gets run. |
| 14 | - exec compile(example.source, filename, "single", |
| 15 | - compileflags, 1) in test.globs |
| 16 | + compiled = compile(example.source, filename, "single", |
| 17 | + compileflags, 1) |
| 18 | + self.execute(example, compiled, test.globs) |
| 19 | self.debugger.set_continue() # ==== Example Finished ==== |
| 20 | exception = None |
| 21 | except KeyboardInterrupt: |
| 22 | @@ -1472,6 +1476,12 @@ |
| 23 | f = f + f2 |
| 24 | t = t + t2 |
| 25 | d[name] = f, t |
| 26 | + |
| 27 | + #///////////////////////////////////////////////////////////////// |
| 28 | + # Added methods. |
| 29 | + #///////////////////////////////////////////////////////////////// |
| 30 | + def execute(self, example, compiled, globs): # added |
| 31 | + exec compiled in globs # added |
| 32 | |
| 33 | class OutputChecker: |
| 34 | """ |