summaryrefslogtreecommitdiff
path: root/Lib/code.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-10-13 21:49:06 +0200
committerGeorg Brandl <georg@python.org>2013-10-13 21:49:06 +0200
commit51ec371f8d16c26f1c4792c79aefc8497dabe113 (patch)
tree13c6e49254924ca9299e37dc85fabb57fc66148a /Lib/code.py
parent2ee54f0f46258bbcf0126388e5772abb0a0c84ba (diff)
downloadcpython-51ec371f8d16c26f1c4792c79aefc8497dabe113.tar.gz
Closes #17730: in code.interact(), when banner="", do not print anything.
Also adds tests for banner printing.
Diffstat (limited to 'Lib/code.py')
-rw-r--r--Lib/code.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/code.py b/Lib/code.py
index 9020aab701..f8184b6c22 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -216,7 +216,7 @@ class InteractiveConsole(InteractiveInterpreter):
self.write("Python %s on %s\n%s\n(%s)\n" %
(sys.version, sys.platform, cprt,
self.__class__.__name__))
- else:
+ elif banner:
self.write("%s\n" % str(banner))
more = 0
while 1: