Skip to content

Commit 8aece0e

Browse files
committed
setup.py: search for new TA-Lib library name as of 0.6.1
1 parent f4e3767 commit 8aece0e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

setup.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
from distutils.extension import Extension
1919
requires = {"requires": ["numpy"]}
2020

21-
lib_talib_name = 'ta_lib' # the underlying C library's name
22-
2321
platform_supported = False
2422

2523
if any(s in sys.platform for s in ['darwin', 'linux', 'bsd', 'sunos']):
@@ -64,11 +62,23 @@
6462
except ImportError:
6563
has_cython = False
6664

65+
lib_talib_names = ['ta-lib', 'ta_lib'] # the underlying C library's name
66+
lib_talib_name = 'ta-lib' # the name as of TA-Lib 0.6.1
67+
6768
for path in library_dirs:
6869
try:
6970
files = os.listdir(path)
70-
if any(lib_talib_name in f for f in files):
71+
for f in files:
72+
for name in lib_talib_names:
73+
if name in f:
74+
lib_talib_name = name
75+
break
76+
else:
77+
continue
7178
break
79+
else:
80+
continue
81+
break
7282
except OSError:
7383
pass
7484
else:

0 commit comments

Comments
 (0)