From 1fe4070af6ac796ebdf2aedf91e64519ed1e25aa Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 11 Aug 2020 22:29:44 +0300 Subject: [PATCH] Drop support for EOL Python 3.5 --- Tests/test_util.py | 1 - src/PIL/_util.py | 17 +++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Tests/test_util.py b/Tests/test_util.py index 3d88b9472..0bc8b0702 100644 --- a/Tests/test_util.py +++ b/Tests/test_util.py @@ -13,7 +13,6 @@ def test_is_path(): assert it_is -@pytest.mark.skipif(not _util.py36, reason="os.path support for Paths added in 3.6") def test_path_obj_is_path(): # Arrange from pathlib import Path diff --git a/src/PIL/_util.py b/src/PIL/_util.py index 755b4b272..0c5d3892e 100644 --- a/src/PIL/_util.py +++ b/src/PIL/_util.py @@ -1,20 +1,9 @@ import os -import sys - -py36 = sys.version_info[0:2] >= (3, 6) +from pathlib import Path -if py36: - from pathlib import Path - - def isPath(f): - return isinstance(f, (bytes, str, Path)) - - -else: - - def isPath(f): - return isinstance(f, (bytes, str)) +def isPath(f): + return isinstance(f, (bytes, str, Path)) # Checks if an object is a string, and that it points to a directory.