From de7c53b0264ddcf63fb0c56fdb125072b92c0057 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Fri, 27 Oct 2017 15:56:54 +0200 Subject: Use sys.hexversion instead of .version_info --- gemato/compression.py | 4 ++-- 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() -- cgit v1.2.3