summaryrefslogtreecommitdiffstats
path: root/Lib/StringIO.py
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-05-13 09:42:16 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-05-13 09:42:16 (GMT)
commite1c67d1dc028b59805d29ee7e943e342da55d270 (patch)
tree0d8ac4a6960d44e6327f938aef67192d3b8f500b /Lib/StringIO.py
parent775c11f07ab766325b12f125ec52c495c0478b0b (diff)
downloadcpython-e1c67d1dc028b59805d29ee7e943e342da55d270.zip
cpython-e1c67d1dc028b59805d29ee7e943e342da55d270.tar.gz
cpython-e1c67d1dc028b59805d29ee7e943e342da55d270.tar.bz2
Make StringIO work in --disable-unicode builds...
Diffstat (limited to 'Lib/StringIO.py')
-rw-r--r--Lib/StringIO.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/StringIO.py b/Lib/StringIO.py
index 9225c05..38b3e36 100644
--- a/Lib/StringIO.py
+++ b/Lib/StringIO.py
@@ -39,7 +39,7 @@ __all__ = ["StringIO"]
class StringIO:
def __init__(self, buf = ''):
# Force self.buf to be a string or unicode
- if not isinstance(buf, types.UnicodeType):
+ if not isinstance(buf, types.StringTypes):
buf = str(buf)
self.buf = buf
self.len = len(buf)
@@ -138,7 +138,7 @@ class StringIO:
raise ValueError, "I/O operation on closed file"
if not s: return
# Force s to be a string or unicode
- if not isinstance(s, types.UnicodeType):
+ if not isinstance(s, types.StringTypes):
s = str(s)
if self.pos > self.len:
self.buflist.append('\0'*(self.pos - self.len))