summaryrefslogtreecommitdiff
path: root/MySQLdb
diff options
context:
space:
mode:
authoradustman <adustman@9fc6cd9a-920d-0410-adcf-ac96716ed7e8>2012-09-08 17:28:34 +0000
committeradustman <adustman@9fc6cd9a-920d-0410-adcf-ac96716ed7e8>2012-09-08 17:28:34 +0000
commit3b3e11340ac971f5f88515fe3c8301dc1ea51241 (patch)
treefd923d91f9319ed348b4dcf6f93dbe50b8b7fbdb /MySQLdb
parentece1e0e08b28d63c64bb5ee9e5a70b50d75590c6 (diff)
downloadmysqldb1-3b3e11340ac971f5f88515fe3c8301dc1ea51241.tar.gz
Python 3 fixes. _mysql raises SystemError, segfaults
Diffstat (limited to 'MySQLdb')
-rw-r--r--MySQLdb/MySQLdb/__init__.py2
-rw-r--r--MySQLdb/tests/capabilities.py12
-rw-r--r--MySQLdb/tests/test_MySQLdb_capabilities.py3
3 files changed, 3 insertions, 14 deletions
diff --git a/MySQLdb/MySQLdb/__init__.py b/MySQLdb/MySQLdb/__init__.py
index 1ee2012..75092ad 100644
--- a/MySQLdb/MySQLdb/__init__.py
+++ b/MySQLdb/MySQLdb/__init__.py
@@ -14,7 +14,7 @@ MySQLdb.converters module.
"""
__revision__ = """$Revision$"""[11:-2]
-from release import __version__, version_info, __author__
+from MySQLdb.release import __version__, version_info, __author__
import _mysql
diff --git a/MySQLdb/tests/capabilities.py b/MySQLdb/tests/capabilities.py
index 2151a96..0b508fa 100644
--- a/MySQLdb/tests/capabilities.py
+++ b/MySQLdb/tests/capabilities.py
@@ -25,7 +25,7 @@ class DatabaseTest(unittest.TestCase):
self.connection = db
self.cursor = db.cursor()
self.BLOBText = ''.join([chr(i) for i in range(256)] * 100);
- self.BLOBUText = u''.join([unichr(i) for i in range(16384)])
+ self.BLOBUText = ''.join([unichr(i) for i in range(16384)])
self.BLOBBinary = self.db_module.Binary(''.join([chr(i) for i in range(256)] * 16))
leak_test = True
@@ -84,15 +84,11 @@ class DatabaseTest(unittest.TestCase):
','.join(['%s'] * len(columndefs))))
data = [ [ generator(i,j) for j in range(len(columndefs)) ]
for i in range(self.rows) ]
- if self.debug:
- print data
self.cursor.executemany(insert_statement, data)
self.connection.commit()
# verify
self.cursor.execute('select * from %s' % self.table)
l = self.cursor.fetchall()
- if self.debug:
- print l
self.assertEquals(len(l), self.rows)
try:
for i in range(self.rows):
@@ -147,8 +143,6 @@ class DatabaseTest(unittest.TestCase):
try:
self.cursor.execute(insert_statement, (0, '0'*256))
- except Warning:
- if self.debug: print self.cursor.messages
except self.connection.DataError:
pass
else:
@@ -162,8 +156,6 @@ class DatabaseTest(unittest.TestCase):
for j in range(len(columndefs)):
data.append(generator(i,j))
self.cursor.execute(insert_statement,tuple(data))
- except Warning:
- if self.debug: print self.cursor.messages
except self.connection.DataError:
pass
else:
@@ -175,8 +167,6 @@ class DatabaseTest(unittest.TestCase):
data = [ [ generator(i,j) for j in range(len(columndefs)) ]
for i in range(self.rows) ]
self.cursor.executemany(insert_statement, data)
- except Warning:
- if self.debug: print self.cursor.messages
except self.connection.DataError:
pass
else:
diff --git a/MySQLdb/tests/test_MySQLdb_capabilities.py b/MySQLdb/tests/test_MySQLdb_capabilities.py
index a2b9837..a42c95c 100644
--- a/MySQLdb/tests/test_MySQLdb_capabilities.py
+++ b/MySQLdb/tests/test_MySQLdb_capabilities.py
@@ -77,7 +77,7 @@ class test_MySQLdb(capabilities.DatabaseTest):
from MySQLdb.constants import ER
try:
self.cursor.execute("describe some_non_existent_table");
- except self.connection.ProgrammingError, msg:
+ except self.connection.ProgrammingError as msg:
self.assertTrue(msg[0] == ER.NO_SUCH_TABLE)
def test_bug_3514287(self):
@@ -101,4 +101,3 @@ if __name__ == '__main__':
gc.enable()
gc.set_debug(gc.DEBUG_LEAK)
unittest.main()
- print '''"Huh-huh, he said 'unit'." -- Butthead'''