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

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