mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 16:07:30 +03:00 
			
		
		
		
	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:
		
							parent
							
								
									adae7ecc6a
								
							
						
					
					
						commit
						07bff3e9b8
					
				|  | @ -4,8 +4,6 @@ from helper import unittest, PillowTestCase | ||||||
| 
 | 
 | ||||||
| from PIL import _util | from PIL import _util | ||||||
| 
 | 
 | ||||||
| py36 = sys.version_info.major >= 3 and sys.version_info.minor >= 6 |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| class TestUtil(PillowTestCase): | class TestUtil(PillowTestCase): | ||||||
| 
 | 
 | ||||||
|  | @ -39,7 +37,7 @@ class TestUtil(PillowTestCase): | ||||||
|         # Assert |         # Assert | ||||||
|         self.assertTrue(it_is) |         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): |     def test_path_obj_is_path(self): | ||||||
|         # Arrange |         # Arrange | ||||||
|         from pathlib import Path |         from pathlib import Path | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ import os | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| py3 = sys.version_info.major >= 3 | py3 = sys.version_info.major >= 3 | ||||||
| py36 = py3 and sys.version_info.minor >= 6 | py36 = sys.version_info[0:2] >= (3, 6) | ||||||
| 
 | 
 | ||||||
| if py3: | if py3: | ||||||
|     def isStringType(t): |     def isStringType(t): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user