[Python-modules-commits] r9368 - in packages/python-mysqldb/trunk/debian (3 files)

mejo at users.alioth.debian.org mejo at users.alioth.debian.org
Sun Aug 16 21:01:16 UTC 2009


    Date: Sunday, August 16, 2009 @ 21:01:15
  Author: mejo
Revision: 9368

add debian/patches/07_python_2.6.dpatch

Added:
  packages/python-mysqldb/trunk/debian/patches/07_python_2.6.dpatch
Modified:
  packages/python-mysqldb/trunk/debian/changelog
  packages/python-mysqldb/trunk/debian/patches/00list

Modified: packages/python-mysqldb/trunk/debian/changelog
===================================================================
--- packages/python-mysqldb/trunk/debian/changelog	2009-08-16 13:01:16 UTC (rev 9367)
+++ packages/python-mysqldb/trunk/debian/changelog	2009-08-16 21:01:15 UTC (rev 9368)
@@ -1,3 +1,11 @@
+python-mysqldb (1.2.2-9) unstable; urgency=low
+
+  * NOT RELEASED YET
+  * Add 07_python_2.6.dpatch to fix python 2.6 related warnings. Thanks to
+    Mario Limonciello <superm1 at ubuntu.com> for the patch. (closes: #541719)
+
+ -- Jonas Meurer <mejo at debian.org>  Sun, 16 Aug 2009 22:45:25 +0200
+
 python-mysqldb (1.2.2-8) unstable; urgency=low
 
   [ Sandro Tosi ]

Modified: packages/python-mysqldb/trunk/debian/patches/00list
===================================================================
--- packages/python-mysqldb/trunk/debian/patches/00list	2009-08-16 13:01:16 UTC (rev 9367)
+++ packages/python-mysqldb/trunk/debian/patches/00list	2009-08-16 21:01:15 UTC (rev 9368)
@@ -3,3 +3,4 @@
 04_disable_ez_setup
 05_null-connection-guard
 06_mysql_connect_port
+07_python_2.6.dpatch

Added: packages/python-mysqldb/trunk/debian/patches/07_python_2.6.dpatch
===================================================================
--- packages/python-mysqldb/trunk/debian/patches/07_python_2.6.dpatch	                        (rev 0)
+++ packages/python-mysqldb/trunk/debian/patches/07_python_2.6.dpatch	2009-08-16 21:01:15 UTC (rev 9368)
@@ -0,0 +1,98 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 07_python_2.6.dpatch by  <superm1 at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Cherry pick upstream 554 & 603 to fix python 2.6 support
+
+ at DPATCH@
+--- a/MySQLdb/__init__.py
++++ b/MySQLdb/__init__.py
+@@ -19,8 +19,8 @@
+ import _mysql
+ 
+ if version_info != _mysql.version_info:
+-    raise ImportError, "this is MySQLdb version %s, but _mysql is version %r" %\
+-          (version_info, _mysql.version_info)
++    raise ImportError("this is MySQLdb version %s, but _mysql is version %r" %
++                      (version_info, _mysql.version_info))
+ 
+ threadsafety = 1
+ apilevel = "2.0"
+@@ -31,25 +31,20 @@
+ from MySQLdb.times import Date, Time, Timestamp, \
+     DateFromTicks, TimeFromTicks, TimestampFromTicks
+ 
+-from sets import ImmutableSet
+-class DBAPISet(ImmutableSet):
++try:
++    frozenset
++except NameError:
++    from sets import ImmutableSet as frozenset
++
++class DBAPISet(frozenset):
+ 
+     """A special type of set for which A == x is true if A is a
+     DBAPISet and x is a member of that set."""
+ 
+-    def __ne__(self, other):
+-        from sets import BaseSet
+-        if isinstance(other, BaseSet):
+-            return super(DBAPISet.self).__ne__(self, other)
+-        else:
+-            return other not in self
+-
+     def __eq__(self, other):
+-        from sets import BaseSet
+-        if isinstance(other, BaseSet):
+-            return super(DBAPISet, self).__eq__(self, other)
+-        else:
+-            return other in self
++        if isinstance(other, DBAPISet):
++            return not self.difference(other)
++        return other in self
+ 
+ 
+ STRING    = DBAPISet([FIELD_TYPE.ENUM, FIELD_TYPE.STRING,
+@@ -65,6 +60,18 @@
+ DATETIME  = TIMESTAMP
+ ROWID     = DBAPISet()
+ 
++def test_DBAPISet_set_equality():
++    assert STRING == STRING
++
++def test_DBAPISet_set_inequality():
++    assert STRING != NUMBER
++
++def test_DBAPISet_set_equality_membership():
++    assert FIELD_TYPE.VAR_STRING == STRING
++
++def test_DBAPISet_set_inequality_membership():
++    assert FIELD_TYPE.DATE != STRING
++
+ def Binary(x):
+     return str(x)
+ 
+--- a/MySQLdb/converters.py
++++ b/MySQLdb/converters.py
+@@ -34,15 +34,19 @@
+ 
+ from _mysql import string_literal, escape_sequence, escape_dict, escape, NULL
+ from constants import FIELD_TYPE, FLAG
+-from sets import BaseSet, Set
+ from times import *
+ import types
+ import array
+ 
++try:
++    set
++except NameError:
++    from sets import Set as set
++
+ def Bool2Str(s, d): return str(int(s))
+ 
+ def Str2Set(s):
+-    return Set([ i for i in s.split(',') if i ])
++    return set([ i for i in s.split(',') if i ])
+ 
+ def Set2Str(s, d):
+     return string_literal(','.join(s), d)




More information about the Python-modules-commits mailing list