Implement @hugovk's comments

The `py36` flag now uses a tuple comparison to correctly handle future
major version. The unit test file also now uses `py36` as exported by
the _util module, rather than re-testing `sys.version_info`.
This commit is contained in:
Will Badart 2019-01-28 19:45:53 -05:00
parent adae7ecc6a
commit 07bff3e9b8
No known key found for this signature in database
GPG Key ID: 75CC5647CFEAA75E
2 changed files with 2 additions and 4 deletions

View File

@ -4,8 +4,6 @@ from helper import unittest, PillowTestCase
from PIL import _util
py36 = sys.version_info.major >= 3 and sys.version_info.minor >= 6
class TestUtil(PillowTestCase):
@ -39,7 +37,7 @@ class TestUtil(PillowTestCase):
# Assert
self.assertTrue(it_is)
@unittest.skipIf(not py36, 'os.path support for Paths added in 3.6')
@unittest.skipIf(not _util.py36, 'os.path support for Paths added in 3.6')
def test_path_obj_is_path(self):
# Arrange
from pathlib import Path

View File

@ -2,7 +2,7 @@ import os
import sys
py3 = sys.version_info.major >= 3
py36 = py3 and sys.version_info.minor >= 6
py36 = sys.version_info[0:2] >= (3, 6)
if py3:
def isStringType(t):