]> granicus.if.org Git - python/commitdiff
fixed the export symbols for the win32 linker
authorTarek Ziade <tarek@ziade.org>
Sat, 21 May 2011 19:48:04 +0000 (21:48 +0200)
committerTarek Ziade <tarek@ziade.org>
Sat, 21 May 2011 19:48:04 +0000 (21:48 +0200)
Lib/packaging/command/build_ext.py
Lib/packaging/tests/test_command_build_ext.py

index 9b710411ca59c589f56b8858d2b44cc510db22a9..7803d01821b406f47a0d6fee1e421ffee0e6d334 100644 (file)
@@ -589,7 +589,7 @@ class build_ext(Command):
         provided, "init" + module_name.  Only relevant on Windows, where
         the .pyd file (DLL) must export the module "init" 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 2d798422b2d6089ba752b246ce2403ada94e959c..9dfa26b1e161afdd6e30988d6120f7f8eac337be 100644 (file)
@@ -239,7 +239,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]})