diff --git a/python/tank/util/qt_importer.py b/python/tank/util/qt_importer.py index 90785e0b65..0284f02e8e 100644 --- a/python/tank/util/qt_importer.py +++ b/python/tank/util/qt_importer.py @@ -50,40 +50,42 @@ def __init__(self, interface_version_requested=QT4): self._qt_version_tuple, ) = self._import_modules(interface_version_requested) + self._modules = self._modules or {} + @property def QtCore(self): """ :returns: QtCore module, if available. """ - return self._modules["QtCore"] if self._modules else None + return self._modules.get("QtCore") @property def QtGui(self): """ :returns: QtGui module, if available. """ - return self._modules["QtGui"] if self._modules else None + return self._modules.get("QtGui") @property def QtWebKit(self): """ :returns: QtWebKit module, if available. """ - return self._modules["QtWebKit"] if self._modules else None + return self._modules.get("QtWebKit") @property def QtNetwork(self): """ :returns: QtNetwork module, if available. """ - return self._modules["QtNetwork"] if self._modules else None + return self._modules.get("QtNetwork") @property def QtWebEngineWidgets(self): """ :returns: QtWebEngineWidgets module, if available. """ - return self._modules["QtWebEngineWidgets"] if self._modules else None + return self._modules.get("QtWebEngineWidgets") @property def binding(self):