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

Skip to content

Commit 652cc7c

Browse files
committed
Fix callable in build_src command.
1 parent d011d92 commit 652cc7c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

numpy/distutils/command/build_src.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ def build_data_files_sources(self):
186186
build_dir = self.get_package_dir('.'.join(d.split(os.sep)))
187187
else:
188188
build_dir = os.path.join(self.build_src,d)
189-
funcs = filter(callable,files)
190-
files = filter(lambda f:not callable(f), files)
189+
funcs = filter(lambda f:hasattr(f, '__call__'), files)
190+
files = filter(lambda f:not hasattr(f, '__call__'), files)
191191
for f in funcs:
192192
if f.func_code.co_argcount==1:
193193
s = f(build_dir)
@@ -274,7 +274,7 @@ def build_py_modules_sources(self):
274274
else:
275275
build_dir = os.path.join(self.build_src,
276276
os.path.join(*package.split('.')))
277-
if callable(source):
277+
if hasattr(source, '__call__'):
278278
target = os.path.join(build_dir, module_base + '.py')
279279
source = source(target)
280280
if source is None:

0 commit comments

Comments
 (0)