diff options
| author | kat <katherine@vector35.com> | 2022-07-18 00:38:34 -0400 |
|---|---|---|
| committer | cynder <KritantaDevelopment@gmail.com> | 2022-08-03 16:19:53 -0700 |
| commit | 38ddc1ff21a8e81abccffd78d7bf780e523cb786 (patch) | |
| tree | ebc8f26b18e877a87c19c054fbe7c2f043e08e2a /python | |
| parent | 83ba14cbb835bed1fc04eb9b50cdd18ab2bb2176 (diff) | |
Use inspect instead of hasattr
Diffstat (limited to 'python')
| -rw-r--r-- | python/scriptingprovider.py | 3 |
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] |
