summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-04-28 10:04:53 +0200
committerGitHub <noreply@github.com>2023-04-28 10:04:53 +0200
commit1c9532bb8857551d163517bf0028441c7cd544c8 (patch)
tree328461db08a78ff0db667e7135dd9d8e2f2e1ff5 /numpy/testing/_private/utils.py
parent7fe3ffadbbe9114cbc561c27d7a6d285f84fc129 (diff)
parent080cf82ebc5858ec47eff0d49bdf48b74f955274 (diff)
downloadnumpy-1c9532bb8857551d163517bf0028441c7cd544c8.tar.gz
Merge pull request #22493 from mwtoews/maint-open
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 b9ea703d0..f2fd9d2ae 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -190,7 +190,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:
@@ -217,7 +217,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:
@@ -2520,7 +2520,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