title: Decorator Function makes data reading return nonetype
body: <p>I've written a pretty simple <code>timetaken()</code> decorator function which naturally measures how long it takes for a function to run:</p>
  <pre><code>def timetaken(func):
    def wrapper(*args, **kwargs):
      before = time.time()
      func(*args, **kwargs)
      print(f&quot;Function took {time.time() - before} seconds&quot;)
    return wrapper
  </code></pre>
  <p>I run a test of it on a function that reads in data shown below:</p>
  <pre><code>@timetaken
  def ingest(filename):
    if filename.endswith(&quot;.csv&quot;) and searcher('winequality-red.csv', ',') == True:
      df = pd.read_csv(filename)
    elif filename.endswith('.csv') and \
          searcher('winequality-red.csv', ';') == True:
      df = pd.read_csv(filename, sep = &quot;;&quot;)
    elif filename.endswith(&quot;.xlsx&quot;) or filename.endswith(&quot;.xlx&quot;):
      df = pd.read_excel(filename)
    elif filename.endswith('.com') or filename.endswith('.html'):
      df = pd.read_html(filename)
    elif filename.endswith('.txt'):
      df = pd.read_txt(filename)
    else:
      print('File could not be read!')
      return -1
    return df
  </code></pre>
  <p>The <code>searcher()</code> function, simply locates string characters in a file.</p>
  <p>Anyway, when I remove the decorator, the function works as expected and returns a pandas Dataframe object. However, with the decorator, it simply returns <code>NoneType</code>. Does anyone know why this may be? Thanks.</p>