We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03df3b3 commit 4ec59c7Copy full SHA for 4ec59c7
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