相关疑难解决方法(0)

将代码从Python 2.x转换为3.x.

这是我上一个问题的后续内容,我正在使用Senthil Kumaran建议的2to3工具

它似乎运作良好,但它没有拿起这部分:

raise LexError,("%s:%d: Rule '%s' returned an unknown token type '%s'" % (
    func.func_code.co_filename, func.func_code.co_firstlineno,
    func.__name__, newtok.type),lexdata[lexpos:])
Run Code Online (Sandbox Code Playgroud)

这在3.2中应该是什么样的?

编辑:从下面的答案的变化是好的,2to3现在似乎工作正常.在setup.py构建中,我现在得到以下错误,请参阅我的新问题.

python python-3.x

1
推荐指数
1
解决办法
2950
查看次数

标签 统计

python ×1

python-3.x ×1