Skip to content

Commit

Permalink
BUG: distutils/system_info.py fix missing subprocess import (numpy#13523
Browse files Browse the repository at this point in the history
)

* distutils/system_info.py fix missing subprocess import

* Update system_info.py
  • Loading branch information
denniszollo authored and charris committed May 19, 2019
1 parent 433d8b2 commit bdd75df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numpy/distutils/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
import re
import copy
import warnings
import subprocess

from glob import glob
from functools import reduce
if sys.version_info[0] < 3:
Expand Down Expand Up @@ -298,13 +300,12 @@ def add_system_root(library_root):
default_x11_include_dirs.extend(['/usr/lib/X11/include',
'/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.
tmp = open(os.devnull, 'w')
p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
p = subprocess.Popen(["gcc", "-print-multiarch"], stdout=subprocess.PIPE,
stderr=tmp)
except (OSError, DistutilsError):
# OSError if gcc is not installed, or SandboxViolation (DistutilsError
Expand Down

0 comments on commit bdd75df

Please sign in to comment.