diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-09-02 09:11:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 09:11:59 -0500 |
commit | 9164f23c19c049e28d4d4825a53bbb01aedabcfc (patch) | |
tree | f017b7eb7565690a755263df12c835d61e89a8a4 /numpy/distutils/system_info.py | |
parent | 8eedd3e911b7e3f5f35961871ddb8ee1559d4225 (diff) | |
parent | 514d13679a55a82a96689679002c4ddc514641ce (diff) | |
download | numpy-9164f23c19c049e28d4d4825a53bbb01aedabcfc.tar.gz |
Merge pull request #7099 from seberg/suppressed_warnings
Suppressed warnings
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r-- | numpy/distutils/system_info.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 014223b74..c3a62464b 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -242,7 +242,7 @@ else: # tests are run in debug mode Python 3. tmp = open(os.devnull, 'w') p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE, - stderr=tmp) + stderr=tmp) except (OSError, DistutilsError): # OSError if gcc is not installed, or SandboxViolation (DistutilsError # subclass) if an old setuptools bug is triggered (see gh-3160). @@ -971,10 +971,11 @@ class mkl_info(system_info): paths = os.environ.get('LD_LIBRARY_PATH', '').split(os.pathsep) ld_so_conf = '/etc/ld.so.conf' if os.path.isfile(ld_so_conf): - for d in open(ld_so_conf, 'r'): - d = d.strip() - if d: - paths.append(d) + with open(ld_so_conf, 'r') as f: + for d in f: + d = d.strip() + if d: + paths.append(d) intel_mkl_dirs = [] for path in paths: path_atoms = path.split(os.sep) |