summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-07-04 21:43:24 (GMT)
committerBrett Cannon <brett@python.org>2013-07-04 21:43:24 (GMT)
commitcd171c8e92c10d327151400fd8f16b11a4964615 (patch)
treedb734100511572201a54a6b7ce1803bcea4c94da /Lib/platform.py
parentfff59155d40ede93594eb77f320e0bde658cce28 (diff)
downloadcpython-cd171c8e92c10d327151400fd8f16b11a4964615.zip
cpython-cd171c8e92c10d327151400fd8f16b11a4964615.tar.gz
cpython-cd171c8e92c10d327151400fd8f16b11a4964615.tar.bz2
Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a)
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 5951efb..c54f768 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 ModuleNotFoundError:
+ except ImportError:
# 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 ModuleNotFoundError:
+ except ImportError:
# 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 ModuleNotFoundError:
+ except ImportError:
return None
# Get the infos
sysv, sysa = _mac_ver_lookup(('sysv','sysa'))
@@ -697,7 +697,7 @@ def _mac_ver_xml():
try:
import plistlib
- except ModuleNotFoundError:
+ except ImportError:
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 ModuleNotFoundError:
+ except ImportError:
return release,vendor,vminfo,osinfo
vendor = _java_getprop('java.vendor', vendor)
@@ -874,7 +874,7 @@ def _node(default=''):
"""
try:
import socket
- except ModuleNotFoundError:
+ except ImportError:
# No sockets...
return default
try:
@@ -1138,7 +1138,7 @@ def uname():
# Get processor information
try:
import vms_lib
- except ModuleNotFoundError:
+ except ImportError:
pass
else:
csid, cpu_number = vms_lib.getsyi('SYI$_CPU',0)