Changeset: 74e28f840393 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=74e28f840393
Modified Files:
        clients/python/monetdb/sql/converters.py
        clients/python/setup.py
        clients/python3/monetdb/sql/converters.py
        clients/python3/setup.py
Branch: default
Log Message:

removal of version specific code


diffs (97 lines):

diff --git a/clients/python/monetdb/sql/converters.py 
b/clients/python/monetdb/sql/converters.py
--- a/clients/python/monetdb/sql/converters.py
+++ b/clients/python/monetdb/sql/converters.py
@@ -179,23 +179,12 @@ class Monetizer(object):
             decimal.Decimal: self.__string,
             datetime.timedelta: self.__escape,
             datetime.date: self.__escape,
-            # I don't think these should be used:
-            #list: self.__string,
-            #tuple: self.__string,
-            #range: self.__string,
-            #set: self.__string,
-            #frozenset: self.__string,
-            #dict: self.__string,
-            #Ellipsis: self.__string,
-            #self.mapping[bytearray] = self.__string # python2.6 only
         }
 
         (major, minor, micro, level, serial)  = sys.version_info
-        if (major == 3) or (major == 2 and minor == 6):
+        if (major == 2 and minor >= 6):
             # bytes type is only supported by python 2.6 and higher
             self.mapping[bytes] = self.__bytes
-        if (major != 3):
-            self.mapping[unicode] = self.__unicode
 
     def convert(self, data):
         try:
diff --git a/clients/python/setup.py b/clients/python/setup.py
--- a/clients/python/setup.py
+++ b/clients/python/setup.py
@@ -38,7 +38,7 @@ setup(name='monetdb',
         "Development Status :: 5 - Production/Stable",
         "Intended Audience :: Developers",
         "License :: Other/Proprietary License",
-        "Programming Language :: Python",
+        "Programming Language :: Python :: 2",
     ]
 )
 
diff --git a/clients/python3/monetdb/sql/converters.py 
b/clients/python3/monetdb/sql/converters.py
--- a/clients/python3/monetdb/sql/converters.py
+++ b/clients/python3/monetdb/sql/converters.py
@@ -179,24 +179,9 @@ class Monetizer:
             decimal.Decimal: self.__string,
             datetime.timedelta: self.__escape,
             datetime.date: self.__escape,
-            # I don't think these should be used:
-            #list: self.__string,
-            #tuple: self.__string,
-            #range: self.__string,
-            #set: self.__string,
-            #frozenset: self.__string,
-            #dict: self.__string,
-            #Ellipsis: self.__string,
-            #self.mapping[bytearray] = self.__string # python2.6 only
+            bytes: self.__bytes,
         }
 
-        (major, minor, micro, level, serial)  = sys.version_info
-        if (major == 3) or (major == 2 and minor == 6):
-            # bytes type is only supported by python 2.6 and higher
-            self.mapping[bytes] = self.__bytes
-        if (major != 3):
-            self.mapping[unicode] = self.__unicode
-
     def convert(self, data):
         try:
             return self.mapping[type(data)](data)
@@ -224,10 +209,6 @@ class Monetizer:
     def __bytes(self, data):
         return self.__escape(data)
 
-    def __unicode(self, data):
-        return self.__escape(data.encode('utf-8'))
-
-
 
 # everything below is kind of pointless but required by DB API
 Date = datetime.date
diff --git a/clients/python3/setup.py b/clients/python3/setup.py
--- a/clients/python3/setup.py
+++ b/clients/python3/setup.py
@@ -33,12 +33,11 @@ setup(name='monetdb',
     packages=['monetdb', 'monetdb.sql'],
     download_url='<will be filled in before a 
release>/python-monetdb-11.11.6.tar.gz',
     classifiers=[
-        "Topic :: Database",
         "Topic :: Database :: Database Engines/Servers",
         "Development Status :: 5 - Production/Stable",
         "Intended Audience :: Developers",
         "License :: Other/Proprietary License",
-        "Programming Language :: Python",
+        "Programming Language :: Python :: 3",
     ]
 )
 
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to