Skip to content

Commit 1ae51de

Browse files
committed
Fix type checking
1 parent 2d3b3e2 commit 1ae51de

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

vk_api/execute.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ def compile(self, args):
4141

4242
def __call__(self, vk, *args, **kwargs):
4343

44-
if type(vk) not in [VkApi, VkApiMethod]:
44+
if not isinstance(vk, (VkApi, VkApiMethod)):
4545
raise VkFunctionException(
46-
'The first arg should be VkApi or VkApiMethod instance')
46+
'The first arg should be VkApi or VkApiMethod instance'
47+
)
4748

48-
if type(vk) is VkApiMethod:
49+
if isinstance(vk, VkApiMethod):
4950
vk = vk._vk
5051

5152
args = parse_args(self.args, args, kwargs)

0 commit comments

Comments
 (0)