From 51f4a1407ef12405e16f643f5f9d2002b4b52ab9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 2 Oct 2016 11:17:36 -0400 Subject: RF: use @functools.wraps within decorators instead of manual __name__ reassignment @wraps does more and does it right ;) --- git/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git/config.py') diff --git a/git/config.py b/git/config.py index ad6192ff..b342410c 100644 --- a/git/config.py +++ b/git/config.py @@ -17,6 +17,8 @@ import logging import abc import os +from functools import wraps + from git.odict import OrderedDict from git.util import LockFile from git.compat import ( @@ -67,11 +69,11 @@ class MetaParserBuilder(abc.ABCMeta): def needs_values(func): """Returns method assuring we read values (on demand) before we try to access them""" + @wraps(func) def assure_data_present(self, *args, **kwargs): self.read() return func(self, *args, **kwargs) # END wrapper method - assure_data_present.__name__ = func.__name__ return assure_data_present -- cgit v1.2.1