qscintilla: coherence with py-sip (#32128)

This commit is contained in:
Olivier Cessenat 2022-08-21 20:32:10 +02:00 committed by GitHub
parent ab31256ee7
commit f7424e1fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,11 +152,12 @@ def make_qsci(self):
@run_after("install")
def extend_path_setup(self):
# See github issue #14121 and PR #15297
module = self.spec["py-sip"].variants["module"].value
if module != "sip":
module = module.split(".")[0]
with working_dir(python_platlib):
with open(os.path.join(module, "__init__.py"), "w") as f:
f.write("from pkgutil import extend_path\n")
f.write("__path__ = extend_path(__path__, __name__)\n")
if self.spec["py-sip"].satisfies("@:4"):
# See github issue #14121 and PR #15297
module = self.spec["py-sip"].variants["module"].value
if module != "sip":
module = module.split(".")[0]
with working_dir(python_platlib):
with open(os.path.join(module, "__init__.py"), "w") as f:
f.write("from pkgutil import extend_path\n")
f.write("__path__ = extend_path(__path__, __name__)\n")