【发布时间】:2019-08-13 10:16:35
【问题描述】:
我正在重构一些 python2 代码并使用 2to3 模块将其更改为 python3。我收到以下解析错误:
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse ./helpers/repo.py: ParseError: bad input: type=22, value='=', context=(' ', (45, 25))
这是产生错误的代码:
except ImportError as error_msg: # pragma: no cover
print(' ', file = sys.stderr) # this is a line that yields error
print("Could not locate modifyrepo.py", file=sys.stderr)
print("That is odd... should be with createrepo", file=sys.stderr)
raise ImportError(error_msg)
我不知道可能出了什么问题。你能帮忙吗?
【问题讨论】:
标签: python python-2to3