Skip to content

Commit

Permalink
Emit warning after parsing. Fixes #122.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 28, 2022
1 parent fde3555 commit f2e73a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distutils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ class Version:
"""

def __init__ (self, vstring=None):
if vstring:
self.parse(vstring)
warnings.warn(
"distutils Version classes are deprecated. "
"Use packaging.version instead.",
DeprecationWarning,
stacklevel=2,
)
if vstring:
self.parse(vstring)

def __repr__ (self):
return "%s ('%s')" % (self.__class__.__name__, str(self))
Expand Down

0 comments on commit f2e73a4

Please sign in to comment.