@@ -119,15 +119,15 @@ def run_command(args):
119
119
def collect_submodules (common_args , module ):
120
120
# Execute swift-ide-test to print the interface.
121
121
my_args = ['-module-print-submodules' , '-module-to-print=%s' % (module )]
122
- (exitcode , out , err ) = run_command (common_args + my_args )
122
+ (exitcode , out , _ ) = run_command (common_args + my_args )
123
123
if exitcode != 0 :
124
124
print (
125
125
'error: submodule collection failed for module %s with error %d' %
126
126
(module , exitcode ))
127
127
return ()
128
128
129
129
# Find all of the submodule imports.
130
- import_matcher = re .compile ('.*import\s+%s\.([A-Za-z_0-9.]+)' % (module ))
130
+ import_matcher = re .compile (r '.*import\s+%s\.([A-Za-z_0-9.]+)' % (module ))
131
131
submodules = set ()
132
132
for line in out .splitlines ():
133
133
match = import_matcher .match (line )
@@ -140,10 +140,10 @@ def collect_submodules(common_args, module):
140
140
141
141
142
142
def print_command (cmd , outfile = "" ):
143
- str = " " .join (cmd )
143
+ retstr = " " .join (cmd )
144
144
if outfile != "" :
145
- str += " > " + outfile
146
- print (str )
145
+ retstr += " > " + outfile
146
+ print (retstr )
147
147
148
148
# Dump the API for the given module.
149
149
@@ -200,15 +200,15 @@ def pretty_sdk_name(sdk):
200
200
201
201
202
202
def collect_frameworks (sdk ):
203
- (exitcode , sdk_path , err ) = run_command (
203
+ (exitcode , sdk_path , _ ) = run_command (
204
204
["xcrun" , "--show-sdk-path" , "-sdk" , sdk ])
205
205
if exitcode != 0 :
206
206
print ('error: framework collection failed to find SDK path for %s '
207
207
'with error %d' % (sdk , exitcode ))
208
208
return ()
209
209
sdk_path = sdk_path .rstrip ()
210
210
211
- (exitcode , sdk_version , err ) = run_command (
211
+ (exitcode , sdk_version , _ ) = run_command (
212
212
["xcrun" , "--show-sdk-version" , "-sdk" , sdk ])
213
213
if exitcode != 0 :
214
214
print ('error: framework collection failed to find SDK version for %s '
@@ -221,7 +221,7 @@ def collect_frameworks(sdk):
221
221
222
222
# Collect all of the framework names
223
223
frameworks_dir = '%s/System/Library/Frameworks' % sdk_path
224
- framework_matcher = re .compile ('([A-Za-z_0-9.]+)\.framework' )
224
+ framework_matcher = re .compile (r '([A-Za-z_0-9.]+)\.framework' )
225
225
frameworks = set ()
226
226
for entry in os .listdir (frameworks_dir ):
227
227
match = framework_matcher .match (entry )
@@ -234,8 +234,7 @@ def collect_frameworks(sdk):
234
234
235
235
236
236
def create_dump_module_api_args (cmd_common , cmd_extra_args , sdk , module ,
237
- target , source_filename , output_dir , quiet ,
238
- verbose ):
237
+ target , output_dir , quiet , verbose ):
239
238
240
239
# Determine the SDK root and collect the set of frameworks.
241
240
(frameworks , sdk_root ) = collect_frameworks (sdk )
@@ -302,7 +301,7 @@ def main():
302
301
for sdk in args .sdk :
303
302
jobs = jobs + create_dump_module_api_args (
304
303
cmd_common , extra_args , sdk , args .module ,
305
- args .target , source_filename , args .output_dir ,
304
+ args .target , args .output_dir ,
306
305
args .quiet , args .verbose )
307
306
308
307
# Execute the API dumps
0 commit comments