AttributeError: module 'sys' has no attribute 'maxint'

近日, GITHUB上学习一个demo, 无奈作者是用 python2 写的, 改了些常规的区别后, 报了这个错:

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.maxint
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'sys' has no attribute 'maxint'

module 'sys' has no attribute 'maxint'

将
```
sys.maxint
```
改为
```
sys.maxsize
```

这里是官方文档, py2 to py3

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章