mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 17:54:32 +03:00
Merge pull request #1879 from radarhere/subprocess
Replaced os.system with subprocess.call
This commit is contained in:
commit
85386c5ac7
8
setup.py
8
setup.py
|
@ -13,6 +13,7 @@ import platform as plat
|
||||||
import re
|
import re
|
||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from distutils.command.build_ext import build_ext
|
from distutils.command.build_ext import build_ext
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
|
@ -245,7 +246,6 @@ class pil_build_ext(build_ext):
|
||||||
_add_directory(include_dirs, "/opt/local/include")
|
_add_directory(include_dirs, "/opt/local/include")
|
||||||
|
|
||||||
# if Homebrew is installed, use its lib and include directories
|
# if Homebrew is installed, use its lib and include directories
|
||||||
import subprocess
|
|
||||||
try:
|
try:
|
||||||
prefix = subprocess.check_output(['brew', '--prefix']).strip(
|
prefix = subprocess.check_output(['brew', '--prefix']).strip(
|
||||||
).decode('latin1')
|
).decode('latin1')
|
||||||
|
@ -772,9 +772,9 @@ class pil_build_ext(build_ext):
|
||||||
tmpfile = os.path.join(self.build_temp, 'multiarch')
|
tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
if not os.path.exists(self.build_temp):
|
if not os.path.exists(self.build_temp):
|
||||||
os.makedirs(self.build_temp)
|
os.makedirs(self.build_temp)
|
||||||
ret = os.system(
|
with open(tmpfile, 'wb') as fp:
|
||||||
'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
ret = subprocess.call([
|
||||||
tmpfile)
|
'dpkg-architecture', '-qDEB_HOST_MULTIARCH'], stdout=fp)
|
||||||
try:
|
try:
|
||||||
if ret >> 8 == 0:
|
if ret >> 8 == 0:
|
||||||
fp = open(tmpfile, 'r')
|
fp = open(tmpfile, 'r')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user