diff options
author | Michele Simionato <michele.simionato@gmail.com> | 2021-04-08 07:45:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 07:45:24 +0200 |
commit | 949e8e0dbc251f3aa30546761f5dc220822d6e7e (patch) | |
tree | c59244a6bb0d4c31a18e26242f95630e87aedc5f /src/decorator.py | |
parent | fb8a321d672848852d7706b3c40156771e568084 (diff) | |
parent | b2e77f281365007b756626372fb234c13f9426bb (diff) | |
download | python-decorator-git-949e8e0dbc251f3aa30546761f5dc220822d6e7e.tar.gz |
Merge pull request #113 from micheles/__module__
func.__module__ was not copied anymore
Diffstat (limited to 'src/decorator.py')
-rw-r--r-- | src/decorator.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/decorator.py b/src/decorator.py index aa406cb..deb93cd 100644 --- a/src/decorator.py +++ b/src/decorator.py @@ -40,7 +40,7 @@ import itertools from contextlib import _GeneratorContextManager from inspect import getfullargspec, iscoroutinefunction, isgeneratorfunction -__version__ = '5.0.5' +__version__ = '5.0.6' DEF = re.compile(r'\s*def\s*([_\w][_\w\d]*)\s*\(') POS = inspect.Parameter.POSITIONAL_OR_KEYWORD @@ -230,12 +230,14 @@ def decorate(func, caller, extras=(), kwsyntax=False): args, kw = fix(args, kw, sig) return caller(func, *(extras + args), **kw) fun.__name__ = func.__name__ + fun.__doc__ = func.__doc__ + fun.__defaults__ = func.__defaults__ + fun.__kwdefaults__ = func.__kwdefaults__ + fun.__annotations__ = func.__annotations__ + fun.__module__ = func.__module__ fun.__signature__ = sig fun.__wrapped__ = func fun.__qualname__ = func.__qualname__ - fun.__annotations__ = func.__annotations__ - fun.__kwdefaults__ = func.__kwdefaults__ - fun.__doc__ = func.__doc__ fun.__dict__.update(func.__dict__) return fun |