forked from orbit-oss/flask
Corrected prefix detection
This commit is contained in:
parent
175d43b2f9
commit
e328eba97c
2 changed files with 5 additions and 3 deletions
|
|
@ -577,6 +577,8 @@ class Flask(_PackageBoundObject):
|
|||
parent, folder = os.path.split(site_parent)
|
||||
if folder.lower() == 'lib':
|
||||
base_dir = parent
|
||||
elif os.path.basename(parent).lower() == 'lib':
|
||||
base_dir = os.path.dirname(parent)
|
||||
else:
|
||||
base_dir = site_parent
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,7 @@ class InstanceTestCase(unittest.TestCase):
|
|||
import types
|
||||
expected_prefix = os.path.abspath('foo')
|
||||
mod = types.ModuleType('myapp')
|
||||
mod.__file__ = os.path.join(expected_prefix, 'lib',
|
||||
mod.__file__ = os.path.join(expected_prefix, 'lib', 'python2.5',
|
||||
'site-packages', 'myapp.py')
|
||||
sys.modules['myapp'] = mod
|
||||
try:
|
||||
|
|
@ -1046,7 +1046,7 @@ class InstanceTestCase(unittest.TestCase):
|
|||
def test_installed_package_paths(self):
|
||||
import types
|
||||
expected_prefix = os.path.abspath('foo')
|
||||
package_path = os.path.join(expected_prefix, 'lib',
|
||||
package_path = os.path.join(expected_prefix, 'lib', 'python2.5',
|
||||
'site-packages', 'myapp')
|
||||
mod = types.ModuleType('myapp')
|
||||
mod.__path__ = [package_path]
|
||||
|
|
@ -1063,7 +1063,7 @@ class InstanceTestCase(unittest.TestCase):
|
|||
def test_prefix_installed_paths(self):
|
||||
import types
|
||||
expected_prefix = os.path.abspath(sys.prefix)
|
||||
package_path = os.path.join(expected_prefix, 'lib',
|
||||
package_path = os.path.join(expected_prefix, 'lib', 'python2.5',
|
||||
'site-packages', 'myapp')
|
||||
mod = types.ModuleType('myapp')
|
||||
mod.__path__ = [package_path]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue