近日, 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 "", line 1, in
AttributeError: module 'sys' has no attribute 'maxint'
将
```
sys.maxint
```
改为
```
sys.maxsize
```
这里是官方文档, py2 to py3