#NEWLINE# def _get_conn( self , timeout = None ) : #NEWLINE# #INDENT# '\n        Get a connection. Will return a pooled connection if one is available.\n\n        If no connections are available and :prop:`.block` is ``False``, then a\n        fresh connection is returned.\n\n        :param timeout:\n            Seconds to wait before giving up and raising\n            :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and\n            :prop:`.block` is ``True``.\n        ' #NEWLINE# conn = None #NEWLINE# try : #NEWLINE# #INDENT# conn = self . pool . get ( block = self . block , timeout = timeout ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# raise ClosedPoolError ( self , 'Pool is closed.' ) #NEWLINE# #UNINDENT# except Empty : #NEWLINE# #INDENT# if self . block : #NEWLINE# #INDENT# raise EmptyPoolError ( self , 'Pool reached maximum size and no more connections are allowed.' ) #NEWLINE# #UNINDENT# pass #NEWLINE# #UNINDENT# if ( conn and is_connection_dropped ( self ) ) : #NEWLINE# #INDENT# log . info ( 'Resetting dropped connection: %s' , self . host ) #NEWLINE# conn . close ( ) #NEWLINE# if ( getattr ( conn , 'auto_open' , 1 ) == 0 ) : #NEWLINE# #INDENT# conn = None #NEWLINE# #UNINDENT# #UNINDENT# return ( conn or self . _new_conn ( ) )