@@ -821,7 +821,7 @@ def Write(self, qualified_target, base_path, output_filename, spec, configs,
821821 gyp .xcode_emulation .MacPrefixHeader (
822822 self .xcode_settings , lambda p : Sourceify (self .Absolutify (p )),
823823 self .Pchify ))
824- sources = filter (Compilable , all_sources )
824+ sources = list ( filter (Compilable , all_sources ) )
825825 if sources :
826826 self .WriteLn (SHARED_HEADER_SUFFIX_RULES_COMMENT1 )
827827 extensions = set ([os .path .splitext (s )[1 ] for s in sources ])
@@ -950,7 +950,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
950950 '%s%s'
951951 % (name , cd_action , command ))
952952 self .WriteLn ()
953- outputs = map ( self .Absolutify , outputs )
953+ outputs = [ self .Absolutify ( output ) for output in outputs ]
954954 # The makefile rules are all relative to the top dir, but the gyp actions
955955 # are defined relative to their containing dir. This replaces the obj
956956 # variable for the action rule with an absolute version so that the output
@@ -974,7 +974,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
974974 outputs = [gyp .xcode_emulation .ExpandEnvVars (o , env ) for o in outputs ]
975975 inputs = [gyp .xcode_emulation .ExpandEnvVars (i , env ) for i in inputs ]
976976
977- self .WriteDoCmd (outputs , map ( Sourceify , map (self .Absolutify , inputs )) ,
977+ self .WriteDoCmd (outputs , [ Sourceify (self .Absolutify ( i )) for i in inputs ] ,
978978 part_of_all = part_of_all , command = name )
979979
980980 # Stuff the outputs in a variable so we can refer to them later.
@@ -1023,8 +1023,8 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
10231023 extra_sources += outputs
10241024 if int (rule .get ('process_outputs_as_mac_bundle_resources' , False )):
10251025 extra_mac_bundle_resources += outputs
1026- inputs = map ( Sourceify , map (self .Absolutify , [ rule_source ] +
1027- rule .get ('inputs' , [])))
1026+ inputs = [ Sourceify (self .Absolutify ( i )) for i
1027+ in [ rule_source ] + rule .get ('inputs' , [])]
10281028 actions = ['$(call do_cmd,%s_%d)' % (name , count )]
10291029
10301030 if name == 'resources_grit' :
@@ -1040,7 +1040,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
10401040 outputs = [gyp .xcode_emulation .ExpandEnvVars (o , env ) for o in outputs ]
10411041 inputs = [gyp .xcode_emulation .ExpandEnvVars (i , env ) for i in inputs ]
10421042
1043- outputs = map ( self .Absolutify , outputs )
1043+ outputs = [ self .Absolutify ( output ) for output in outputs ]
10441044 all_outputs += outputs
10451045 # Only write the 'obj' and 'builddir' rules for the "primary" output
10461046 # (:1); it's superfluous for the "extra outputs", and this avoids
@@ -1147,7 +1147,7 @@ def WriteCopies(self, copies, extra_outputs, part_of_all):
11471147 path = gyp .xcode_emulation .ExpandEnvVars (path , env )
11481148 self .WriteDoCmd ([output ], [path ], 'copy' , part_of_all )
11491149 outputs .append (output )
1150- self .WriteLn ('%s = %s' % (variable , ' ' .join (map ( QuoteSpaces , outputs ) )))
1150+ self .WriteLn ('%s = %s' % (variable , ' ' .join (QuoteSpaces ( o ) for o in outputs )))
11511151 extra_outputs .append ('$(%s)' % variable )
11521152 self .WriteLn ()
11531153
@@ -1158,7 +1158,7 @@ def WriteMacBundleResources(self, resources, bundle_deps):
11581158
11591159 for output , res in gyp .xcode_emulation .GetMacBundleResources (
11601160 generator_default_variables ['PRODUCT_DIR' ], self .xcode_settings ,
1161- map ( Sourceify , map (self .Absolutify , resources )) ):
1161+ [ Sourceify (self .Absolutify ( r )) for r in resources ] ):
11621162 _ , ext = os .path .splitext (output )
11631163 if ext != '.xcassets' :
11641164 # Make does not supports '.xcassets' emulation.
@@ -1238,11 +1238,11 @@ def WriteSources(self, configs, deps, sources,
12381238 self .WriteList (cflags_objcc , 'CFLAGS_OBJCC_%s' % configname )
12391239 includes = config .get ('include_dirs' )
12401240 if includes :
1241- includes = map ( Sourceify , map (self .Absolutify , includes ))
1241+ includes = [ Sourceify (self .Absolutify ( i )) for i in includes ]
12421242 self .WriteList (includes , 'INCS_%s' % configname , prefix = '-I' )
12431243
1244- compilable = filter (Compilable , sources )
1245- objs = map ( self .Objectify , map (self .Absolutify , map (Target , compilable )))
1244+ compilable = list ( filter (Compilable , sources ) )
1245+ objs = [ self .Objectify (self .Absolutify (Target ( c ))) for c in compilable ]
12461246 self .WriteList (objs , 'OBJS' )
12471247
12481248 for obj in objs :
@@ -1314,7 +1314,7 @@ def WriteSources(self, configs, deps, sources,
13141314
13151315 # If there are any object files in our input file list, link them into our
13161316 # output.
1317- extra_link_deps += filter (Linkable , sources )
1317+ extra_link_deps += list ( filter (Linkable , sources ) )
13181318
13191319 self .WriteLn ()
13201320
@@ -1564,7 +1564,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
15641564
15651565 # Bundle dependencies. Note that the code below adds actions to this
15661566 # target, so if you move these two lines, move the lines below as well.
1567- self .WriteList (map ( QuoteSpaces , bundle_deps ) , 'BUNDLE_DEPS' )
1567+ self .WriteList ([ QuoteSpaces ( dep ) for dep in bundle_deps ] , 'BUNDLE_DEPS' )
15681568 self .WriteLn ('%s: $(BUNDLE_DEPS)' % QuoteSpaces (self .output ))
15691569
15701570 # After the framework is built, package it. Needs to happen before
@@ -1598,7 +1598,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
15981598 if self .type == 'executable' :
15991599 self .WriteLn ('%s: LD_INPUTS := %s' % (
16001600 QuoteSpaces (self .output_binary ),
1601- ' ' .join (map ( QuoteSpaces , link_deps ) )))
1601+ ' ' .join (QuoteSpaces ( dep ) for dep in link_deps )))
16021602 if self .toolset == 'host' and self .flavor == 'android' :
16031603 self .WriteDoCmd ([self .output_binary ], link_deps , 'link_host' ,
16041604 part_of_all , postbuilds = postbuilds )
@@ -1620,7 +1620,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
16201620 elif self .type == 'shared_library' :
16211621 self .WriteLn ('%s: LD_INPUTS := %s' % (
16221622 QuoteSpaces (self .output_binary ),
1623- ' ' .join (map ( QuoteSpaces , link_deps ) )))
1623+ ' ' .join (QuoteSpaces ( dep ) for dep in link_deps )))
16241624 self .WriteDoCmd ([self .output_binary ], link_deps , 'solink' , part_of_all ,
16251625 postbuilds = postbuilds )
16261626 elif self .type == 'loadable_module' :
@@ -1746,8 +1746,8 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
17461746 output is just a name to run the rule
17471747 command: (optional) command name to generate unambiguous labels
17481748 """
1749- outputs = map ( QuoteSpaces , outputs )
1750- inputs = map ( QuoteSpaces , inputs )
1749+ outputs = [ QuoteSpaces ( o ) for o in outputs ]
1750+ inputs = [ QuoteSpaces ( i ) for i in inputs ]
17511751
17521752 if comment :
17531753 self .WriteLn ('# ' + comment )
@@ -1836,7 +1836,7 @@ def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps):
18361836 default_cpp_ext = ext
18371837 self .WriteLn ('LOCAL_CPP_EXTENSION := ' + default_cpp_ext )
18381838
1839- self .WriteList (map (self .Absolutify , filter (Compilable , all_sources )),
1839+ self .WriteList (list ( map (self .Absolutify , filter (Compilable , all_sources ) )),
18401840 'LOCAL_SRC_FILES' )
18411841
18421842 # Filter out those which do not match prefix and suffix and produce
@@ -1979,7 +1979,7 @@ def WriteAutoRegenerationRule(params, root_makefile, makefile_name,
19791979 "%(makefile_name)s: %(deps)s\n "
19801980 "\t $(call do_cmd,regen_makefile)\n \n " % {
19811981 'makefile_name' : makefile_name ,
1982- 'deps' : ' ' .join (map ( SourceifyAndQuoteSpaces , build_files ) ),
1982+ 'deps' : ' ' .join (SourceifyAndQuoteSpaces ( bf ) for bf in build_files ),
19831983 'cmd' : gyp .common .EncodePOSIXShellList (
19841984 [gyp_binary , '-fmake' ] +
19851985 gyp .RegenerateFlags (options ) +
0 commit comments