port list_deliverable_changes.py to python 3
Depends-On: Ifb435ea9c5d99639e1562761f9c48cbefb9db57f Change-Id: Ie5d62db38bd3fc77c045ef37b264e85c5fb65e43 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
199d536309
commit
72d8452aeb
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
# not use this file except in compliance with the License. You may obtain
|
# not use this file except in compliance with the License. You may obtain
|
||||||
@ -15,8 +15,6 @@
|
|||||||
"""Lists the most recent versions in the deliverable files.
|
"""Lists the most recent versions in the deliverable files.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
@ -35,7 +33,7 @@ def find_modified_deliverable_files(reporoot):
|
|||||||
results = subprocess.check_output(
|
results = subprocess.check_output(
|
||||||
['git', 'diff', '--name-only', '--pretty=format:', 'HEAD^'],
|
['git', 'diff', '--name-only', '--pretty=format:', 'HEAD^'],
|
||||||
cwd=reporoot,
|
cwd=reporoot,
|
||||||
)
|
).decode('utf-8')
|
||||||
filenames = [
|
filenames = [
|
||||||
l.strip()
|
l.strip()
|
||||||
for l in results.splitlines()
|
for l in results.splitlines()
|
||||||
@ -66,7 +64,7 @@ def get_modified_deliverable_file_content(reporoot, filenames):
|
|||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
# The file must have been deleted, skip it.
|
# The file must have been deleted, skip it.
|
||||||
continue
|
continue
|
||||||
with open(filename, 'r') as f:
|
with open(filename, 'r', encoding='utf-8') as f:
|
||||||
deliverable_data = yaml.load(f.read())
|
deliverable_data = yaml.load(f.read())
|
||||||
|
|
||||||
# If there are no releases listed in this file, skip it.
|
# If there are no releases listed in this file, skip it.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user