--- a/eric6/E5Gui/E5Led.py Thu Apr 08 17:27:12 2021 +0200 +++ b/eric6/E5Gui/E5Led.py Thu Apr 08 18:27:47 2021 +0200 @@ -50,16 +50,18 @@ """ Protected slot handling the paint event. - @param evt paint event object (QPaintEvent) + @param evt paint event object + @type QPaintEvent @exception TypeError The E5Led has an unsupported shape type. """ + if self.__shape not in (E5LedCircular, E5LedRectangular): + raise TypeError("Unsupported shape type for E5Led.") + if self.__shape == E5LedCircular: self.__paintRound() elif self.__shape == E5LedRectangular: self.__paintRectangular() - else: - raise TypeError("Unsupported shape type for E5Led.") - + def __getBestRoundSize(self): """ Private method to calculate the width of the LED.