]> granicus.if.org Git - python/commitdiff
fixed #6459: distutils.command.build_ext.get_export_symbols now uses 'PyInit'
authorTarek Ziadé <ziade.tarek@gmail.com>
Sat, 11 Jul 2009 10:55:27 +0000 (10:55 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Sat, 11 Jul 2009 10:55:27 +0000 (10:55 +0000)
Lib/distutils/command/build_ext.py
Lib/distutils/tests/test_build_ext.py
Misc/NEWS

index 0c79476bac1fa59f26b55da673e31d36cc18220c..17cb26b52633d6a5c4112dc0437b591c3d6fa9a9 100644 (file)
@@ -732,10 +732,10 @@ class build_ext(Command):
     def get_export_symbols(self, ext):
         """Return the list of symbols that a shared extension has to
         export.  This either uses 'ext.export_symbols' or, if it's not
-        provided, "init" + module_name.  Only relevant on Windows, where
-        the .pyd file (DLL) must export the module "init" function.
+        provided, "PyInit_" + module_name.  Only relevant on Windows, where
+        the .pyd file (DLL) must export the module "PyInit_" function.
         """
-        initfunc_name = "init" + ext.name.split('.')[-1]
+        initfunc_name = "PyInit_" + ext.name.split('.')[-1]
         if initfunc_name not in ext.export_symbols:
             ext.export_symbols.append(initfunc_name)
         return ext.export_symbols
index 4c09dd80a38910e4fd17ec5150aac1060840cf16..7886c792bd3dca1c154761899434e35af9bd9883 100644 (file)
@@ -299,7 +299,7 @@ class BuildExtTestCase(support.TempdirManager,
     def test_get_outputs(self):
         tmp_dir = self.mkdtemp()
         c_file = os.path.join(tmp_dir, 'foo.c')
-        self.write_file(c_file, 'void initfoo(void) {};\n')
+        self.write_file(c_file, 'void PyInit_foo(void) {};\n')
         ext = Extension('foo', [c_file], optional=False)
         dist = Distribution({'name': 'xx',
                              'ext_modules': [ext]})
index 9742e3721412328dac2643c6d722f07b36150c7e..c8eb5d23fb08d77910aedd74fd5d61e7f2ac7344 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -350,6 +350,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the 
+  "PyInit" prefix, rather than "init". 
+
 - Issue #6455: Fixed test_build_ext under win32. 
 
 - Issue #6377: Enabled the compiler option, and deprecate its usage as an