--- a/eric6/HexEdit/HexEditWidget.py Thu Apr 08 17:27:12 2021 +0200 +++ b/eric6/HexEdit/HexEditWidget.py Thu Apr 08 18:27:47 2021 +0200 @@ -460,16 +460,17 @@ @rtype bool @exception TypeError raised to indicate a wrong parameter type """ + if not isinstance(dataOrDevice, (bytearray, QByteArray, QIODevice)): + raise TypeError( + "setData: parameter must be bytearray, " + "QByteArray or QIODevice") + if isinstance(dataOrDevice, (bytearray, QByteArray)): self.__data = bytearray(dataOrDevice) self.__bData.setData(self.__data) return self.__setData(self.__bData) - elif isinstance(dataOrDevice, QIODevice): + else: return self.__setData(dataOrDevice) - else: - raise TypeError( - "setData: parameter must be bytearray, " - "QByteArray or QIODevice") def __setData(self, ioDevice): """