-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qt_loaders.py uses the removed imp module (Python 3.12) #1531
Comments
To support python 3.12 you should change the code in:_vendored/pydevd/_pydevd_bundle/pydevd_utils.py |
邮件已收到~~勿念
|
Until the PR gets merged I rewrote the def has_binding(api):
"""Safely check for PyQt4 or PySide, without importing
submodules
Parameters
----------
api : str [ 'pyqtv1' | 'pyqt' | 'pyside' | 'pyqtdefault']
Which module to check for
Returns
-------
True if the relevant module appears to be importable
"""
module_name_mapping = {
'pyqtv1': 'PyQt4',
'pyqt': 'PyQt4',
'pyside': 'PySide',
'pyqtdefault': 'PyQt4',
'pyqt5': 'PyQt5'
}
module_name = module_name_mapping.get(api)
if module_name is None:
return False
import importlib.util
try:
mod_spec = importlib.util.find_spec(module_name)
if mod_spec is None:
return False
mod = importlib.import_module(module_name)
submodules = ['QtCore', 'QtGui', 'QtSvg']
for submodule in submodules:
submodule_name = f"{module_name}.{submodule}"
submodule_spec = importlib.util.find_spec(submodule_name)
if submodule_spec is None:
return False
if api == 'pyside':
if hasattr(mod, '__version__'):
return check_version(mod.__version__, '1.0.3')
else:
return False
return True
except Exception as e:
print(f"An error occurred: {e}")
return False |
邮件已收到~~勿念
|
邮件已收到~~勿念
|
Environment data
Actual behavior
Pydevd runs into an exception when enabling matplotlib interactive mode for Qt5 backend.
Expected behavior
Interactive mode is turned on without printing a traceback.
Steps to reproduce:
matplotlib 3.8.3
,PyQt5 5.15.10
andsetuptools 69.1.1
The text was updated successfully, but these errors were encountered: