Skip to content

Commit 90f9339

Browse files
committed
ie options: Fix Python 3 exec issue with list comprehensions
In Python 3 list comprehensions were changed to create their own local scope. If we pass in different objects for the `globals` and `locals` to the `exec` function this leads to `NameErrors` in the list comprehension. SCons passes in two different dictionaries when calling `exec` on the the options files. To circumvent this issue, we rewrite the list comprehension to a loop. For reference: https://stackoverflow.com/questions/45132645/list-comprehension-in-exec-with-empty-locals-nameerror
1 parent c6c8336 commit 90f9339

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

config/ie/options

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ LIBPATH = ":".join( [
207207
os.path.join( "/software", "apps", compiler, compilerVersion, platform, "lib64" ),
208208
] )
209209
if targetApp :
210-
libPaths = [ os.path.join( targetAppReg["location"], x ) for x in targetAppReg.get( "libPaths", [] ) ]
210+
libPaths = []
211+
for libPath in targetAppReg.get( "libPaths", [] ):
212+
libPaths.append( os.path.join( targetAppReg["location"], libPath ) )
211213
libPaths.append( LIBPATH )
212214
LIBPATH = ":".join( libPaths )
213215

0 commit comments

Comments
 (0)