summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/plistlib.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-03 21:05:51 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-03 21:05:51 (GMT)
commitaa97f0496412ed834aada921e29588ed16d68e40 (patch)
treecfe74cb3cd3ed5a27cbcfa404ea9fc8c73fd63f1 /Lib/plat-mac/plistlib.py
parent5d7a7001d9df605606b249b3e11707d6d1ad2e3d (diff)
downloadcpython-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/plistlib.py')
-rw-r--r--Lib/plat-mac/plistlib.py8
1 files changed, 4 insertions, 4 deletions
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)