From 0b5fe8e365995827964ff46b5d6b4f49dce90b10 Mon Sep 17 00:00:00 2001 From: Jurandy Soares Date: Mon, 23 May 2022 16:31:04 +0000 Subject: [PATCH] fix: generic code to test Callable --- storm/kommandr.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/storm/kommandr.py b/storm/kommandr.py index 71d9c13..245b2b2 100644 --- a/storm/kommandr.py +++ b/storm/kommandr.py @@ -13,7 +13,13 @@ from itertools import izip_longest except ImportError: from itertools import zip_longest as izip_longest -import collections + + +try: + from collections.abc import Callable +except ImportError: + from collections import Callable + import six @@ -95,7 +101,7 @@ def __init__(self, **kwargs): def command(self, *args, **kwargs): """Convenient decorator simply creates corresponding command""" - if len(args) == 1 and isinstance(args[0], collections.Callable): + if len(args) == 1 and isinstance(args[0], Callable): return self._generate_command(args[0]) else: def _command(func):