Merge remote-tracking branch 'origin/pr/148'

Conflicts:
	pymysql/connections.py
	pymysql/cursors.py
This commit is contained in:
INADA Naoki
2013-09-23 10:56:38 +09:00
5 changed files with 7 additions and 7 deletions

View File

@@ -548,7 +548,7 @@ class Connection(object):
def _config(key, default): def _config(key, default):
try: try:
return cfg.get(read_default_group,key) return cfg.get(read_default_group,key)
except: except Exception:
return default return default
user = _config("user",user) user = _config("user",user)

View File

@@ -55,7 +55,7 @@ class Cursor(object):
try: try:
while self.nextset(): while self.nextset():
pass pass
except: except Exception:
pass pass
self.connection = None self.connection = None
@@ -324,7 +324,7 @@ class SSCursor(Cursor):
try: try:
if self._has_next: if self._has_next:
while self.nextset(): pass while self.nextset(): pass
except: pass except Exception: pass
def _query(self, q): def _query(self, q):
conn = self._get_db() conn = self._get_db()

View File

@@ -3,7 +3,7 @@ import sys
try: try:
from pymysql.tests import base from pymysql.tests import base
import pymysql.cursors import pymysql.cursors
except: except Exception:
# For local testing from top-level directory, without installing # For local testing from top-level directory, without installing
sys.path.append('../pymysql') sys.path.append('../pymysql')
from pymysql.tests import base from pymysql.tests import base

View File

@@ -159,7 +159,7 @@ class TestNewIssues(base.PyMySQLTestCase):
self.fail() self.fail()
except pymysql.OperationalError as e: except pymysql.OperationalError as e:
self.assertEqual(2003, e.args[0]) self.assertEqual(2003, e.args[0])
except: except Exception:
self.fail() self.fail()
def test_issue_33(self): def test_issue_33(self):
@@ -202,7 +202,7 @@ class TestNewIssues(base.PyMySQLTestCase):
try: try:
c.execute("show tables") c.execute("show tables")
self.fail() self.fail()
except: except Exception:
pass pass
# check the process list from the other connection # check the process list from the other connection
try: try:

View File

@@ -52,7 +52,7 @@ class DatabaseTest(unittest.TestCase):
def table_exists(self, name): def table_exists(self, name):
try: try:
self.cursor.execute('select * from %s where 1=0' % name) self.cursor.execute('select * from %s where 1=0' % name)
except: except Exception:
return False return False
else: else:
return True return True