Browse Source

Disallow _private methods to be hooked

master
Chase Sterling 7 years ago
parent
commit
533e52945d
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      realms/lib/hook.py

+ 3
- 0
realms/lib/hook.py View File

@@ -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)


Loading…
Cancel
Save