Fix version parsing NameError and older Python syntax compatibility (#6318)

* Fix undefined variable 'e' in Version parsing exception

* Fix SyntaxError for tuple unpacking in array index for Python < 3.11

---------

Co-authored-by: Lee Jackson <130007945+Imagineer99@users.noreply.github.com>
This commit is contained in:
UmranPros 2026-06-15 17:39:55 +05:30 committed by GitHub
commit 5b0986fe30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -49,7 +49,7 @@ def Version(version):
new_version = str(version)
new_version = re.match(r"[0-9\.]{1,}", new_version)
if new_version is None:
raise Exception(str(e))
raise ValueError(f"Could not parse version: {version}")
new_version = new_version.group(0).rstrip(".")
if new_version != version:
new_version += ".1" # Add .1 for dev / alpha / beta / rc

View file

@ -158,8 +158,8 @@ def assert_close(
)
bad_idxs = bad_idxs.unbind(-1)
print("ref values: ", ref[*bad_idxs].cpu())
print("tri values: ", tri[*bad_idxs].cpu())
print("ref values: ", ref[bad_idxs].cpu())
print("tri values: ", tri[bad_idxs].cpu())
assert max_err <= maxtol
assert rms_err <= rmstol