Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

fix bug:AttributeError: 'Connection' object has no attribute 'socket' #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wukaka
Copy link

@wukaka wukaka commented Mar 24, 2017

the bug has happened in Python (3.6.0) & PyMySQL (0.7.10)

@@ -184,7 +184,7 @@ class MySQLdbAPI(DBAPI):
class PyMySQLAPI(DBAPI):

def conn_is_open(self, conn):
return conn and conn.socket and conn._rfile
return conn and conn._sock and conn._rfile
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getattr(conn, 'socket', getattr(conn, '_sock'))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants