Skip to content

Commit cf58e1a

Browse files
committed
Revert "Revert "Remove ensure_is_path, no longer required after dropping Python 3.4." and "Drop support for Python 3.4.""
This reverts commit 740e858.
1 parent f4d2041 commit cf58e1a

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

importlib_metadata/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
ModuleNotFoundError,
2828
MetaPathFinder,
2929
email_message_from_string,
30-
ensure_is_path,
3130
PyPy_repr,
3231
)
3332
from importlib import import_module
@@ -220,7 +219,7 @@ def at(path):
220219
:param path: a string or path-like object
221220
:return: a concrete Distribution instance for the path
222221
"""
223-
return PathDistribution(ensure_is_path(path))
222+
return PathDistribution(pathlib.Path(path))
224223

225224
@staticmethod
226225
def _discover_resolvers():

importlib_metadata/_compat.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ def py2_message_from_string(text): # nocoverpy3
115115
PYPY_OPEN_BUG = getattr(sys, 'pypy_version_info', (9, 9, 9))[:3] <= (7, 1, 1)
116116

117117

118-
def ensure_is_path(ob):
119-
"""Construct a Path from ob even if it's already one.
120-
Specialized for Python 3.4.
121-
"""
122-
if (3,) < sys.version_info < (3, 5):
123-
ob = str(ob) # pragma: nocover
124-
return pathlib.Path(ob)
125-
126-
127118
class PyPy_repr:
128119
"""
129120
Override repr for EntryPoint objects on PyPy to avoid __iter__ access.

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ classifiers =
1515
Programming Language :: Python :: 2
1616

1717
[options]
18-
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
18+
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
1919
setup_requires = setuptools-scm
2020
install_requires =
2121
zipp>=0.5
22-
pathlib2; python_version=='3.4.*' or python_version < '3'
22+
pathlib2; python_version < '3'
2323
contextlib2; python_version < '3'
2424
configparser>=3.5; python_version < '3'
2525
packages = find:

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ setenv =
3333
cov: COVERAGE_OPTIONS="-p"
3434
cov: COVERAGE_FILE={toxinidir}/.coverage
3535
py27: PYV=2
36-
py34,py35,py36,py37,py38: PYV=3
36+
py35,py36,py37,py38: PYV=3
3737
# workaround deprecation warnings in pip's vendored packages
3838
PYTHONWARNINGS=ignore:Using or importing the ABCs:DeprecationWarning:pip._vendor
3939
extras =

0 commit comments

Comments
 (0)