##// END OF EJS Templates
py3: flush std streams before/after running user code in heredoctest.py...
Yuya Nishihara -
r40354:55fd0fef default
parent child Browse files
Show More
@@ -2,6 +2,10 b' from __future__ import absolute_import, '
2
2
3 import sys
3 import sys
4
4
5 def flush():
6 sys.stdout.flush()
7 sys.stderr.flush()
8
5 globalvars = {}
9 globalvars = {}
6 lines = sys.stdin.readlines()
10 lines = sys.stdin.readlines()
7 while lines:
11 while lines:
@@ -15,6 +19,9 b' while lines:'
15 snippet += l[4:]
19 snippet += l[4:]
16 c = compile(snippet, '<heredoc>', 'single')
20 c = compile(snippet, '<heredoc>', 'single')
17 try:
21 try:
22 flush()
18 exec(c, globalvars)
23 exec(c, globalvars)
24 flush()
19 except Exception as inst:
25 except Exception as inst:
26 flush()
20 print(repr(inst))
27 print(repr(inst))
General Comments 0
You need to be logged in to leave comments. Login now