eric7/HexEdit/HexEditWidget.py

branch
eric7
changeset 9162
8b75b1668583
parent 8881
54e42bc2437a
child 9171
fd2218f08066
--- a/eric7/HexEdit/HexEditWidget.py	Mon Jun 20 13:25:14 2022 +0200
+++ b/eric7/HexEdit/HexEditWidget.py	Mon Jun 20 19:47:39 2022 +0200
@@ -414,17 +414,18 @@
         Public method to set the data to show.
         
         @param dataOrDevice byte array or device containing the data
-        @type bytearray, QByteArray or QIODevice
+        @type bytes, bytearray, QByteArray or QIODevice
         @return flag indicating success
         @rtype bool
         @exception TypeError raised to indicate a wrong parameter type
         """
-        if not isinstance(dataOrDevice, (bytearray, QByteArray, QIODevice)):
+        if not isinstance(dataOrDevice, (bytes,  bytearray, QByteArray,
+                                         QIODevice)):
             raise TypeError(
-                "setData: parameter must be bytearray, "
+                "setData: parameter must be bytes, bytearray, "
                 "QByteArray or QIODevice")
         
-        if isinstance(dataOrDevice, (bytearray, QByteArray)):
+        if isinstance(dataOrDevice, (bytes, bytearray, QByteArray)):
             self.__data = bytearray(dataOrDevice)
             self.__bData.setData(self.__data)
             return self.__setData(self.__bData)

eric ide

mercurial