This is a followup on my previous question, I am using the 2to3 tool as suggested by Senthil Kumaran
It seems to work well but it doesn't pick up this part:
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:])
What should this look like in 3.2 ?
EDIT: the changes from the answer below are good, 2to3 now seems to work ok. Howevery in the setup.py build I now get the error below, see my new question.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…