def getconn(self):
    'Generate thread id and return a connection.'
    key = self.__thread.get_ident()
    self._lock.acquire()
    try:
        return self._getconn(key)
    finally:
        self._lock.release()
Generate thread id and return a connection.
def getconn(self):
    
    key = self.__thread.get_ident()
    self._lock.acquire()
    try:
        return self._getconn(key)
    finally:
        self._lock.release()