]> 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 f03a4e31d8d7e2216597239e8fcffc20b5c44638..7c278ef0afe6d64d1df58ad47d2c602f8beba790 100644 (file)
@@ -166,6 +166,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 4e397ea4c94dc7d9532ed93b87a6454a989fb393..f3df564e37347d6f20f0ba9bb55deed89b9916ea 100644 (file)
@@ -195,6 +195,13 @@ class BuildExtTestCase(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 3b41f49a456d9f8221d554174d7cec472159fa77..fbf310048192437e828705187086bacc868de6b0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -83,6 +83,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.