File MySQL-python-1.2.2-deprecated-sets.patch of Package python-mysql

--- MySQLdb/__init__.py
+++ MySQLdb/__init__.py
@@ -31,22 +31,19 @@
 from MySQLdb.times import Date, Time, Timestamp, \
     DateFromTicks, TimeFromTicks, TimestampFromTicks
 
-from sets import ImmutableSet
-class DBAPISet(ImmutableSet):
+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):
+        if isinstance(other, (set,frozenset)):
             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):
+        if isinstance(other, (set,frozenset)):
             return super(DBAPISet, self).__eq__(self, other)
         else:
             return other in self
--- MySQLdb/converters.py
+++ MySQLdb/converters.py
@@ -34,7 +34,6 @@
 
 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
@@ -42,7 +41,7 @@
 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)
@@ -126,7 +125,7 @@
     types.BooleanType: Bool2Str,
     DateTimeType: DateTime2literal,
     DateTimeDeltaType: DateTimeDelta2literal,
-    Set: Set2Str,
+    set: Set2Str,
     FIELD_TYPE.TINY: int,
     FIELD_TYPE.SHORT: int,
     FIELD_TYPE.LONG: long,
openSUSE Build Service is sponsored by