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:
parent
86c6268d5c
commit
5b0986fe30
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue