diff --git a/amazon_paapi/sdk/api_client.py b/amazon_paapi/sdk/api_client.py index e14223e..73bd001 100644 --- a/amazon_paapi/sdk/api_client.py +++ b/amazon_paapi/sdk/api_client.py @@ -88,7 +88,12 @@ def __init__(self, configuration = Configuration() self.configuration = configuration - self.pool = ThreadPool() + try: + self.pool = ThreadPool() + except: + # if multiprocessing is not available, we can't use the pool + self.pool = None + self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: @@ -103,8 +108,9 @@ def __init__(self, self.region = region def __del__(self): - self.pool.close() - self.pool.join() + if self.pool is not None: + self.pool.close() + self.pool.join() @property def user_agent(self):