Commits

Andriy Kornatskyy committed 3420a59

Fixed python 3.2+ compatibility issue.

  • Participants
  • Parent commits 70c36ce

Comments (0)

Files changed (2)

File src/wheezy/core/comp.py

 
 GzipFile = __import__('gzip', None, None, ['GzipFile']).GzipFile
 
-if PY2 and PY_MINOR < 7:
+if PY2 and PY_MINOR < 7:  # pragma: nocover
     __saved_GzipFile__ = GzipFile
 
     def GzipFile(filename=None, mode=None, compresslevel=9,

File src/wheezy/core/tests/test_gzip.py

     def test_compress_decompress(self):
         """ Ensure decompress is a reverse function of compress.
         """
+        from wheezy.core.comp import bton
+        from wheezy.core.comp import ntob
         from wheezy.core.gzip import compress
         from wheezy.core.gzip import decompress
-        assert 'test' == decompress(compress('test'))
+        c = compress(ntob('test', 'utf-8'))
+        assert 'test' == bton(decompress(c), 'utf-8')