diff options
author | Rob Austein <sra@hactrn.net> | 2009-12-21 16:48:32 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-12-21 16:48:32 +0000 |
commit | cba5f61350bc202daeaace764f2c4366f8fcac53 (patch) | |
tree | 171b3414d99158703f4623ccb2586cc7b899a761 /rpkid/irdbd.py | |
parent | 20830c643ce3bc378d8a42b03076fa2d430f563d (diff) |
Suppress Python 2.6 warnings about MySQLdb using deprecated sets
module, since the code still works and this is beyond our control.
svn path=/rpkid/irdbd.py; revision=2894
Diffstat (limited to 'rpkid/irdbd.py')
-rw-r--r-- | rpkid/irdbd.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/rpkid/irdbd.py b/rpkid/irdbd.py index 459758df..9facc6aa 100644 --- a/rpkid/irdbd.py +++ b/rpkid/irdbd.py @@ -36,10 +36,18 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ -import sys, os, time, getopt, urlparse, MySQLdb +import sys, os, time, getopt, urlparse, warnings import rpki.https, rpki.config, rpki.resource_set, rpki.relaxng import rpki.exceptions, rpki.left_right, rpki.log, rpki.x509 +# Silence warning while loading MySQLdb in Python 2.6, sigh +if hasattr(warnings, "catch_warnings"): + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + import MySQLdb +else: + import MySQLdb + def handle_list_resources(q_pdu, r_msg): r_pdu = rpki.left_right.list_resources_elt() |