diff options
author | Martin Liska <mliska@suse.cz> | 2020-11-16 20:26:28 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-11-16 20:26:28 +0100 |
commit | d6d9561c2ed4eec77a7d23a8928ee407264086a1 (patch) | |
tree | 88e6b60edb4cb4688005a3e186c3316a3dd95bae /contrib/mklog.py | |
parent | 85ebbabd85e03bdc3afc190aeb29250606d18322 (diff) | |
download | gcc-d6d9561c2ed4eec77a7d23a8928ee407264086a1.tar.gz |
mklog: support unidiff 0.5.4
contrib/ChangeLog:
* mklog.py: Do not call read on an input stream.
Fix some flake8 issues.
Diffstat (limited to 'contrib/mklog.py')
-rwxr-xr-x | contrib/mklog.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/mklog.py b/contrib/mklog.py index 1e85dfe583a..57be2995070 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -50,7 +50,7 @@ template_and_param_regex = re.compile(r'<[^<>]*>') bugzilla_url = 'https://gcc.gnu.org/bugzilla/rest.cgi/bug?id=%s&' \ 'include_fields=summary' -function_extensions = set(['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def']) +function_extensions = {'.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def'} help_message = """\ Generate ChangeLog template for PATCH. @@ -111,8 +111,8 @@ def sort_changelog_files(changed_file): def get_pr_titles(prs): output = '' for pr in prs: - id = pr.split('/')[-1] - r = requests.get(bugzilla_url % id) + pr_id = pr.split('/')[-1] + r = requests.get(bugzilla_url % pr_id) bugs = r.json()['bugs'] if len(bugs) == 1: output += '%s - %s\n' % (pr, bugs[0]['summary']) @@ -242,8 +242,7 @@ if __name__ == '__main__': if args.input == '-': args.input = None - input = open(args.input) if args.input else sys.stdin - data = input.read() + data = open(args.input) if args.input else sys.stdin output = generate_changelog(data, args.no_functions, args.fill_up_bug_titles) if args.changelog: |