summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@googlemail.com>2013-09-28 08:47:32 -0700
committerJulian Taylor <juliantaylor108@googlemail.com>2013-09-28 08:47:32 -0700
commit33cd94b5ee56829d81bd43f3b34d113b07184c86 (patch)
treee792e5aa65da8ed1323f351f9e1904e075cc5599
parenta1da1939891a2d7c2809896a9abc9e003e1e8d0b (diff)
parent8015369a4f1357e690199090d84fa8fde99ed6a3 (diff)
downloadnumpy-33cd94b5ee56829d81bd43f3b34d113b07184c86.tar.gz
Merge pull request #3821 from NextThought/master
Installation fails with NameError if SandboxViolation is raised
-rw-r--r--numpy/distutils/system_info.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 3c281465d..800415e46 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -217,6 +217,7 @@ else:
'/usr/include/X11'])
import subprocess as sp
+ tmp = None
try:
# Explicitly open/close file to avoid ResourceWarning when
# tests are run in debug mode Python 3.
@@ -234,7 +235,8 @@ else:
default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
finally:
- tmp.close()
+ if tmp is not None:
+ tmp.close()
if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))