Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c99071

Browse files
committed
- fix the OS X build failure, only try to remove the temporary file if it exists
1 parent 7f7902c commit 4c99071

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def detect_modules(self):
657657
ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
658658
else:
659659
ret = 256
660-
if ret == 0:
660+
if ret >> 8 == 0:
661661
with open(tmpfile) as fp:
662662
for ln in fp:
663663
if 'curses' in ln:
@@ -669,7 +669,8 @@ def detect_modules(self):
669669
if 'tinfo' in ln:
670670
readline_termcap_library = 'tinfo'
671671
break
672-
os.unlink(tmpfile)
672+
if os.path.exists(tmpfile):
673+
os.unlink(tmpfile)
673674
# Issue 7384: If readline is already linked against curses,
674675
# use the same library for the readline and curses modules.
675676
if 'curses' in readline_termcap_library:

0 commit comments

Comments
 (0)