aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-07-20 07:51:13 +0200
committerHarald Welte <laforge@osmocom.org>2022-07-20 19:35:58 +0200
commitea600a845183cfebfbedac6f8cf49b66bc329f72 (patch)
treea327f3df0978865e6686cd19f81c337330ddf605
parentfc8a9cca7b0245bc5bde655dcd6297fbc33bbf78 (diff)
tlv: Make NotImplementedError more verbose
This helps to understand immediately _what_ is not implemented for which type. Change-Id: I017eb4828e9deee80338024c41c93c0f78db3f3b
-rw-r--r--pySim/tlv.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pySim/tlv.py b/pySim/tlv.py
index 4de5046..5acc781 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -100,7 +100,7 @@ class Transcodable(abc.ABC):
# not an abstractmethod, as it is only required if no _construct exists
def _to_bytes(self):
- raise NotImplementedError
+ raise NotImplementedError('%s._to_bytes' % type(self).__name__)
def from_bytes(self, do: bytes):
"""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
def _from_bytes(self, do: bytes):
- raise NotImplementedError
+ raise NotImplementedError('%s._from_bytes' % type(self).__name__)
class IE(Transcodable, metaclass=TlvMeta):