44import sys
55import unittest .mock as mock
66from distutils import sysconfig
7+ from distutils .compat import consolidate_linker_args
78from distutils .errors import DistutilsPlatformError
89from distutils .unixccompiler import UnixCCompiler
910from distutils .util import _clear_cached_macosx_ver
@@ -149,10 +150,10 @@ def gcv(v):
149150 return 'yes'
150151
151152 sysconfig .get_config_var = gcv
152- assert self .cc .rpath_foo () == [
153+ assert self .cc .rpath_foo () == consolidate_linker_args ( [
153154 '-Wl,--enable-new-dtags' ,
154155 '-Wl,-rpath,/foo' ,
155- ]
156+ ])
156157
157158 def gcv (v ):
158159 if v == 'CC' :
@@ -161,10 +162,10 @@ def gcv(v):
161162 return 'yes'
162163
163164 sysconfig .get_config_var = gcv
164- assert self .cc .rpath_foo () == [
165+ assert self .cc .rpath_foo () == consolidate_linker_args ( [
165166 '-Wl,--enable-new-dtags' ,
166167 '-Wl,-rpath,/foo' ,
167- ]
168+ ])
168169
169170 # GCC non-GNULD
170171 sys .platform = 'bar'
@@ -189,10 +190,10 @@ def gcv(v):
189190 return 'yes'
190191
191192 sysconfig .get_config_var = gcv
192- assert self .cc .rpath_foo () == [
193+ assert self .cc .rpath_foo () == consolidate_linker_args ( [
193194 '-Wl,--enable-new-dtags' ,
194195 '-Wl,-rpath,/foo' ,
195- ]
196+ ])
196197
197198 # non-GCC GNULD
198199 sys .platform = 'bar'
@@ -204,10 +205,10 @@ def gcv(v):
204205 return 'yes'
205206
206207 sysconfig .get_config_var = gcv
207- assert self .cc .rpath_foo () == [
208+ assert self .cc .rpath_foo () == consolidate_linker_args ( [
208209 '-Wl,--enable-new-dtags' ,
209210 '-Wl,-rpath,/foo' ,
210- ]
211+ ])
211212
212213 # non-GCC non-GNULD
213214 sys .platform = 'bar'
0 commit comments