Skip to content
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

fix TypeError in ament_uncrustify #228

Merged
merged 1 commit into from
Apr 8, 2020
Merged
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
8 changes: 5 additions & 3 deletions ament_uncrustify/ament_uncrustify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def main(argv=sys.argv[1:]):
all_input_files += input_files
output_files = invoke_uncrustify(
uncrustify_bin, input_files, args, language, temp_path, suffix)
if output_files is None:
return 1
all_output_files += output_files

# compute diff
Expand Down Expand Up @@ -277,7 +279,7 @@ def invoke_uncrustify(
print(e.output.decode(), file=sys.stderr)
print("The invocation of 'uncrustify' failed with error code %d: %s" %
(e.returncode, e), file=sys.stderr)
return 1
return None

if cwd:
# input files are relative
Expand Down Expand Up @@ -336,14 +338,14 @@ def invoke_uncrustify(
print(e.output, file=sys.stderr)
print("The invocation of 'uncrustify' failed with error code %d: "
'%s' % (e.returncode, e), file=sys.stderr)
return 1
return None

uncrustified_files = [f + suffix for f in input_files]
i += 1
if i >= 5:
print("'uncrustify' did not settle on a final result even after "
'%d invocations' % i, file=sys.stderr)
return 1
return None

return output_files

Expand Down