--- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -447,7 +447,8 @@ def build_extension(self, ext): sources = ext.sources - if sources is None or type(sources) not in (ListType, TupleType): + if sources is None or type(sources) not in (ListType, TupleType) or \ + not sources: raise DistutilsSetupError, \ ("in 'ext_modules' option (extension '%s'), " + "'sources' must be present and must be " +