summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index f0b7266..450093a 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -383,8 +383,10 @@ def isfunction(object):
def _has_code_flag(f, flag):
"""Return true if ``f`` is a function (or a method or functools.partial
- wrapper wrapping a function) whose code object has the given ``flag``
+ wrapper wrapping a function or a functools.partialmethod wrapping a
+ function) whose code object has the given ``flag``
set in its flags."""
+ f = functools._unwrap_partialmethod(f)
while ismethod(f):
f = f.__func__
f = functools._unwrap_partial(f)
@@ -2561,7 +2563,7 @@ def _signature_from_callable(obj, *,
return sig
try:
- partialmethod = obj._partialmethod
+ partialmethod = obj.__partialmethod__
except AttributeError:
pass
else: