Skip to content
Myr

Rename _get_package_path to get_root_path to avoid confusion

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent b3aaf6d · Browse files · 1 file+7 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−3 removed

  • other:+7 added−3 removed

1 file+7 added−3 removed

modified:flask/helpers.py+7 added-3 removed
464 unmodified lines
465 raise NotFound()466 return send_file(filename, conditional=True, **options)467468469def get_package_path(name):470 """Returns the path to a package or cwd if that cannot be found."""469def get_root_path(name):470 """Returns the path to a package or cwd if that cannot be found. This471 returns the path of a package or the folder that contains a module.472473 Not to be confused with the package path returned by :func:`find_package`.474 """475 try:476 return os.path.abspath(os.path.dirname(sys.modules[name].__file__))477 except (KeyError, AttributeError):478 return os.getcwd()
73 unmodified lines
552 #: exposed.553 self.template_folder = template_folder554555 #: Where is the app root located?552 self.root_path = get_package_path(self.import_name)556 self.root_path = get_root_path(self.import_name)557558 self._static_folder = None559 self._static_url_path = None560
73 unmodified lines