diff options
author | Victor Stinner <vstinner@python.org> | 2023-07-09 08:32:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-09 08:32:50 (GMT) |
commit | dcc028d92428bd57358a5028ada2a53fc79fc365 (patch) | |
tree | a3e01491722c6e08e290bad3224568b9376e433e /Lib/logging | |
parent | da98ed0aa040791ef08b24befab697038c8c9fd5 (diff) | |
download | cpython-dcc028d92428bd57358a5028ada2a53fc79fc365.zip cpython-dcc028d92428bd57358a5028ada2a53fc79fc365.tar.gz cpython-dcc028d92428bd57358a5028ada2a53fc79fc365.tar.bz2 |
gh-105376: Remove logging.warn() and LoggerAdapter.warn() (#106553)
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index fe2039a..2a011b6 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -37,7 +37,7 @@ __all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', 'captureWarnings', 'critical', 'debug', 'disable', 'error', 'exception', 'fatal', 'getLevelName', 'getLogger', 'getLoggerClass', 'info', 'log', 'makeLogRecord', 'setLoggerClass', 'shutdown', - 'warn', 'warning', 'getLogRecordFactory', 'setLogRecordFactory', + 'warning', 'getLogRecordFactory', 'setLogRecordFactory', 'lastResort', 'raiseExceptions', 'getLevelNamesMapping', 'getHandlerByName', 'getHandlerNames'] @@ -1928,11 +1928,6 @@ class LoggerAdapter(object): """ self.log(WARNING, msg, *args, **kwargs) - def warn(self, msg, *args, **kwargs): - warnings.warn("The 'warn' method is deprecated, " - "use 'warning' instead", DeprecationWarning, 2) - self.warning(msg, *args, **kwargs) - def error(self, msg, *args, **kwargs): """ Delegate an error call to the underlying logger. @@ -2206,11 +2201,6 @@ def warning(msg, *args, **kwargs): basicConfig() root.warning(msg, *args, **kwargs) -def warn(msg, *args, **kwargs): - warnings.warn("The 'warn' function is deprecated, " - "use 'warning' instead", DeprecationWarning, 2) - warning(msg, *args, **kwargs) - def info(msg, *args, **kwargs): """ Log a message with severity 'INFO' on the root logger. If the logger has |