From eec5e489778764bb80bcb900ae88e8abc7db1ff3 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sun, 19 May 2013 22:15:09 +0200 Subject: BLD: fix setuptools-specific easy_install issue. Closes gh-3160. An error is raised by setuptools when trying to write to /dev/null. Was fixed in distribute, but not in setuptools. No multi-arch support with plain setuptools should be OK, because multi-arch is Ubuntu specific (at least for now), and they ship distribute. --- numpy/distutils/system_info.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 125a1f175..13f52801e 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -223,8 +223,10 @@ else: tmp = open(os.devnull, 'w') p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE, stderr=tmp) - except OSError: - pass # gcc is not installed + except (OSError, DistutilsError): + # OSError if gcc is not installed, or SandboxViolation (DistutilsError + # subclass) if an old setuptools bug is triggered (see gh-3160). + pass else: triplet = str(p.communicate()[0].decode().strip()) if p.returncode == 0: -- cgit v1.2.1