]> granicus.if.org Git - python/commitdiff
get_export_symbols() changed, adds now module init function if not given
authorGreg Ward <gward@python.net>
Sun, 13 Aug 2000 00:42:35 +0000 (00:42 +0000)
committerGreg Ward <gward@python.net>
Sun, 13 Aug 2000 00:42:35 +0000 (00:42 +0000)
by the user.

Lib/distutils/command/build_ext.py

index 1ffe3234d441868d90249075c4e0a7262cb7aa46..aca6dac407c0b14f1c1e828d7253120843336af5 100644 (file)
@@ -549,14 +549,10 @@ class build_ext (Command):
         the .pyd file (DLL) must export the module "init" function.
         """
 
-        # XXX what if 'export_symbols' defined but it doesn't contain
-        # "init" + module_name?  Should we add it? warn? or just carry
-        # on doing nothing?
-
-        if ext.export_symbols is None:
-            return ["init" + string.split(ext.name,'.')[-1]]
-        else:
-            return ext.export_symbols
+        initfunc_name = "init" + string.split(ext.name,'.')[-1]
+        if initfunc_name not in ext.export_symbols:
+            ext.export_symbols.append(initfunc_name)
+        return ext.export_symbols
 
     def get_libraries (self, ext):
         """Return the list of libraries to link against when building a