From ab33d81b307e78ddf0269628fa6385b81fffcdda Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Sun, 12 Apr 2026 16:39:51 -0400 Subject: [PATCH] catch syntax wanring when parsing version string --- hbd/common/proto.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hbd/common/proto.py b/hbd/common/proto.py index 82b7ee3..d847366 100644 --- a/hbd/common/proto.py +++ b/hbd/common/proto.py @@ -52,12 +52,17 @@ def decode_value(val: str) -> Any: except Exception: return val[1:] # Return as string without @ - # Try numeric evaluation (original behavior) + # Try numeric conversion (avoid eval to prevent SyntaxWarnings on version strings) if val[0].isdigit() or (val[0] == '-' and len(val) > 1 and val[1].isdigit()): try: - return eval(val) - except Exception: - return val + return int(val) + except ValueError: + pass + try: + return float(val) + except ValueError: + pass + return val return val