summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-14 00:57:26 (GMT)
committerBrett Cannon <brett@python.org>2013-06-14 00:57:26 (GMT)
commit0a140668faf18bf7f8d2ea15e57da5e2a0625292 (patch)
tree97522129bc600a6eff09899ae7a177b5f3e980b3 /Lib/logging
parent9702a17a6ab90d026449dd20631a6f380d007b3d (diff)
downloadcpython-0a140668faf18bf7f8d2ea15e57da5e2a0625292.zip
cpython-0a140668faf18bf7f8d2ea15e57da5e2a0625292.tar.gz
cpython-0a140668faf18bf7f8d2ea15e57da5e2a0625292.tar.bz2
Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py2
-rw-r--r--Lib/logging/config.py2
-rw-r--r--Lib/logging/handlers.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 4629860..b4552bf 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 b882a62..4354dd1 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 f1ddbb5..0a11b82 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