Thanks to visit codestin.com Credit goes to github.com
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 fad2f59 commit e037665Copy full SHA for e037665
1 file changed
Lib/StringIO.py
@@ -39,7 +39,7 @@
39
class StringIO:
40
def __init__(self, buf = ''):
41
# Force self.buf to be a string or unicode
42
- if type(buf) is not types.UnicodeType:
+ if not isinstance(buf, types.UnicodeType):
43
buf = str(buf)
44
self.buf = buf
45
self.len = len(buf)
@@ -138,7 +138,7 @@ def write(self, s):
138
raise ValueError, "I/O operation on closed file"
139
if not s: return
140
# Force s to be a string or unicode
141
- if type(s) is not types.UnicodeType:
+ if not isinstance(s, types.UnicodeType):
142
s = str(s)
143
if self.pos > self.len:
144
self.buflist.append('\0'*(self.pos - self.len))
0 commit comments