Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index f28036a..457cef6 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -846,7 +846,7 @@
     if options.setuid:
         try:
             import pwd
-        except ImportError:
+        except ModuleNotFoundError:
             print('Cannot import module "pwd"; try running with -n option.', file=sys.stderr)
             sys.exit(1)
         nobody = pwd.getpwnam('nobody')[2]