Merge "(Mostly) revert "Cleanup session on delete""
This commit is contained in:
		| @@ -443,14 +443,16 @@ class HTTPConnection(object): | |||||||
|         if timeout: |         if timeout: | ||||||
|             self.requests_args['timeout'] = timeout |             self.requests_args['timeout'] = timeout | ||||||
|  |  | ||||||
|     def __del__(self): |     if not six.PY2: | ||||||
|         """Cleanup resources other than memory""" |         def __del__(self): | ||||||
|         if self.request_session: |             """Cleanup resources other than memory""" | ||||||
|             # The session we create must be closed to free up file descriptors |             if self.request_session: | ||||||
|             try: |                 # The session we create must be closed to free up | ||||||
|                 self.request_session.close() |                 # file descriptors | ||||||
|             finally: |                 try: | ||||||
|                 self.request_session = None |                     self.request_session.close() | ||||||
|  |                 finally: | ||||||
|  |                     self.request_session = None | ||||||
|  |  | ||||||
|     def _request(self, *arg, **kwarg): |     def _request(self, *arg, **kwarg): | ||||||
|         """Final wrapper before requests call, to be patched in tests""" |         """Final wrapper before requests call, to be patched in tests""" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zuul
					Zuul