Prevent AttributeError to be raised when pool is already None
Calling close() multiple times will not result into an error now.
MODIFY
urllib3/connectionpool.py
urllib3/connectionpool.py
@@ -411,6 +411,8 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
"""
Close all pooled connections and disable the pool.
"""
+ if self.pool is None:
+ return
# Disable access to the pool
old_pool, self.pool = self.pool, None

Prevent AttributeError to be raised when pool is already None

Calling close() multiple times will not result into an error now.