mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
fixed the export symbols for the win32 linker
This commit is contained in:
parent
5edc31ecaf
commit
76ad4f0ec9
2 changed files with 2 additions and 2 deletions
|
@ -589,7 +589,7 @@ class build_ext(Command):
|
||||||
provided, "init" + module_name. Only relevant on Windows, where
|
provided, "init" + module_name. Only relevant on Windows, where
|
||||||
the .pyd file (DLL) must export the module "init" function.
|
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:
|
if initfunc_name not in ext.export_symbols:
|
||||||
ext.export_symbols.append(initfunc_name)
|
ext.export_symbols.append(initfunc_name)
|
||||||
return ext.export_symbols
|
return ext.export_symbols
|
||||||
|
|
|
@ -239,7 +239,7 @@ class BuildExtTestCase(support.TempdirManager,
|
||||||
def test_get_outputs(self):
|
def test_get_outputs(self):
|
||||||
tmp_dir = self.mkdtemp()
|
tmp_dir = self.mkdtemp()
|
||||||
c_file = os.path.join(tmp_dir, 'foo.c')
|
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)
|
ext = Extension('foo', [c_file], optional=False)
|
||||||
dist = Distribution({'name': 'xx',
|
dist = Distribution({'name': 'xx',
|
||||||
'ext_modules': [ext]})
|
'ext_modules': [ext]})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue