From ef980f1ef6cb76b9c6cf562326ab15d5402ff5ea Mon Sep 17 00:00:00 2001 From: Redume Date: Fri, 10 Jan 2025 00:18:15 +0300 Subject: [PATCH] fix: fixed the condition with getting currency from_currency --- functions/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/convert.py b/functions/convert.py index c6ed7ea..8d1931a 100644 --- a/functions/convert.py +++ b/functions/convert.py @@ -58,7 +58,7 @@ class Converter: for key in ['terms', 'privacy', 'timestamp']: data.pop(key, None) - if len(data.get('to')) == 0: + if not data.get('to'): raise RuntimeError('Failed to get the exchange rate from DuckDuckGo') conv = data.get('to')[0]