]> granicus.if.org Git - python/commitdiff
Remove dependency on order of mode flags
authorRaymond Hettinger <python@rcn.com>
Wed, 16 Feb 2005 09:27:49 +0000 (09:27 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 16 Feb 2005 09:27:49 +0000 (09:27 +0000)
Lib/zipfile.py

index 958ee9e95a1298a95057c92d48ab7f8628bbbccc..93436cf8b350f3138fbe67f1fbde8a853c16c0ae 100644 (file)
@@ -193,7 +193,7 @@ class ZipFile:
         self.NameToInfo = {}    # Find file info given name
         self.filelist = []      # List of ZipInfo instances for archive
         self.compression = compression  # Method of compression
-        self.mode = key = mode[0].replace('b', '')
+        self.mode = key = mode.replace('b', '')[0]
 
         # Check if we were passed a file-like object
         if isinstance(file, basestring):