summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
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/platform.py
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/platform.py')
-rwxr-xr-xLib/platform.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index c54f768..5951efb 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -460,7 +460,7 @@ def _win32_getvalue(key,name,default=''):
try:
# Use win32api if available
from win32api import RegQueryValueEx
- except ImportError:
+ except ModuleNotFoundError:
# On Python 2.0 and later, emulate using winreg
import winreg
RegQueryValueEx = winreg.QueryValueEx
@@ -503,7 +503,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
RegCloseKey, GetVersionEx
from win32con import HKEY_LOCAL_MACHINE, VER_PLATFORM_WIN32_NT, \
VER_PLATFORM_WIN32_WINDOWS, VER_NT_WORKSTATION
- except ImportError:
+ except ModuleNotFoundError:
# Emulate the win32api module using Python APIs
try:
sys.getwindowsversion
@@ -661,7 +661,7 @@ def _mac_ver_gestalt():
# Check whether the version info module is available
try:
import _gestalt
- except ImportError:
+ except ModuleNotFoundError:
return None
# Get the infos
sysv, sysa = _mac_ver_lookup(('sysv','sysa'))
@@ -697,7 +697,7 @@ def _mac_ver_xml():
try:
import plistlib
- except ImportError:
+ except ModuleNotFoundError:
return None
pl = plistlib.readPlist(fn)
@@ -762,7 +762,7 @@ def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')):
# Import the needed APIs
try:
import java.lang
- except ImportError:
+ except ModuleNotFoundError:
return release,vendor,vminfo,osinfo
vendor = _java_getprop('java.vendor', vendor)
@@ -874,7 +874,7 @@ def _node(default=''):
"""
try:
import socket
- except ImportError:
+ except ModuleNotFoundError:
# No sockets...
return default
try:
@@ -1138,7 +1138,7 @@ def uname():
# Get processor information
try:
import vms_lib
- except ImportError:
+ except ModuleNotFoundError:
pass
else:
csid, cpu_number = vms_lib.getsyi('SYI$_CPU',0)