]> granicus.if.org Git - python/commitdiff
build_ext: correctly parse the link_objects user option (closes #1703178)
authorBenjamin Peterson <benjamin@python.org>
Thu, 29 Sep 2016 06:13:58 +0000 (23:13 -0700)
committerBenjamin Peterson <benjamin@python.org>
Thu, 29 Sep 2016 06:13:58 +0000 (23:13 -0700)
Patch by Valerie Lambert.

Lib/distutils/command/build_ext.py
Lib/distutils/tests/test_build_ext.py
Misc/NEWS

index 3a49454a4a437abdce3196787e66034a008735f4..2c68be39cdf60fec3eeb735c8f0f4c7001c6243a 100644 (file)
@@ -161,6 +161,7 @@ class build_ext (Command):
             self.include_dirs.append(plat_py_include)
 
         self.ensure_string_list('libraries')
+        self.ensure_string_list('link_objects')
 
         # Life is easier if we're not forever checking for None, so
         # simplify these options to empty lists if unset
index 34bc71e06d8d60bf9831b6d01b373dfe66b21019..a4494dba4cd6e0a72c3e7cfa9ce82b0599b4db45 100644 (file)
@@ -168,6 +168,13 @@ class BuildExtTestCase(support.TempdirManager,
         cmd.finalize_options()
         self.assertEqual(cmd.rpath, ['one', 'two'])
 
+        # make sure cmd.link_objects is turned into a list
+        # if it's a string
+        cmd = build_ext(dist)
+        cmd.link_objects = 'one two,three'
+        cmd.finalize_options()
+        self.assertEqual(cmd.link_objects, ['one', 'two', 'three'])
+
         # XXX more tests to perform for win32
 
         # make sure define is turned into 2-tuples
index a5afa84f79bed288c413e696724c4b28d70b3d38..4327afd063a30368815139e03f7af90c0d337d33 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #1703178: Fix the ability to pass the --link-objects option to the
+  distutils build_ext command.
+
 - Issue #28253: Fixed calendar functions for extreme months: 0001-01
   and 9999-12.