Fix an issue in to_node_num and add a bunch of tests to it as well

This commit is contained in:
Ian McEwen
2026-06-16 20:36:06 -07:00
parent db746a0981
commit 405a6bbc5d
2 changed files with 68 additions and 1 deletions

View File

@@ -728,7 +728,7 @@ def to_node_num(node_id: Union[int, str]) -> int:
return node_id
s = str(node_id).strip()
if s.startswith("!"):
s = s[1:]
s = "0x" + s[1:]
if s.lower().startswith("0x"):
return int(s, 16)
try: