File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 3030# Redistribution and use is allowed according to the terms of the BSD license.
3131# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
3232
33- import PyQt4 .pyqtconfig
33+ try :
34+ import PyQt4 .pyqtconfig
35+ pyqtcfg = PyQt4 .pyqtconfig .Configuration ()
36+ except ImportError :
37+ import PyQt4 .QtCore
38+ import sipconfig # won't work for SIP v5
39+ import os .path
40+ cfg = sipconfig .Configuration ()
41+ sip_dir = cfg .default_sip_dir
42+ for p in (os .path .join (sip_dir , "PyQt4" ), sip_dir ):
43+ if os .path .exists (os .path .join (p , "QtCore" , "QtCoremod.sip" )):
44+ sip_dir = p
45+ break
46+ cfg = {
47+ 'pyqt_version' : PyQt4 .QtCore .PYQT_VERSION ,
48+ 'pyqt_version_str' : PyQt4 .QtCore .PYQT_VERSION_STR ,
49+ 'pyqt_sip_flags' : PyQt4 .QtCore .PYQT_CONFIGURATION ['sip_flags' ],
50+ 'pyqt_mod_dir' : cfg .default_mod_dir ,
51+ 'pyqt_sip_dir' : sip_dir ,
52+ 'pyqt_bin_dir' : cfg .default_bin_dir ,
53+ }
54+ pyqtcfg = sipconfig .Configuration ([cfg ])
3455
35- pyqtcfg = PyQt4 .pyqtconfig .Configuration ()
3656print ("pyqt_version:%06.0x" % pyqtcfg .pyqt_version )
3757print ("pyqt_version_num:%d" % pyqtcfg .pyqt_version )
3858print ("pyqt_version_str:%s" % pyqtcfg .pyqt_version_str )
You can’t perform that action at this time.
0 commit comments