comparison Lib/idlelib/PyShell.py @ 78036:58189e37331c 2.7

- Issue #13532: Check that arguments to sys.stdout.write are strings.
author Martin v. Löwis <martin@v.loewis.de>
date Mon, 09 Jul 2012 21:01:49 +0200
parents 1a4e99460438
children 2993f566c82e
comparison
equal deleted inserted replaced
78011:ab22ffa6fb2e 78036:58189e37331c
1263 self.tags = tags 1263 self.tags = tags
1264 self.softspace = 0 1264 self.softspace = 0
1265 self.encoding = encoding 1265 self.encoding = encoding
1266 1266
1267 def write(self, s): 1267 def write(self, s):
1268 if not isinstance(s, str):
1269 raise TypeError('must be str, not ' + type(s).__name__)
1268 self.shell.write(s, self.tags) 1270 self.shell.write(s, self.tags)
1269 1271
1270 def writelines(self, lines): 1272 def writelines(self, lines):
1271 for line in lines: 1273 for line in lines:
1272 self.write(line) 1274 self.write(line)