--- a/eric6/WebBrowser/FeaturePermissions/FeaturePermissionBar.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/WebBrowser/FeaturePermissions/FeaturePermissionBar.py Wed Apr 14 19:59:16 2021 +0200 @@ -7,6 +7,8 @@ Module implementing the feature permission bar widget. """ +import contextlib + from PyQt5.QtCore import pyqtSlot, QUrl from PyQt5.QtWidgets import QLabel, QHBoxLayout, QPushButton from PyQt5.QtWebEngineWidgets import QWebEnginePage @@ -120,11 +122,9 @@ self.__layout.addWidget(self.__denyButton) self.__layout.addWidget(self.__discardButton) - try: + with contextlib.suppress(KeyError): self.__iconLabel.setPixmap(UI.PixmapCache.getPixmap( self.__permissionFeatureIconNames[self.__feature])) - except KeyError: - pass try: self.__messageLabel.setText(