Skip to content

Commit 6f0511f

Browse files
committed
Remove outdated import error check for warnings
1 parent 8993718 commit 6f0511f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

distutils/dist.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@
1010
import pathlib
1111
import re
1212
import sys
13+
import warnings
1314
from collections.abc import Iterable
1415
from email import message_from_file
1516

1617
from ._vendor.packaging.utils import canonicalize_name, canonicalize_version
1718

18-
try:
19-
import warnings
20-
except ImportError:
21-
warnings = None
22-
2319
from ._log import log
2420
from .debug import DEBUG
2521
from .errors import (
@@ -249,10 +245,7 @@ def __init__(self, attrs=None): # noqa: C901
249245
attrs['license'] = attrs['licence']
250246
del attrs['licence']
251247
msg = "'licence' distribution option is deprecated; use 'license'"
252-
if warnings is not None:
253-
warnings.warn(msg)
254-
else:
255-
sys.stderr.write(msg + "\n")
248+
warnings.warn(msg)
256249

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

0 commit comments

Comments
 (0)