Skip to content

Commit 94ada3b

Browse files
committed
issue2551025: try handling operational error exception in close #2
Looks like stdout reports: (2006, '') so try it. Also only run mysql tests w/o codecov tests to cut down on cycle time.
1 parent d0fd369 commit 94ada3b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ before_install:
8484
- cd $TRAVIS_BUILD_DIR
8585

8686
install:
87-
#test# - pip install mysqlclient==1.3.13
87+
#test# - pip install mysqlclient==1.3.13
8888
- pip install mysqlclient
8989
- pip install psycopg2
9090
- pip install gpg pytz whoosh pyjwt
@@ -108,7 +108,9 @@ before_script:
108108
script:
109109
- PATH=$VIRTUAL_ENV/bin:$PATH
110110
- export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH
111-
- py.test -v test/ --cov=roundup
111+
- py.test -v test/test_mysql.py
112+
#test# - py.test -v test/ --cov=roundup
113+
112114

113-
after_success:
114-
- codecov
115+
#test#after_success:
116+
#test# - codecov

roundup/backends/back_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def sql_close(self):
592592
# raised for closing a closed handle.
593593
except MySQLdb.OperationalError as message:
594594
print str(message)
595-
if str(message) != '':
595+
if str(message) != "(2006, '')": # close connection
596596
raise
597597
except MySQLdb.ProgrammingError as message:
598598
if str(message) != 'closing a closed connection':

0 commit comments

Comments
 (0)