aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/sql.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-12-21 16:48:32 +0000
committerRob Austein <sra@hactrn.net>2009-12-21 16:48:32 +0000
commitcba5f61350bc202daeaace764f2c4366f8fcac53 (patch)
tree171b3414d99158703f4623ccb2586cc7b899a761 /rpkid/rpki/sql.py
parent20830c643ce3bc378d8a42b03076fa2d430f563d (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/rpki/sql.py')
-rw-r--r--rpkid/rpki/sql.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/rpkid/rpki/sql.py b/rpkid/rpki/sql.py
index e133ffd9..a3ab9e55 100644
--- a/rpkid/rpki/sql.py
+++ b/rpkid/rpki/sql.py
@@ -32,7 +32,17 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
"""
-import MySQLdb, warnings, _mysql_exceptions
+import warnings
+
+# 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
+
+import _mysql_exceptions
import rpki.x509, rpki.resource_set, rpki.sundial, rpki.log
class session(object):