未验证 提交 dd2f4a1c 编写于 作者: N Nyakku Shigure 提交者: GitHub

fix a syntax error (#45287)

上级 4fd90971
......@@ -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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册