change error format to be compatible with py < 3.10

This commit is contained in:
Glandos 2022-07-10 15:53:54 +02:00
parent 9341dc292e
commit ff08df043a

View file

@ -28,7 +28,7 @@ class CurrencyConverter(object, metaclass=Singleton):
rates = requests.get(self.api_url).json()["rates"] rates = requests.get(self.api_url).json()["rates"]
except Exception as e: except Exception as e:
warnings.warn( warnings.warn(
f"Call to {self.api_url} failed: {traceback.format_exception_only(e)[0].strip()}" f"Call to {self.api_url} failed: {traceback.format_exc(limit=0).strip()}"
) )
# In case of any exception, let's have an empty value # In case of any exception, let's have an empty value
rates = {} rates = {}