setup: has_ext_modules always returns false when pure is specified
authorSimon Heimberg <simohe@besonet.ch>
Tue, 01 Nov 2011 20:13:52 +0100
changeset 15459 434c48e981b8
parent 15458 c3a6ec304055
child 15460 f9f0731dbc56
setup: has_ext_modules always returns false when pure is specified When pure is specified ext_modules is emptied in hgbuildpy.finalize_options. Before this happens has_ext_modules returned True.
setup.py
--- a/setup.py	Sat Jul 23 05:57:39 2011 +0200
+++ b/setup.py	Tue Nov 01 20:13:52 2011 +0100
@@ -229,6 +229,11 @@
                         "code instead of C extensions"),
                      ]
 
+    def has_ext_modules(self):
+        # self.ext_modules is emptied in hgbuildpy.finalize_options which is
+        # too late for some cases
+        return not self.pure and Distribution.has_ext_modules(self)
+
 class hgbuildext(build_ext):
 
     def build_extension(self, ext):