[Zodb-checkins] CVS: StandaloneZODB/ZODB - FileStorage.py:1.71

Jeremy Hylton jeremy@zope.com
Fri, 5 Oct 2001 14:04:27 -0400


Update of /cvs-repository/StandaloneZODB/ZODB
In directory cvs.zope.org:/tmp/cvs-serv16622

Modified Files:
	FileStorage.py 
Log Message:
Replace explicit type() comparisons with isinstance() calls


=== StandaloneZODB/ZODB/FileStorage.py 1.70 => 1.71 ===
     def commitVersion(self, src, dest, transaction, abort=None):
         # We are going to commit by simply storing back pointers.
-        if (not src or
-            type(src) is not StringType or type(dest) is not StringType
-            ):
+        if not (src and isinstance(src, StringType)
+                and isinstance(dest, StringType)):
             raise POSException.VersionCommitError('Invalid source version')
 
         if src == dest:
@@ -2012,7 +2011,8 @@
     _ltid=z64
     
     def __init__(self, file):
-        if type(file) is type(''): file=open(file, 'rb')
+        if isinstance(file, StringType):
+            file=open(file, 'rb')
         self._file=file
         if file.read(4) != packed_version: raise FileStorageFormatError, name
         file.seek(0,2)