Skip to content
Myr

Corrected prefix detection

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 175d43b · Browse files · 2 files+5 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

2 files+5 added−3 removed

  • tests:+3 added−3 removed
  • other:+2 added−0 removed

2 files+5 added−3 removed

modified:flask/app.py+2 added
575 unmodified lines
576 elif site_folder == 'site-packages':577 parent, folder = os.path.split(site_parent)578 if folder.lower() == 'lib':579 base_dir = parent580 elif os.path.basename(parent).lower() == 'lib':581 base_dir = os.path.dirname(parent)582 else:583 base_dir = site_parent584 else:585 return os.path.join(package_path, 'instance')
969 unmodified lines
modified:tests/flask_tests.py+3 added-3 removed
1030 unmodified lines
1031 def test_installed_module_paths(self):1032 import types1033 expected_prefix = os.path.abspath('foo')1034 mod = types.ModuleType('myapp')1035 mod.__file__ = os.path.join(expected_prefix, 'lib',1035 mod.__file__ = os.path.join(expected_prefix, 'lib', 'python2.5',1036 'site-packages', 'myapp.py')1037 sys.modules['myapp'] = mod1038 try:1039 mod.app = flask.Flask(mod.__name__)
5 unmodified lines
10451046 def test_installed_package_paths(self):1047 import types1048 expected_prefix = os.path.abspath('foo')1049 package_path = os.path.join(expected_prefix, 'lib',1049 package_path = os.path.join(expected_prefix, 'lib', 'python2.5',1050 'site-packages', 'myapp')1051 mod = types.ModuleType('myapp')1052 mod.__path__ = [package_path]1053 mod.__file__ = os.path.join(package_path, '__init__.py')
8 unmodified lines
10621063 def test_prefix_installed_paths(self):1064 import types1065 expected_prefix = os.path.abspath(sys.prefix)1066 package_path = os.path.join(expected_prefix, 'lib',1066 package_path = os.path.join(expected_prefix, 'lib', 'python2.5',1067 'site-packages', 'myapp')1068 mod = types.ModuleType('myapp')1069 mod.__path__ = [package_path]1070 mod.__file__ = os.path.join(package_path, '__init__.py')
1112 unmodified lines