Skip to content

[Python] Fix recently introduced PEP 8 regressions. #1260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions benchmark/scripts/Benchmark_DTrace.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DTraceResult(perf_test_driver.Result):
@classmethod
def data_format(cls, max_test_len):
non_name_headers = DTraceResult.data_headers()[1:]
fmt = ('{:<%d}' % (max_test_len+5)) + ''.join(['{:<%d}' % (len(h)+2) for h in non_name_headers])
fmt = ('{:<%d}' % (max_test_len + 5)) + ''.join(['{:<%d}' % (len(h) + 2) for h in non_name_headers])
return fmt

@classmethod
Expand All @@ -63,7 +63,7 @@ class DTraceBenchmarkDriver(perf_test_driver.BenchmarkDriver):
def __init__(self, binary, xfail_list, csv_output):
perf_test_driver.BenchmarkDriver.__init__(self, binary, xfail_list,
enable_parallel=False,
opt_levels = ['O'])
opt_levels=['O'])
self.csv_output = csv_output

def print_data_header(self, max_test_len):
Expand All @@ -81,7 +81,7 @@ class DTraceBenchmarkDriver(perf_test_driver.BenchmarkDriver):
p = subprocess.Popen(['sudo', 'dtrace', '-s', DTRACE_PATH, '-c', '%s %s %s' % (data['path'], data['test_name'], '--num-iters=%d' % iters)],
stdout=subprocess.PIPE, stderr=open('/dev/null', 'w'))
results = [x for x in p.communicate()[0].split("\n") if len(x) > 0]
return [x.split(',')[1] for x in results[results.index('DTRACE RESULTS')+1:]]
return [x.split(',')[1] for x in results[results.index('DTRACE RESULTS') + 1:]]
iter_2_results = get_results_with_iters(2)
iter_3_results = get_results_with_iters(3)

Expand Down
22 changes: 13 additions & 9 deletions utils/omit-needless-words.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,30 @@ def dump_module_api((cmd, extra_dump_args, output_dir, module, quiet)):
return

def pretty_sdk_name(sdk):
if sdk.find("macosx") == 0: return 'OSX'
if sdk.find("iphoneos") == 0: return 'iOS'
if sdk.find("watchos") == 0: return 'watchOS'
if sdk.find("appletvos") == 0: return 'tvOS'
if sdk.find("macosx") == 0:
return 'OSX'
if sdk.find("iphoneos") == 0:
return 'iOS'
if sdk.find("watchos") == 0:
return 'watchOS'
if sdk.find("appletvos") == 0:
return 'tvOS'
return 'unknownOS'

# Collect the set of frameworks we should dump
# Collect the set of frameworks we should dump
def collect_frameworks(sdk):
(exitcode, sdk_path, err) = run_command(["xcrun", "--show-sdk-path", "-sdk", sdk])
if exitcode != 0:
print('error: framework collection failed with error %d' % (exitcode))
return ()
sdk_path = sdk_path.rstrip()

(exitcode, sdk_version, err) = run_command(["xcrun", "--show-sdk-version", "-sdk", sdk])
if exitcode != 0:
print('error: framework collection failed with error %d' % (exitcode))
return ()
sdk_version = sdk_version.rstrip()

print('Collecting frameworks from %s %s at %s' % (pretty_sdk_name(sdk), sdk_version, sdk_path))

# Collect all of the framework names
Expand All @@ -147,7 +151,7 @@ def collect_frameworks(sdk):
match = framework_matcher.match(entry)
if match:
framework = match.group(1)
if not framework in SKIPPED_FRAMEWORKS:
if framework not in SKIPPED_FRAMEWORKS:
frameworks.add(framework)

return (sorted(list(frameworks)), sdk_path)
Expand Down Expand Up @@ -201,7 +205,7 @@ def main():
# Execute the API dumps
pool = multiprocessing.Pool(processes=args.jobs)
pool.map(dump_module_api, jobs)

# Remove the .swift file we fed into swift-ide-test
subprocess.call(['rm', '-f', source_filename])

Expand Down