1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s4-python: Use sys.prefix rather than guessing prefix from current

file path.
This commit is contained in:
Jelmer Vernooij 2010-06-19 13:41:48 +02:00
parent bd1786f7f1
commit f36a9afc2f

View File

@ -64,14 +64,13 @@ __docformat__ = "restructuredText"
def find_setup_dir():
"""Find the setup directory used by provision."""
dirname = os.path.dirname(__file__)
if "/site-packages/" in dirname:
prefix = "/".join(dirname[:dirname.index("/site-packages/")].split("/")[:-2])
import sys
for suffix in ["share/setup", "share/samba/setup", "setup"]:
ret = os.path.join(prefix, suffix)
ret = os.path.join(sys.prefix, suffix)
if os.path.isdir(ret):
return ret
# In source tree
dirname = os.path.dirname(__file__)
ret = os.path.join(dirname, "../../../setup")
if os.path.isdir(ret):
return ret