summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2022-10-28 22:37:29 +1300
committerMike Taves <mwtoews@gmail.com>2022-10-29 14:08:54 +1300
commit080cf82ebc5858ec47eff0d49bdf48b74f955274 (patch)
treec843b284d9994186ab988c7c535a895433ae9905 /numpy/testing/_private/utils.py
parenta8ebbd5fdb9df3d1d2885b24e783757d747dec8e (diff)
downloadnumpy-080cf82ebc5858ec47eff0d49bdf48b74f955274.tar.gz
MAINT: remove redundant open() modes and io.open() alias
Diffstat (limited to 'numpy/testing/_private/utils.py')
-rw-r--r--numpy/testing/_private/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index 26b2aac4d..53930b78c 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -197,7 +197,7 @@ elif sys.platform[:5] == 'linux':
"""
try:
- with open(_proc_pid_stat, 'r') as f:
+ with open(_proc_pid_stat) as f:
l = f.readline().split(' ')
return int(l[22])
except Exception:
@@ -224,7 +224,7 @@ if sys.platform[:5] == 'linux':
if not _load_time:
_load_time.append(time.time())
try:
- with open(_proc_pid_stat, 'r') as f:
+ with open(_proc_pid_stat) as f:
l = f.readline().split(' ')
return int(l[13])
except Exception:
@@ -2545,7 +2545,7 @@ def _get_mem_available():
if sys.platform.startswith('linux'):
info = {}
- with open('/proc/meminfo', 'r') as f:
+ with open('/proc/meminfo') as f:
for line in f:
p = line.split()
info[p[0].strip(':').lower()] = int(p[1]) * 1024