AttributeError: 'NoneType' object has no attribute 'name'

版权声明: https://blog.csdn.net/weixin_41357300/article/details/85251093

python 使用 reload 功能时,修改模块文件内容,执行到reload如上报错

File "C:\Python36-32\lib\importlib\__init__.py", line 166, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 589, in _exec
AttributeError: 'NoneType' object has no attribute 'name'

原因是:

主程序循环太快了,增加sleep(1),能解决,具体原因待查

猜你喜欢

转载自blog.csdn.net/weixin_41357300/article/details/85251093
今日推荐