laforge submitted this change.
osmocom.utils: Return hexstr type form argparse helpers
Change-Id: Ide9f3c6b364d867f2dfc1b7dfda40dbab03c5130
---
M src/osmocom/utils.py
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/osmocom/utils.py b/src/osmocom/utils.py
index 6c91783..a218e1b 100644
--- a/src/osmocom/utils.py
+++ b/src/osmocom/utils.py
@@ -203,16 +203,16 @@
raise ValueError('Input must be [hexa]decimal')
if len(instr) & 1:
raise ValueError('Input has un-even number of hex digits')
- return instr
+ return hexstr(instr)
-def is_hexstr(instr: str) -> str:
+def is_hexstr(instr: str) -> hexstr:
"""Method that can be used as 'type' in argparse.add_argument() to validate the value consists of
an even sequence of hexadecimal digits only."""
if not all(c in string.hexdigits for c in instr):
raise ValueError('Input must be hexadecimal')
if len(instr) & 1:
raise ValueError('Input has un-even number of hex digits')
- return instr
+ return hexstr(instr)
def is_decimal(instr: str) -> str:
"""Method that can be used as 'type' in argparse.add_argument() to validate the value consists of
To view, visit change 38203. To unsubscribe, or for help writing mail filters, visit settings.