equal
deleted
inserted
replaced
672 subclass trick. |
672 subclass trick. |
673 """ |
673 """ |
674 assert callable(wrapper) |
674 assert callable(wrapper) |
675 |
675 |
676 if not isinstance(funcname, str): |
676 if not isinstance(funcname, str): |
677 msg = b"pass wrapfunction target name as `str`, not `bytes`" |
677 msg = b"wrapfunction target name should be `str`, not `bytes`" |
678 util.nouideprecwarn(msg, b"6.6", stacklevel=2) |
678 raise TypeError(msg) |
679 funcname = pycompat.sysstr(funcname) |
|
680 |
679 |
681 origfn = getattr(container, funcname) |
680 origfn = getattr(container, funcname) |
682 assert callable(origfn) |
681 assert callable(origfn) |
683 if inspect.ismodule(container): |
682 if inspect.ismodule(container): |
684 # origfn is not an instance or class method. "partial" can be used. |
683 # origfn is not an instance or class method. "partial" can be used. |