From 38ddc1ff21a8e81abccffd78d7bf780e523cb786 Mon Sep 17 00:00:00 2001 From: kat Date: Mon, 18 Jul 2022 00:38:34 -0400 Subject: Use inspect instead of hasattr --- python/scriptingprovider.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'python/scriptingprovider.py') diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index fe6b1467..e634eadc 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -577,8 +577,7 @@ def bninspect(code_, globals_, locals_): value = eval(code_, globals_, locals_) try: - if not hasattr(value, "__qualname__"): - # It was called on something that isn't a method type + if not (inspect.ismethod(value) or inspect.isclass(value)): if isinstance(code_, bytes): code_ = code_.decode("utf-8") class_type_str = code_.split(".")[:-1] -- cgit v1.3.1