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/Source/Python/Workspace/MetaFileTable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/MetaFileTable.py') diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools/Source/Python/Workspace/MetaFileTable.py index 3c8dae0e62..d17487a440 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -63,7 +63,7 @@ class MetaFileTable(Table): # update the timestamp in database self._FileIndexTable.SetFileTimeStamp(self.IdBase, TimeStamp) return False - except Exception, Exc: + except Exception as Exc: EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc)) return False return True @@ -250,7 +250,7 @@ class PackageTable(MetaFileTable): if comment.startswith("@Expression"): comment = comment.replace("@Expression", "", 1) expressions.append(comment.split("|")[1].strip()) - except Exception, Exc: + except Exception as Exc: ValidType = "" if oricomment.startswith("@ValidRange"): ValidType = "@ValidRange" -- cgit v1.2.3