--- a/eric6/E5Gui/E5TabWidget.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/E5Gui/E5TabWidget.py Thu Apr 15 18:11:24 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a TabWidget class substituting QTabWidget. """ +import contextlib + from PyQt5.QtCore import pyqtSignal, Qt, QPoint, QMimeData from PyQt5.QtGui import QDrag from PyQt5.QtWidgets import QTabWidget, QTabBar, QApplication, QStyle @@ -34,7 +36,7 @@ @param event reference to the wheel event (QWheelEvent) """ - try: + with contextlib.suppress(AttributeError): delta = event.angleDelta().y() if delta > 0: self._tabWidget.prevTab() @@ -42,8 +44,6 @@ self._tabWidget.nextTab() event.accept() - except AttributeError: - pass class E5DnDTabBar(E5WheelTabBar):