diff options
author | Rob Austein <sra@hactrn.net> | 2009-12-25 21:31:09 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-12-25 21:31:09 +0000 |
commit | 56516d7fd4589c1f2dd460b3f111a9e8a07b5cc8 (patch) | |
tree | 01f1f5741656d45fb683414bee3b761b499e4b2f /myrpki | |
parent | 0a8bdacb45283b3a594d918f59a3659f40fe8b6c (diff) |
Oops, another program that uses MySQLdb directly thus needs the
MySQLdb warning suppression kludge after upgrading to Python 2.6.
svn path=/myrpki/myirbe.py; revision=2909
Diffstat (limited to 'myrpki')
-rw-r--r-- | myrpki/myirbe.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/myrpki/myirbe.py b/myrpki/myirbe.py index b7533046..fc2f2ada 100644 --- a/myrpki/myirbe.py +++ b/myrpki/myirbe.py @@ -41,11 +41,21 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ -import lxml.etree, base64, subprocess, sys, os, time, re, getopt, MySQLdb +from __future__ import with_statement + +import lxml.etree, base64, subprocess, sys, os, time, re, getopt, warnings import rpki.https, rpki.config, rpki.resource_set, rpki.relaxng import rpki.exceptions, rpki.left_right, rpki.log, rpki.x509, rpki.async import myrpki, schema +# 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 tag(t): """ Wrap an element name in the right XML namespace goop. |