From a8834dec1ec4d8602cd94bfb4e32fce236a471c9 Mon Sep 17 00:00:00 2001 From: Libbey Date: Sat, 19 Oct 2019 09:58:05 -0600 Subject: [PATCH] Add func call to Nesting a Decorator Within a Function (#192) 'Nesting a Decorator Within a Function' code does not ever actually call the func, so this commit adds execution and returns the wrapped function result when tagged with decorator. --- decorators.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/decorators.rst b/decorators.rst index 40f53ac..3389728 100644 --- a/decorators.rst +++ b/decorators.rst @@ -354,6 +354,7 @@ us specify a logfile to output to. with open(logfile, 'a') as opened_file: # Now we log to the specified logfile opened_file.write(log_string + '\n') + return func(*args, **kwargs) return wrapped_function return logging_decorator