From d98d392aac860a98f71d7706291db7244e5d4ba4 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Mon, 7 Dec 2015 12:58:40 +0000 Subject: [PATCH] Try unbreak OSX build when Python installation doesn't live under PREFIX. In this case it is not safe to call ``strip_path_prefix()`` due to the assertion error it will raise. --- scripts/mk_util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index ca08c7804..acaff3b78 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -1340,8 +1340,13 @@ class PythonInstallComponent(Component): def __init__(self, name, libz3Component): assert isinstance(libz3Component, DLLComponent) Component.__init__(self, name, None, []) - self.pythonPkgDirWithoutPrefix = strip_path_prefix(PYTHON_PACKAGE_DIR, PREFIX) + self.pythonPkgDirWithoutPrefix = None self.libz3Component = libz3Component + if PYTHON_INSTALL_ENABLED: + # Only safe to call this if we know that PYTHON_PACKAGE_DIR lives under PREFIX. + # Other parts of the code enforce that this is the case when ``PYTHON_INSTALL_ENABLED`` + # is True. + self.pythonPkgDirWithoutPrefix = strip_path_prefix(PYTHON_PACKAGE_DIR, PREFIX) def main_component(self): return False