@@ -109,47 +109,6 @@ def loaded_api():
109109def has_binding (api ):
110110 """Safely check for PyQt4/5, PySide or PySide2, without importing submodules
111111
112- Supports Python <= 3.3
113-
114- Parameters
115- ----------
116- api : str [ 'pyqtv1' | 'pyqt' | 'pyqt5' | 'pyside' | 'pyside2' | 'pyqtdefault']
117- Which module to check for
118-
119- Returns
120- -------
121- True if the relevant module appears to be importable
122- """
123- # we can't import an incomplete pyside and pyqt4
124- # this will cause a crash in sip (#1431)
125- # check for complete presence before importing
126- module_name = api_to_module [api ]
127-
128- import imp
129- try :
130- #importing top level PyQt4/PySide module is ok...
131- mod = import_module (module_name )
132- #...importing submodules is not
133- imp .find_module ('QtCore' , mod .__path__ )
134- imp .find_module ('QtGui' , mod .__path__ )
135- imp .find_module ('QtSvg' , mod .__path__ )
136- if api in (QT_API_PYQT5 , QT_API_PYSIDE2 ):
137- # QT5 requires QtWidgets too
138- imp .find_module ('QtWidgets' , mod .__path__ )
139-
140- #we can also safely check PySide version
141- if api == QT_API_PYSIDE :
142- return check_version (mod .__version__ , '1.0.3' )
143- else :
144- return True
145- except ImportError :
146- return False
147-
148- def has_binding_new (api ):
149- """Safely check for PyQt4/5, PySide or PySide2, without importing submodules
150-
151- Supports Python >= 3.4
152-
153112 Parameters
154113 ----------
155114 api : str [ 'pyqtv1' | 'pyqt' | 'pyqt5' | 'pyside' | 'pyside2' | 'pyqtdefault']
@@ -185,8 +144,6 @@ def has_binding_new(api):
185144
186145 return True
187146
188- if sys .version_info >= (3 , 4 ):
189- has_binding = has_binding_new
190147
191148def qtapi_version ():
192149 """Return which QString API has been set, if any
0 commit comments