Disallow _private methods to be hooked

This commit is contained in:
Chase Sterling 2016-07-13 21:05:49 -04:00
부모 eafff2ae43
커밋 533e52945d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제

파일 보기

@ -27,6 +27,9 @@ class HookMixinMeta(type):
hookable = []
for key, value in attrs.items():
# Disallow hooking methods which start with an underscore (allow __init__ etc. still)
if key.startswith('_') and not key.startswith('__'):
continue
if callable(value):
attrs[key] = hook_func(key, value)
hookable.append(key)