From 82d54fa24c28e3638e008f95b7f0bbc995a957c2 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 7 Jun 2021 10:38:55 -0700 Subject: [PATCH] Fix Android imports stamp file write mode 'w' (write) and 'a' (append) are mutually exclusive open modes in python -- 'w' truncates and opens for write; 'a' opens at end of file for write; both create if the file doesn't exist. Python 2.7 didn't warn about this; Python 3 does. --- tools/android_illegal_imports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/android_illegal_imports.py b/tools/android_illegal_imports.py index 2a2d5ac1fbf1f..e07573f141f92 100644 --- a/tools/android_illegal_imports.py +++ b/tools/android_illegal_imports.py @@ -17,7 +17,7 @@ def main(): parser.add_argument('--files', type=str, required=True, nargs='+') args = parser.parse_args() - open(args.stamp, 'wa').close() + open(args.stamp, 'a').close() bad_files = []