summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-02-04 15:24:30 (GMT)
committerGitHub <noreply@github.com>2020-02-04 15:24:30 (GMT)
commit9538bc9185e934bee2bd5ae2cda2b2e92a61906d (patch)
tree17b2427bb0f49b48e30d9d18d31736d14a9405a3 /Lib/distutils/tests
parent850a4bd839ca11b59439e21dda2a3ebe917a9a16 (diff)
downloadcpython-9538bc9185e934bee2bd5ae2cda2b2e92a61906d.zip
cpython-9538bc9185e934bee2bd5ae2cda2b2e92a61906d.tar.gz
cpython-9538bc9185e934bee2bd5ae2cda2b2e92a61906d.tar.bz2
bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit_*" symbol names in distutils (GH-18150)
Make it export the correct init symbol also on Windows. https://bugs.python.org/issue39432
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r--Lib/distutils/tests/test_build_ext.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 52d36b2..7e3eafa 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -304,6 +304,19 @@ class BuildExtTestCase(TempdirManager,
cmd.ensure_finalized()
self.assertEqual(cmd.get_source_files(), ['xxx'])
+ def test_unicode_module_names(self):
+ modules = [
+ Extension('foo', ['aaa'], optional=False),
+ Extension('föö', ['uuu'], optional=False),
+ ]
+ dist = Distribution({'name': 'xx', 'ext_modules': modules})
+ cmd = self.build_ext(dist)
+ cmd.ensure_finalized()
+ self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo\..*')
+ self.assertRegex(cmd.get_ext_filename(modules[1].name), r'föö\..*')
+ self.assertEqual(cmd.get_export_symbols(modules[0]), ['PyInit_foo'])
+ self.assertEqual(cmd.get_export_symbols(modules[1]), ['PyInitU_f_gkaa'])
+
def test_compiler_option(self):
# cmd.compiler is an option and
# should not be overridden by a compiler instance