Skip to content
Permalink
Browse files

fail if sipbuild is found, but not sip5

  • Loading branch information
jef-n committed Nov 7, 2020
1 parent 410243d commit 7c458a969454cc9f90b8e636501cdff96183f846
Showing with 14 additions and 11 deletions.
  1. +14 −11 cmake/FindSIP.py
@@ -32,6 +32,20 @@

try:
import sipbuild

print("sip_version:%06.0x" % sipbuild.version.SIP_VERSION)
print("sip_version_num:%d" % sipbuild.version.SIP_VERSION)
print("sip_version_str:%s" % sipbuild.version.SIP_VERSION_STR)

import shutil
sip_bin = shutil.which("sip5")
if sip_bin is None:
raise ImportError("sipbuild found, but not sip5")
print("sip_bin:%s" % sip_bin)

from distutils.sysconfig import get_python_lib
python_modules_dir = get_python_lib(plat_specific=1)
print("default_sip_dir:%s" % python_modules_dir)
except ImportError: # Code for SIP v4
import sipconfig

@@ -47,14 +61,3 @@
print("sip_module_dir:%s" % sipcfg.sip_module_dir)
else:
print("sip_module_dir:%s" % sipcfg.sip_mod_dir)
else: # Code for SIP v5
print("sip_version:%06.0x" % sipbuild.version.SIP_VERSION)
print("sip_version_num:%d" % sipbuild.version.SIP_VERSION)
print("sip_version_str:%s" % sipbuild.version.SIP_VERSION_STR)

import shutil
print("sip_bin:%s" % shutil.which("sip5"))

from distutils.sysconfig import get_python_lib
python_modules_dir = get_python_lib(plat_specific=1)
print("default_sip_dir:%s" % python_modules_dir)

0 comments on commit 7c458a9

Please sign in to comment.
You can’t perform that action at this time.