Commits

Andriy Kornatskyy  committed 70c36ce

Fixed python 2.4-2.6 compatibility issue.

  • Participants
  • Parent commits 860b832

Comments (0)

Files changed (2)

File src/wheezy/core/comp.py

         from cdecimal import Decimal  # noqa
     except ImportError:
         from decimal import Decimal  # noqa
+
+GzipFile = __import__('gzip', None, None, ['GzipFile']).GzipFile
+
+if PY2 and PY_MINOR < 7:
+    __saved_GzipFile__ = GzipFile
+
+    def GzipFile(filename=None, mode=None, compresslevel=9,
+                 fileobj=None, mtime=None):
+        return __saved_GzipFile__(filename, mode, compresslevel,
+                                  fileobj)

File src/wheezy/core/gzip.py

 """
 
 from wheezy.core.comp import BytesIO
-from wheezy.core.introspection import import_name
-
-
-GzipFile = import_name('gzip.GzipFile')
+from wheezy.core.comp import GzipFile
 
 
 def compress(data, compresslevel=9):