summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorkat <katherine@vector35.com>2022-07-18 00:38:34 -0400
committercynder <KritantaDevelopment@gmail.com>2022-08-03 16:19:53 -0700
commit38ddc1ff21a8e81abccffd78d7bf780e523cb786 (patch)
treeebc8f26b18e877a87c19c054fbe7c2f043e08e2a /python
parent83ba14cbb835bed1fc04eb9b50cdd18ab2bb2176 (diff)
Use inspect instead of hasattr
Diffstat (limited to 'python')
-rw-r--r--python/scriptingprovider.py3
1 files changed, 1 insertions, 2 deletions
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]