mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
Repair some out-of-date comments.
This commit is contained in:
parent
bb43147312
commit
208ca7075f
1 changed files with 2 additions and 8 deletions
|
|
@ -1279,10 +1279,7 @@ class DocTestRunner:
|
||||||
# any exception that gets raised. (But don't intercept
|
# any exception that gets raised. (But don't intercept
|
||||||
# keyboard interrupts.)
|
# keyboard interrupts.)
|
||||||
try:
|
try:
|
||||||
# If the example is a compound statement on one line,
|
# Don't blink! This is where the user's code gets run.
|
||||||
# like "if 1: print 2", then compile() requires a
|
|
||||||
# trailing newline. Rather than analyze that, always
|
|
||||||
# append one (it never hurts).
|
|
||||||
exec compile(example.source, "<string>", "single",
|
exec compile(example.source, "<string>", "single",
|
||||||
compileflags, 1) in test.globs
|
compileflags, 1) in test.globs
|
||||||
exception = None
|
exception = None
|
||||||
|
|
@ -1291,10 +1288,7 @@ class DocTestRunner:
|
||||||
except:
|
except:
|
||||||
exception = sys.exc_info()
|
exception = sys.exc_info()
|
||||||
|
|
||||||
# Extract the example's actual output from fakeout, and
|
got = self._fakeout.getvalue() # the actual output
|
||||||
# write it to `got`. Add a terminating newline if it
|
|
||||||
# doesn't have already one.
|
|
||||||
got = self._fakeout.getvalue()
|
|
||||||
self._fakeout.truncate(0)
|
self._fakeout.truncate(0)
|
||||||
|
|
||||||
# If the example executed without raising any exceptions,
|
# If the example executed without raising any exceptions,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue