diff options
author | Brett Cannon <brett@python.org> | 2013-06-13 20:57:26 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-13 20:57:26 -0400 |
commit | dfd87ef593fcae1f252092348479d456375552fc (patch) | |
tree | 9b2837665fa5a4027ac58d40eb6675d4249a4a4d /Lib/logging | |
parent | 87407f5d891b20af9b7ef9ae0cb728210784581f (diff) | |
download | cpython-dfd87ef593fcae1f252092348479d456375552fc.tar.gz |
Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 2 | ||||
-rw-r--r-- | Lib/logging/config.py | 2 | ||||
-rw-r--r-- | Lib/logging/handlers.py | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 46298605c4..b4552bfecb 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -37,7 +37,7 @@ __all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', try: import threading -except ImportError: #pragma: no cover +except ModuleNotFoundError: #pragma: no cover threading = None __author__ = "Vinay Sajip <vinay_sajip@red-dove.com>" diff --git a/Lib/logging/config.py b/Lib/logging/config.py index b882a62ab3..4354dd129d 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -30,7 +30,7 @@ import io try: import _thread as thread import threading -except ImportError: #pragma: no cover +except ModuleNotFoundError: #pragma: no cover thread = None from socketserver import ThreadingTCPServer, StreamRequestHandler diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index f1ddbb5eda..0a11b8232b 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -29,7 +29,7 @@ from stat import ST_DEV, ST_INO, ST_MTIME import queue try: import threading -except ImportError: #pragma: no cover +except ModuleNotFoundError: #pragma: no cover threading = None # @@ -995,7 +995,7 @@ class NTEventLogHandler(logging.Handler): logging.ERROR : win32evtlog.EVENTLOG_ERROR_TYPE, logging.CRITICAL: win32evtlog.EVENTLOG_ERROR_TYPE, } - except ImportError: + except ModuleNotFoundError: print("The Python Win32 extensions for NT (service, event "\ "logging) appear not to be available.") self._welu = None |