from warnings import filterwarnings, catch_warnings with catch_warnings(): if sys.py3kwarning: filterwarnings("ignore", ".*mimetools has been removed", DeprecationWarning) import mimetools import SocketServer
對於這段代碼,開始第一句python
from warnings import filterwarnings, catch_warnings
這裏import 了catch_warning,但是這裏真心沒看懂code
with catch_warnings(): if sys.py3kwarning: filterwarnings("ignore", ".*mimetools has been removed", DeprecationWarning) import mimetools