Browse Source

Fix function decorator

pull/3/head
Brett Langdon 7 years ago
parent
commit
40b612951c
No known key found for this signature in database GPG Key ID: B664881177781B04
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      importhook/__init__.py

+ 2
- 0
importhook/__init__.py View File

@ -68,8 +68,10 @@ def on_import(module_name, func=None):
importhook.on_import('httplib', on_httplib_import) importhook.on_import('httplib', on_httplib_import)
""" """
if func is None: if func is None:
@functools.wraps(func)
def decorator(func): def decorator(func):
registry[module_name] = func registry[module_name] = func
return func
return decorator return decorator
else: else:
registry[module_name] = func registry[module_name] = func


Loading…
Cancel
Save