From 5b0671c1e514e534c6d5be9604da33bfc2cd0a24 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Mon, 25 Jun 2018 18:31:25 +0800 Subject: BaseTools: Refactor python except statements Convert "except ... ," to "except ... as" to be compatible with python3. Based on "futurize -f lib2to3.fixes.fix_except" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin Reviewed-by: Yonghong Zhu --- BaseTools/Tests/CheckPythonSyntax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools/Tests') diff --git a/BaseTools/Tests/CheckPythonSyntax.py b/BaseTools/Tests/CheckPythonSyntax.py index 61a048ad5d..a55b29de47 100644 --- a/BaseTools/Tests/CheckPythonSyntax.py +++ b/BaseTools/Tests/CheckPythonSyntax.py @@ -29,7 +29,7 @@ class Tests(TestTools.BaseToolsTest): def SingleFileTest(self, filename): try: py_compile.compile(filename, doraise=True) - except Exception, e: + except Exception as e: self.fail('syntax error: %s, Error is %s' % (filename, str(e))) def MakePythonSyntaxCheckTests(): -- cgit v1.2.3