commit b3b180857bcca0f74100686aa0f2e80b51dca78e Author: Gregory M. Turner Date: Mon Dec 22 13:39:54 2014 -0800 distutils.command.build_ext: accomodate Extension duck-types Signed-off-by: Gregory M. Turner diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 54ce134..8cee284 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -366,7 +366,8 @@ class build_ext(Command): "'ext_modules' option must be a list of Extension instances") for i, ext in enumerate(extensions): - if isinstance(ext, Extension): + # Is it an Extension instance or duck-type thereof? + if hasattr(ext, 'define_macros'): continue # OK! (assume type-checking done # by Extension constructor)