summaryrefslogtreecommitdiff
path: root/testsuite/driver/cpu_features.py
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2023-01-11 21:09:34 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2023-01-11 21:09:34 +0100
commitb1c81f429ae0720b245a71065b3752a7ec181cf8 (patch)
tree395a43d754ab83b79b9cc33ad4b15f2f77bd0f41 /testsuite/driver/cpu_features.py
parent964284fcab6e27fe2fa5c279ea008551cbc15dbb (diff)
downloadhaskell-b1c81f429ae0720b245a71065b3752a7ec181cf8.tar.gz
Use -Wdefault when running Python testdriver (#22727)wip/python-files
Diffstat (limited to 'testsuite/driver/cpu_features.py')
-rw-r--r--testsuite/driver/cpu_features.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py
index 6e32d3b445..43500130db 100644
--- a/testsuite/driver/cpu_features.py
+++ b/testsuite/driver/cpu_features.py
@@ -17,7 +17,8 @@ cpu_feature_cache = None
def get_cpu_features():
if config.os in ['mingw32', 'linux'] and os.path.exists('/proc/cpuinfo'):
- f = open('/proc/cpuinfo').read()
+ with open('/proc/cpuinfo') as x:
+ f = x.read()
flags = re.search(r'flags\s*:\s*.*$', f, re.M)
if flags is None:
print('get_cpu_features: failed to find cpu features')