Skip to content

Commit

Permalink
Merge branch 'dev' into fix-commonkeys-docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoLiu authored Feb 19, 2025
2 parents 0689dc8 + 960c59b commit ac54813
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions monai/utils/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ def version_leq(lhs: str, rhs: str) -> bool:
"""

lhs, rhs = str(lhs), str(rhs)
pkging, has_ver = optional_import("packaging.Version")
pkging, has_ver = optional_import("packaging.version")
if has_ver:
try:
return cast(bool, pkging.version.Version(lhs) <= pkging.version.Version(rhs))
except pkging.version.InvalidVersion:
return cast(bool, pkging.Version(lhs) <= pkging.Version(rhs))
except pkging.InvalidVersion:
return True

lhs_, rhs_ = parse_version_strs(lhs, rhs)
Expand All @@ -567,12 +567,12 @@ def version_geq(lhs: str, rhs: str) -> bool:
"""
lhs, rhs = str(lhs), str(rhs)
pkging, has_ver = optional_import("packaging.Version")
pkging, has_ver = optional_import("packaging.version")

if has_ver:
try:
return cast(bool, pkging.version.Version(lhs) >= pkging.version.Version(rhs))
except pkging.version.InvalidVersion:
return cast(bool, pkging.Version(lhs) >= pkging.Version(rhs))
except pkging.InvalidVersion:
return True

lhs_, rhs_ = parse_version_strs(lhs, rhs)
Expand Down

0 comments on commit ac54813

Please sign in to comment.