Skip to content

Commit

Permalink
Remove outdated import error check for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 12, 2024
1 parent 8993718 commit 6f0511f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions distutils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +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 .debug import DEBUG
from .errors import (
Expand Down Expand Up @@ -249,10 +245,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 6f0511f

Please sign in to comment.