From 2528abf059653db8eef1cbaa29ea972e91b5a0ad Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 27 Mar 2018 17:12:43 +0100 Subject: [PATCH] PG: Make convert_for_template_tests.py compatible with Python 3 Add a wrapper method that tries to call open() with Python 3 semantics, and falls back to Python 2 if it fails. Bug: Issue 8609 Helped-by: Paladox none Change-Id: Ic46eb31a23506d47edcf6518dc1ccfb274f45c52 --- .../convert_for_template_tests.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/polygerrit-ui/app/template_test_srcs/convert_for_template_tests.py b/polygerrit-ui/app/template_test_srcs/convert_for_template_tests.py index 89bada344e..3a5cd83b65 100644 --- a/polygerrit-ui/app/template_test_srcs/convert_for_template_tests.py +++ b/polygerrit-ui/app/template_test_srcs/convert_for_template_tests.py @@ -10,26 +10,32 @@ fnCompiledRegex = re.compile(removeSelfInvokeRegex, re.DOTALL) regexBehavior = r"