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