Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bcc2c12

Browse files
committed
Change raw "except:" constructs to pass on KeyboardInterrupt.
Bugfix candidate? Don't know -- never bothered me, but it's minor either way.
1 parent 1abca4a commit bcc2c12

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/doctest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ def _run_examples_inner(out, fakeout, examples, globs, verbose, name,
430430
compileflags, 1) in globs
431431
got = fakeout.get()
432432
state = OK
433+
except KeyboardInterrupt:
434+
raise
433435
except:
434436
# See whether the exception was expected.
435437
if want.find("Traceback (innermost last):\n") == 0 or \
@@ -521,6 +523,8 @@ def run_docstring_examples(f, globs, verbose=0, name="NoName",
521523
# just in case CT invents a doc object that has to be forced
522524
# to look like a string <0.9 wink>
523525
doc = str(doc)
526+
except KeyboardInterrupt:
527+
raise
524528
except:
525529
return 0, 0
526530

0 commit comments

Comments
 (0)