Browse Source

Merge pull request #2962 from garenchan/dev

Cache return values to avoid repeated function calls.
pull/2964/merge
David Lord 6 years ago committed by GitHub
parent
commit
70b45094ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      flask/cli.py

5
flask/cli.py

@ -206,8 +206,9 @@ def prepare_import(path):
""" """
path = os.path.realpath(path) path = os.path.realpath(path)
if os.path.splitext(path)[1] == '.py': fname, ext = os.path.splitext(path)
path = os.path.splitext(path)[0] if ext == '.py':
path = fname
if os.path.basename(path) == '__init__': if os.path.basename(path) == '__init__':
path = os.path.dirname(path) path = os.path.dirname(path)

Loading…
Cancel
Save