From 836ff14af53af54295d8ccd5fc6bdd6e83e599b4 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 19 Sep 2021 01:56:58 +0300 Subject: [PATCH] Fixes `misc/proper_plugin` crash on `isinstance(1)` (#11136) --- misc/proper_plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/proper_plugin.py b/misc/proper_plugin.py index c30999448387..25dfac131bf8 100644 --- a/misc/proper_plugin.py +++ b/misc/proper_plugin.py @@ -34,6 +34,9 @@ def get_function_hook(self, fullname: str def isinstance_proper_hook(ctx: FunctionContext) -> Type: + if len(ctx.arg_types) != 2 or not ctx.arg_types[1]: + return ctx.default_return_type + right = get_proper_type(ctx.arg_types[1][0]) for arg in ctx.arg_types[0]: if (is_improper_type(arg) or