diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-27 15:56:54 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-27 15:56:54 +0200 |
commit | de7c53b0264ddcf63fb0c56fdb125072b92c0057 (patch) | |
tree | a175fbf2dc0ceaba7e305f46a91d7d281f195369 | |
parent | 9f5e84d4917b29fe6d7668f4742da8769b4ff515 (diff) | |
download | gemato-de7c53b0264ddcf63fb0c56fdb125072b92c0057.tar.gz |
Use sys.hexversion instead of .version_info
-rw-r--r-- | gemato/compression.py | 4 | ||||
-rw-r--r-- | tests/testutil.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gemato/compression.py b/gemato/compression.py index be1471a..f3854fb 100644 --- a/gemato/compression.py +++ b/gemato/compression.py @@ -8,7 +8,7 @@ import io import os.path import sys -if sys.version_info >= (3, 3): +if sys.hexversion >= 0x03030000: import bz2 else: # older bz2 module versions do not handle multiple streams correctly @@ -45,7 +45,7 @@ def open_compressed_file(suffix, f, mode='rb'): if suffix == "gz": # work-around the deficiency in GzipFile class in py<3.3 causing # it to break with TextIOWrapper - if sys.version_info < (3, 3): + if sys.hexversion < 0x03030000: class FixedGzipFile(gzip.GzipFile): def read1(self, *args, **kwargs): return self.read(*args, **kwargs) diff --git a/tests/testutil.py b/tests/testutil.py index 89feb3c..2a002c1 100644 --- a/tests/testutil.py +++ b/tests/testutil.py @@ -14,7 +14,7 @@ import unittest class LoggingTestCase(unittest.TestCase): def setUp(self): - if sys.version_info < (3,): + if sys.hexversion < 0x03000000: self.log = io.BytesIO() else: self.log = io.StringIO() |