From d60fce52315afc2606639f0d9f144788bd4916a0 Mon Sep 17 00:00:00 2001 From: Simon Prickett Date: Thu, 6 Jan 2022 21:10:53 +0000 Subject: [PATCH] Fixed check for presence of modules. --- aredis_om/checks.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/aredis_om/checks.py b/aredis_om/checks.py index 882c69d..a274f14 100644 --- a/aredis_om/checks.py +++ b/aredis_om/checks.py @@ -6,11 +6,8 @@ from aredis_om.connections import get_redis_connection @lru_cache(maxsize=None) async def check_for_command(conn, cmd): - try: - cmd_info = await conn.execute_command("command", "info", cmd) - return True - except TypeError: - return False + cmd_info = await conn.execute_command("command", "info", cmd) + return not None in cmd_info @lru_cache(maxsize=None) async def has_redis_json(conn=None):