1 parent eb7afb7 commit cf0b7e8Copy full SHA for cf0b7e8
1 file changed
Lib/code.py
@@ -10,6 +10,17 @@
10
import traceback
11
from codeop import compile_command
12
13
+def softspace(file, newvalue):
14
+ oldvalue = 0
15
+ try:
16
+ oldvalue = file.softspace
17
+ except AttributeError:
18
+ pass
19
20
+ file.softspace = newvalue
21
+ except TypeError: # "attribute-less object" or "read-only attributes"
22
23
+ return oldvalue
24
25
class InteractiveInterpreter:
26
"""Base class for InteractiveConsole.
@@ -90,6 +101,9 @@ def runcode(self, code):
90
101
raise
91
102
except:
92
103
self.showtraceback()
104
+ else:
105
+ if softspace(sys.stdout, 0):
106
+ print
93
107
94
108
def showsyntaxerror(self, filename=None):
95
109
"""Display the syntax error that just occurred.
0 commit comments