diff -r aa713ac50c0d -r cc717c2ae956 eric6/WebBrowser/WebBrowserPage.py --- a/eric6/WebBrowser/WebBrowserPage.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/WebBrowser/WebBrowserPage.py Thu Apr 15 18:11:24 2021 +0200 @@ -92,13 +92,8 @@ self.fullScreenRequested.connect(self.__fullScreenRequested) self.urlChanged.connect(self.__urlChanged) self.contentsSizeChanged.connect(self.__contentsSizeChanged) - - try: - self.registerProtocolHandlerRequested.connect( - self.__registerProtocolHandlerRequested) - except AttributeError: - # defined for Qt >= 5.11 - pass + self.registerProtocolHandlerRequested.connect( + self.__registerProtocolHandlerRequested) self.__sslConfiguration = None @@ -578,29 +573,25 @@ ## Methods below implement protocol handler related functions ############################################################# - try: - @pyqtSlot("QWebEngineRegisterProtocolHandlerRequest") - def __registerProtocolHandlerRequested(self, request): - """ - Private slot to handle the registration of a custom protocol - handler. - - @param request reference to the registration request - @type QWebEngineRegisterProtocolHandlerRequest - """ - from PyQt5.QtWebEngineCore import ( - QWebEngineRegisterProtocolHandlerRequest - ) - - if self.__registerProtocolHandlerRequest: - del self.__registerProtocolHandlerRequest - self.__registerProtocolHandlerRequest = None - self.__registerProtocolHandlerRequest = ( - QWebEngineRegisterProtocolHandlerRequest(request) - ) - except TypeError: - # this is supported with Qt 5.12 and later - pass + @pyqtSlot("QWebEngineRegisterProtocolHandlerRequest") + def __registerProtocolHandlerRequested(self, request): + """ + Private slot to handle the registration of a custom protocol + handler. + + @param request reference to the registration request + @type QWebEngineRegisterProtocolHandlerRequest + """ + from PyQt5.QtWebEngineCore import ( + QWebEngineRegisterProtocolHandlerRequest + ) + + if self.__registerProtocolHandlerRequest: + del self.__registerProtocolHandlerRequest + self.__registerProtocolHandlerRequest = None + self.__registerProtocolHandlerRequest = ( + QWebEngineRegisterProtocolHandlerRequest(request) + ) def registerProtocolHandlerRequestUrl(self): """