Submitter | Yuya Nishihara |
---|---|
Date | Oct. 16, 2018, 7:26 a.m. |
Message ID | <8190570be13dc584dfab.1539674804@mimosa> |
Download | mbox | patch |
Permalink | /patch/36029/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/tests/heredoctest.py b/tests/heredoctest.py --- a/tests/heredoctest.py +++ b/tests/heredoctest.py @@ -2,6 +2,10 @@ from __future__ import absolute_import, import sys +def flush(): + sys.stdout.flush() + sys.stderr.flush() + globalvars = {} lines = sys.stdin.readlines() while lines: @@ -15,6 +19,9 @@ while lines: snippet += l[4:] c = compile(snippet, '<heredoc>', 'single') try: + flush() exec(c, globalvars) + flush() except Exception as inst: + flush() print(repr(inst))