Skip to content

Commit 72174c2

Browse files
authored
Merge branch 'dev' into 8085-average-precision
2 parents 086446b + 960c59b commit 72174c2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

monai/utils/module.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,11 @@ def version_leq(lhs: str, rhs: str) -> bool:
540540
"""
541541

542542
lhs, rhs = str(lhs), str(rhs)
543-
pkging, has_ver = optional_import("packaging.Version")
543+
pkging, has_ver = optional_import("packaging.version")
544544
if has_ver:
545545
try:
546-
return cast(bool, pkging.version.Version(lhs) <= pkging.version.Version(rhs))
547-
except pkging.version.InvalidVersion:
546+
return cast(bool, pkging.Version(lhs) <= pkging.Version(rhs))
547+
except pkging.InvalidVersion:
548548
return True
549549

550550
lhs_, rhs_ = parse_version_strs(lhs, rhs)
@@ -567,12 +567,12 @@ def version_geq(lhs: str, rhs: str) -> bool:
567567
568568
"""
569569
lhs, rhs = str(lhs), str(rhs)
570-
pkging, has_ver = optional_import("packaging.Version")
570+
pkging, has_ver = optional_import("packaging.version")
571571

572572
if has_ver:
573573
try:
574-
return cast(bool, pkging.version.Version(lhs) >= pkging.version.Version(rhs))
575-
except pkging.version.InvalidVersion:
574+
return cast(bool, pkging.Version(lhs) >= pkging.Version(rhs))
575+
except pkging.InvalidVersion:
576576
return True
577577

578578
lhs_, rhs_ = parse_version_strs(lhs, rhs)

0 commit comments

Comments
 (0)