title: Decorator returns function object instead of output of wrapped function
body: <p>Apologies, I can only imagine that StackOverflow is full of people who are almost there, but still don't quite grasp decorators.</p>
  
  <p>I am trying to decorate a series of os-related functions so that if there are any exceptions such as FileNotFoundError or PermissionError, the user can fix the problem on their side and try again.</p>
  
  <p>So I've created this toy function and decorator, and I don't understand where I'm not following properly the example decorators I've been reading, and I'm having trouble reasoning my way through it:</p>
  
  <pre><code>from functools import wraps
  
  def continual_retry(func):
      def retry_decorated(*args, **kwargs):
          @wraps(func)
          def func_wrapper(*args, **kwargs):
              while not stop:
                  try:
                      func(*args)
                      stop = True
                  except Exception as e:
                      print(f'Could not perform function {func.__name__}')
                      print(f' with args {repr(args)}')
                      print(f' due to error {e.class__}')    
                      redo = input('Retry (y/n)? ')      
                      if redo.lower() != 'y':
                          print('Exiting program due to error and user input')
                          sys.exit(0)
          return func_wrapper
      return retry_decorated
  
  @continual_retry
  def divide(a, b):
      return a/b
  </code></pre>
  
  <p>When I run the function <code>divide</code>, this is the result:</p>
  
  <pre><code>&gt;&gt;&gt; divide(1, 2)
  &lt;function __main__.divide(a, b)&gt;
  </code></pre>
  
  <p>Where I was expecting a result of</p>
  
  <pre><code>0.5
  </code></pre>
  
  <p>(Then I was going to test <code>divide(1, 0)</code>)</p>