import re as _re
import sys as _sys
-import warnings
-
from gettext import gettext as _, ngettext
SUPPRESS = '==SUPPRESS=='
# parser.add_argument('-f', action=BooleanOptionalAction, type=int)
for field_name in ('type', 'choices', 'metavar'):
if locals()[field_name] is not _deprecated_default:
+ import warnings
warnings._deprecated(
field_name,
"{name!r} is deprecated as of Python 3.12 and will be "
self._group_actions.remove(action)
def add_argument_group(self, *args, **kwargs):
+ import warnings
warnings.warn(
"Nesting argument groups is deprecated.",
category=DeprecationWarning,
self._group_actions.remove(action)
def add_mutually_exclusive_group(self, *args, **kwargs):
+ import warnings
warnings.warn(
"Nesting mutually exclusive groups is deprecated.",
category=DeprecationWarning,
from enum import IntEnum, global_enum
import locale as _locale
from itertools import repeat
-import warnings
__all__ = ["IllegalMonthError", "IllegalWeekdayError", "setfirstweekday",
"firstweekday", "isleap", "leapdays", "weekday", "monthrange",
def __getattr__(name):
if name in ('January', 'February'):
+ import warnings
warnings.warn(f"The '{name}' attribute is deprecated, use '{name.upper()}' instead",
DeprecationWarning, stacklevel=2)
if name == 'January':
import io
import os
import sys
-import warnings
__all__ = ["getpass","getuser","GetPassWarning"]
def fallback_getpass(prompt='Password: ', stream=None):
+ import warnings
warnings.warn("Can not control echo on the terminal.", GetPassWarning,
stacklevel=2)
if not stream:
import fnmatch
import collections
import errno
-import warnings
try:
import zlib
"""
if onerror is not None:
+ import warnings
warnings.warn("onerror argument is deprecated, use onexc instead",
DeprecationWarning, stacklevel=2)
import struct
import copy
import re
-import warnings
try:
import pwd
if filter is None:
filter = self.extraction_filter
if filter is None:
+ import warnings
warnings.warn(
'Python 3.14 will, by default, filter extracted tar '
+ 'archives and reject files or modify their metadata. '
--- /dev/null
+Slightly improve the import time of several standard-library modules by
+deferring imports of :mod:`warnings` within those modules. Patch by Alex
+Waygood.