Commit to a particular API, and trigger ImportErrors on subsequent dangerous imports
(api)
| 58 | |
| 59 | |
| 60 | def commit_api(api): |
| 61 | """Commit to a particular API, and trigger ImportErrors on subsequent |
| 62 | dangerous imports""" |
| 63 | |
| 64 | if api == QT_API_PYSIDE: |
| 65 | ID.forbid("PyQt4") |
| 66 | ID.forbid("PyQt5") |
| 67 | ID.forbid("PyQt6") |
| 68 | else: |
| 69 | ID.forbid("PySide") |
| 70 | ID.forbid("PySide2") |
| 71 | ID.forbid("PySide6") |
| 72 | |
| 73 | |
| 74 | def loaded_api(): |