exec code in self.locals

exec code in self.locals
错误主要是因为在 python3 环境下 , 进行 debug 调试,源码没有进行更新导致.

需要将 exec code in self.locals 修改为 

exec(code in self.locals)

注:
 文件名不要写为 code.py 会造成 ImportError: cannot import name 'InteractiveInterpreter'  错误

也就是说 debug 的文件名称不可以为 code.py 

 

posted @ 2021-08-27 17:02  CodeYaSuo  阅读(1042)  评论(0编辑  收藏  举报