From dd2f4a1c14f116e7e4f9134bc10026554a372a1d Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Tue, 23 Aug 2022 14:17:50 +0800 Subject: [PATCH] fix a syntax error (#45287) --- tools/CrossStackProfiler/CspFileReader.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/CrossStackProfiler/CspFileReader.py b/tools/CrossStackProfiler/CspFileReader.py index 485f6d0f6a6..bafe9a03efe 100755 --- a/tools/CrossStackProfiler/CspFileReader.py +++ b/tools/CrossStackProfiler/CspFileReader.py @@ -206,12 +206,12 @@ class FileReader(object): prefix_str = fileName.split(sed)[-1] try: return int(prefix_str) - except ValueError, Argument: - print(Argument) + except ValueError as e: + print(e) raise TypeError("invalid fileName [%s]" % fileName) - except IndexError, Argument: - print(Argument) + except IndexError as e: + print(e) raise TypeError( "invalid fileName [%s], the prefix should be a number!" % fileName) @@ -363,8 +363,8 @@ def getLogger(): def test_FileReader(args): try: testReader = FileReader(None, args) - except Exception, Argument: - print(Argument) + except Exception as e: + print(e) else: testReader.printArgs() -- GitLab