diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-10-31 21:09:54 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-10-31 21:37:48 -0400 |
| commit | 84b1cd8e7760a9b3c984a4edfc37dc7266952266 (patch) | |
| tree | 45ec898ae86857fec79e1bede051713aeba1e21d /pkg_resources | |
| parent | 96475e3b3af4e0a0166cdb75c976ce07cfd44fce (diff) | |
| download | python-setuptools-git-84b1cd8e7760a9b3c984a4edfc37dc7266952266.tar.gz | |
Raise a deprecation warning when an invalid version is encountered. Ref #2497. Ref #2822.
Diffstat (limited to 'pkg_resources')
| -rw-r--r-- | pkg_resources/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index c84f1dd9..3aafe652 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -113,6 +113,11 @@ def parse_version(v): try: return packaging.version.Version(v) except packaging.version.InvalidVersion: + warnings.warn( + f"{v} is an invalid version and will not be supported in " + "a future release", + PkgResourcesDeprecationWarning, + ) return packaging.version.LegacyVersion(v) |
