diff options
author | Mike Taves <mwtoews@gmail.com> | 2021-09-02 21:32:21 +1200 |
---|---|---|
committer | Mike Taves <mwtoews@gmail.com> | 2021-09-02 22:56:43 +1200 |
commit | 7ad8ea7b11e3544b133d8b397dd3bbe4833d3308 (patch) | |
tree | 8726a71692b20b079cec53e76f5c1fb33c806d7b /numpy/distutils/cpuinfo.py | |
parent | 9fca8f0c1a3f16f8f62ae574ec1a79b5b588214e (diff) | |
download | numpy-7ad8ea7b11e3544b133d8b397dd3bbe4833d3308.tar.gz |
MAINT: revise OSError aliases (IOError, EnvironmentError)
Diffstat (limited to 'numpy/distutils/cpuinfo.py')
-rw-r--r-- | numpy/distutils/cpuinfo.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/distutils/cpuinfo.py b/numpy/distutils/cpuinfo.py index 51ce3c129..776202109 100644 --- a/numpy/distutils/cpuinfo.py +++ b/numpy/distutils/cpuinfo.py @@ -27,7 +27,7 @@ from subprocess import getstatusoutput def getoutput(cmd, successful_status=(0,), stacklevel=1): try: status, output = getstatusoutput(cmd) - except EnvironmentError as e: + except OSError as e: warnings.warn(str(e), UserWarning, stacklevel=stacklevel) return False, "" if os.WIFEXITED(status) and os.WEXITSTATUS(status) in successful_status: @@ -109,7 +109,7 @@ class LinuxCPUInfo(CPUInfoBase): info[0]['uname_m'] = output.strip() try: fo = open('/proc/cpuinfo') - except EnvironmentError as e: + except OSError as e: warnings.warn(str(e), UserWarning, stacklevel=2) else: for line in fo: |