我每次運行使用MySQLdb的Python腳本時間目前得到警告:Python的錯誤 - 套模塊已過時
/var/lib/python-support/python2.6/MySQLdb/__init__.py:34:
DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
我寧願不要用自己的lib如果可能的混亂。我在Ubuntu服務器上。任何人都知道解決這個警告信息的簡單方法嗎?
由於
UPDATE: 固定它基於下面的建議和該鏈接:https://bugzilla.redhat.com/show_bug.cgi?id=505611
import warnings
warnings.filterwarnings('ignore', '.*the sets module is deprecated.*',
DeprecationWarning, 'MySQLdb')
import MySQLdb
+1感謝!這是有幫助的! –