diff options
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | MySQLdb/__init__.py | 4 | ||||
-rw-r--r-- | MySQLdb/connections.py | 5 | ||||
-rw-r--r-- | MySQLdb/converters.py | 4 | ||||
-rw-r--r-- | MySQLdb/cursors.py | 14 | ||||
-rw-r--r-- | MySQLdb/release.py | 4 | ||||
-rw-r--r-- | metadata.cfg | 9 | ||||
-rw-r--r-- | setup.cfg | 10 |
8 files changed, 28 insertions, 28 deletions
diff --git a/.travis.yml b/.travis.yml index 7676e24..446cedc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ language: python python: - - "2.5" - - "2.6" + - "3.2" - "2.7" - "pypy" +branches: + only: + - master install: python setup.py install before_script: mysql -e 'create database mysqldb_test charset utf8;' script: TESTDB=travis.cnf nosetests diff --git a/MySQLdb/__init__.py b/MySQLdb/__init__.py index 8761671..b73a99d 100644 --- a/MySQLdb/__init__.py +++ b/MySQLdb/__init__.py @@ -31,10 +31,6 @@ from MySQLdb.constants import FIELD_TYPE from MySQLdb.times import Date, Time, Timestamp, \ DateFromTicks, TimeFromTicks, TimestampFromTicks -try: - frozenset -except NameError: - from sets import ImmutableSet as frozenset class DBAPISet(frozenset): diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 40a6150..650561e 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -12,6 +12,7 @@ from _mysql_exceptions import Warning, Error, InterfaceError, DataError, \ NotSupportedError, ProgrammingError import types, _mysql import re +import six def defaulterrorhandler(connection, cursor, errorclass, errorvalue): @@ -33,7 +34,7 @@ def defaulterrorhandler(connection, cursor, errorclass, errorvalue): connection.messages.append(error) del cursor del connection - raise errorclass, errorvalue + six.reraise(errorclass, errorvalue) re_numeric_part = re.compile(r"^(\d+)") @@ -151,6 +152,8 @@ class Connection(_mysql.connection): from MySQLdb.constants import CLIENT, FIELD_TYPE from MySQLdb.converters import conversions from weakref import proxy + + import types kwargs2 = kwargs.copy() diff --git a/MySQLdb/converters.py b/MySQLdb/converters.py index 491d49b..c9dc11f 100644 --- a/MySQLdb/converters.py +++ b/MySQLdb/converters.py @@ -53,10 +53,6 @@ try: except AttributeError: ArrayType = array.array -try: - set -except NameError: - from sets import Set as set def Bool2Str(s, d): return str(int(s)) diff --git a/MySQLdb/cursors.py b/MySQLdb/cursors.py index 7e5a887..8485b7d 100644 --- a/MySQLdb/cursors.py +++ b/MySQLdb/cursors.py @@ -7,6 +7,8 @@ default, MySQLdb uses the Cursor class. import re import sys +import six + try: from types import ListType, TupleType, UnicodeType except ImportError: @@ -25,7 +27,7 @@ restr = r""" (?: (?: (?:\( - # ( - editor hightlighting helper + # ( - editor highlighting helper [^)]* \)) | @@ -177,14 +179,14 @@ class BaseCursor(object): """ del self.messages[:] db = self._get_db() - if isinstance(query, unicode): + if isinstance(query, six.text_type): query = query.encode(db.unicode_literal.charset) if args is not None: query = query % db.literal(args) try: r = None r = self._query(query) - except TypeError, m: + except TypeError as m: if m.args[0] in ("not enough arguments for format string", "not all arguments converted"): self.messages.append((ProgrammingError, m.args[0])) @@ -224,7 +226,7 @@ class BaseCursor(object): del self.messages[:] db = self._get_db() if not args: return - if isinstance(query, unicode): + if isinstance(query, six.text_type): query = query.encode(db.unicode_literal.charset) m = insert_values.search(query) if not m: @@ -237,7 +239,7 @@ class BaseCursor(object): qv = m.group(1) try: q = [ qv % db.literal(a) for a in args ] - except TypeError, msg: + except TypeError as msg: if msg.args[0] in ("not enough arguments for format string", "not all arguments converted"): self.errorhandler(self, ProgrammingError, msg.args[0]) @@ -287,7 +289,7 @@ class BaseCursor(object): for index, arg in enumerate(args): q = "SET @_%s_%d=%s" % (procname, index, db.literal(arg)) - if isinstance(q, unicode): + if isinstance(q, six.text_type): q = q.encode(db.unicode_literal.charset) self._query(q) self.nextset() diff --git a/MySQLdb/release.py b/MySQLdb/release.py index 5c30a6c..1d5b067 100644 --- a/MySQLdb/release.py +++ b/MySQLdb/release.py @@ -1,4 +1,4 @@ __author__ = "Andy Dustman <farcepest@gmail.com>"
-version_info = (1,2,4,'final',1)
-__version__ = "1.2.4"
+version_info = (1,3,0,'alpha',1)
+__version__ = "1.3.0a1"
diff --git a/metadata.cfg b/metadata.cfg index 49841c1..f54c123 100644 --- a/metadata.cfg +++ b/metadata.cfg @@ -1,6 +1,7 @@ [metadata] -version: 1.2.4 -version_info: (1,2,4,'final',1) +version: 1.3.0a1 +version_info: (1,3,0,'alpha',1) +requires: six description: Python interface to MySQL long_description: ========================= @@ -14,8 +15,8 @@ long_description: - Thread-safety - Thread-friendliness (threads will not block each other) \n - MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently - supported. Python-3.0 will be supported in a future release. + MySQL-3.23 through 5.5 and Python-2.7 through 3.3 are currently + supported. For Python-2.7 and earlier support, use MySQLdb-1.2.4. PyPy is supported. \n MySQLdb is `Free Software`_. @@ -12,9 +12,9 @@ test_suite = nose.collector [bdist_rpm] doc_files = README MANIFEST doc/*.txt -vendor = MySQL-python SourceForge Project -packager = Andy Dustman <adustman@users.sourceforge.net> -distribution-name = Red Stains Linux +vendor = MySQLdb1 on GitHub +packager = Andy Dustman <farcepest@gmail.com> +distribution-name = Whatever You Want Linux requires = python -install-requires = distribute -build-requires = python-devel mysql-devel zlib-devel openssl-devel +install-requires = pip +build-requires = python-devel mysql-devel zlib-devel |