mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-24 06:18:33 +03:00
tlv: Make NotImplementedError more verbose
This helps to understand immediately _what_ is not implemented for which type. Change-Id: I017eb4828e9deee80338024c41c93c0f78db3f3b
This commit is contained in:
@@ -100,7 +100,7 @@ class Transcodable(abc.ABC):
|
|||||||
|
|
||||||
# not an abstractmethod, as it is only required if no _construct exists
|
# not an abstractmethod, as it is only required if no _construct exists
|
||||||
def _to_bytes(self):
|
def _to_bytes(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError('%s._to_bytes' % type(self).__name__)
|
||||||
|
|
||||||
def from_bytes(self, do: bytes):
|
def from_bytes(self, do: bytes):
|
||||||
"""Convert from binary bytes to internal representation. Store the decoded result
|
"""Convert from binary bytes to internal representation. Store the decoded result
|
||||||
@@ -118,7 +118,7 @@ class Transcodable(abc.ABC):
|
|||||||
|
|
||||||
# not an abstractmethod, as it is only required if no _construct exists
|
# not an abstractmethod, as it is only required if no _construct exists
|
||||||
def _from_bytes(self, do: bytes):
|
def _from_bytes(self, do: bytes):
|
||||||
raise NotImplementedError
|
raise NotImplementedError('%s._from_bytes' % type(self).__name__)
|
||||||
|
|
||||||
|
|
||||||
class IE(Transcodable, metaclass=TlvMeta):
|
class IE(Transcodable, metaclass=TlvMeta):
|
||||||
|
|||||||
Reference in New Issue
Block a user