diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-05-03 21:05:51 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-05-03 21:05:51 (GMT) |
commit | aa97f0496412ed834aada921e29588ed16d68e40 (patch) | |
tree | cfe74cb3cd3ed5a27cbcfa404ea9fc8c73fd63f1 /Lib/plat-mac | |
parent | 5d7a7001d9df605606b249b3e11707d6d1ad2e3d (diff) | |
download | cpython-aa97f0496412ed834aada921e29588ed16d68e40.zip cpython-aa97f0496412ed834aada921e29588ed16d68e40.tar.gz cpython-aa97f0496412ed834aada921e29588ed16d68e40.tar.bz2 |
Fix various spots where int/long and str/unicode unification
lead to type checks like isinstance(foo, (str, str)) or
isinstance(foo, (int, int)).
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r-- | Lib/plat-mac/EasyDialogs.py | 2 | ||||
-rw-r--r-- | Lib/plat-mac/plistlib.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Lib/plat-mac/EasyDialogs.py b/Lib/plat-mac/EasyDialogs.py index 6d157f9..dfed24f 100644 --- a/Lib/plat-mac/EasyDialogs.py +++ b/Lib/plat-mac/EasyDialogs.py @@ -713,7 +713,7 @@ def AskFileForSave( raise TypeError, "Cannot pass wanted=FSRef to AskFileForSave" if issubclass(tpwanted, Carbon.File.FSSpec): return tpwanted(rr.selection[0]) - if issubclass(tpwanted, (str, str)): + if issubclass(tpwanted, str): if sys.platform == 'mac': fullpath = rr.selection[0].as_pathname() else: diff --git a/Lib/plat-mac/plistlib.py b/Lib/plat-mac/plistlib.py index b040237..049b50b 100644 --- a/Lib/plat-mac/plistlib.py +++ b/Lib/plat-mac/plistlib.py @@ -70,7 +70,7 @@ def readPlist(pathOrFile): usually is a dictionary). """ didOpen = 0 - if isinstance(pathOrFile, (str, str)): + if isinstance(pathOrFile, str): pathOrFile = open(pathOrFile) didOpen = 1 p = PlistParser() @@ -85,7 +85,7 @@ def writePlist(rootObject, pathOrFile): file name or a (writable) file object. """ didOpen = 0 - if isinstance(pathOrFile, (str, str)): + if isinstance(pathOrFile, str): pathOrFile = open(pathOrFile, "w") didOpen = 1 writer = PlistWriter(pathOrFile) @@ -231,7 +231,7 @@ class PlistWriter(DumbXMLWriter): DumbXMLWriter.__init__(self, file, indentLevel, indent) def writeValue(self, value): - if isinstance(value, (str, str)): + if isinstance(value, str): self.simpleElement("string", value) elif isinstance(value, bool): # must switch for bool before int, as bool is a @@ -270,7 +270,7 @@ class PlistWriter(DumbXMLWriter): self.beginElement("dict") items = sorted(d.items()) for key, value in items: - if not isinstance(key, (str, str)): + if not isinstance(key, str): raise TypeError("keys must be strings") self.simpleElement("key", key) self.writeValue(value) |