Update find_patches to python3
The `find_patches.py` utility was python2. Update it to python3.
In addition:
- Re-run it to get the latest version of `README.patches`
- Update the copyright headers to the new style
Bug: chromium:1409095
Change-Id: I4181e6abd9242cf9da86b1da3f3920bcee4ad819
diff --git a/find_patches.py b/find_patches.py
index 3a9f87c..663fd6c 100755
--- a/find_patches.py
+++ b/find_patches.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright 2018 The Chromium Authors. All rights reserved.
+# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
@@ -18,7 +18,6 @@
find_patches.py origin/merge-m68 > patches.68
"""
-from __future__ import print_function
import collections
import os
import re
@@ -43,7 +42,7 @@
Returns:
stdout as a a string.
"""
- return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
+ return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0].decode()
class PatchInfo:
@@ -246,7 +245,7 @@
file=output_file)
print("\n", file=output_file)
wd = os.getcwd()
- for sha1, date in sorted(sha1_to_date.iteritems(), key=lambda (k, v): v):
+ for sha1, date in sorted(sha1_to_date.items(), key=lambda kv: kv[1]):
print(
"------------------------------------------------------------------",
file=output_file)