File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 22{ {> partial_header} }
33from __future__ import absolute_import
44
5+ import logging
56import datetime
67import json
78import mimetypes
@@ -63,7 +64,10 @@ class ApiClient(object):
6364 configuration = Configuration()
6465 self.configuration = configuration
6566
66- self.pool = ThreadPool()
67+ try:
68+ self.pool = ThreadPool()
69+ except OSError:
70+ logging.warning('Looks like your system does not support ThreadPool but it will try without it if you do not use async requests')
6771 self.rest_client = rest.RESTClientObject(configuration)
6872 self.default_headers = { }
6973 if header_name is not None:
@@ -83,8 +87,9 @@ class ApiClient(object):
8387 )
8488
8589 def __del__(self):
86- self.pool.close()
87- self.pool.join()
90+ if hasattr(self, "pool"):
91+ self.pool.close()
92+ self.pool.join()
8893
8994 @property
9095 def user_agent(self):
You can’t perform that action at this time.
0 commit comments