Skip to content

Commit

Permalink
Merge pull request #279 from abravalheri/warnings-exist
Browse files Browse the repository at this point in the history
Remove outdated `ImportError` check for `warnings`
  • Loading branch information
jaraco authored Aug 22, 2024
2 parents dcb0a64 + 8c6015c commit 7f0e0c9
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions distutils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@
import pathlib
import re
import sys
import warnings
from collections.abc import Iterable
from email import message_from_file

from ._vendor.packaging.utils import canonicalize_name, canonicalize_version

try:
import warnings
except ImportError:
warnings = None

from ._log import log
from ._vendor.packaging.utils import canonicalize_name, canonicalize_version
from .debug import DEBUG
from .errors import (
DistutilsArgError,
Expand Down Expand Up @@ -249,10 +244,7 @@ def __init__(self, attrs=None): # noqa: C901
attrs['license'] = attrs['licence']
del attrs['licence']
msg = "'licence' distribution option is deprecated; use 'license'"
if warnings is not None:
warnings.warn(msg)
else:
sys.stderr.write(msg + "\n")
warnings.warn(msg)

# Now work on the rest of the attributes. Any attribute that's
# not already defined is invalid!
Expand Down

0 comments on commit 7f0e0c9

Please sign in to comment.