Issue #16706: get rid of os.error
diff --git a/Lib/platform.py b/Lib/platform.py
index db08eab..5629691 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -316,7 +316,7 @@
"""
try:
etc = os.listdir('/etc')
- except os.error:
+ except OSError:
# Probably not a Unix system
return distname,version,id
etc.sort()
@@ -424,10 +424,10 @@
pipe = popen(cmd)
info = pipe.read()
if pipe.close():
- raise os.error('command failed')
+ raise OSError('command failed')
# XXX How can I suppress shell errors from being written
# to stderr ?
- except os.error as why:
+ except OSError as why:
#print 'Command %s failed: %s' % (cmd,why)
continue
except IOError as why:
@@ -906,7 +906,7 @@
return default
try:
f = os.popen('uname %s 2> %s' % (option, DEV_NULL))
- except (AttributeError,os.error):
+ except (AttributeError, OSError):
return default
output = f.read().strip()
rc = f.close()
@@ -932,7 +932,7 @@
proc = subprocess.Popen(['file', target],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- except (AttributeError,os.error):
+ except (AttributeError, OSError):
return default
output = proc.communicate()[0].decode('latin-1')
rc = proc.wait()