MCPcopy Create free account
hub / github.com/ipython/ipython / commit_api

Function commit_api

IPython/external/qt_loaders.py:63–82  ·  view source on GitHub ↗

Commit to a particular API, and trigger ImportErrors on subsequent dangerous imports

(api)

Source from the content-addressed store, hash-verified

61
62
63def commit_api(api):
64 """Commit to a particular API, and trigger ImportErrors on subsequent
65 dangerous imports"""
66
67 if api == QT_API_PYSIDE2:
68 ID.forbid('PySide')
69 ID.forbid('PyQt4')
70 ID.forbid('PyQt5')
71 elif api == QT_API_PYSIDE:
72 ID.forbid('PySide2')
73 ID.forbid('PyQt4')
74 ID.forbid('PyQt5')
75 elif api == QT_API_PYQT5:
76 ID.forbid('PySide2')
77 ID.forbid('PySide')
78 ID.forbid('PyQt4')
79 else: # There are three other possibilities, all representing PyQt4
80 ID.forbid('PyQt5')
81 ID.forbid('PySide2')
82 ID.forbid('PySide')
83
84
85def loaded_api():

Callers 1

load_qtFunction · 0.85

Calls 1

forbidMethod · 0.80

Tested by

no test coverage detected