Skip to content

Commit df38261

Browse files
committed
Fixing imports
1 parent 967f4ad commit df38261

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

monai/utils/module.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
from typing import Any, Iterable, cast
3030
import torch
3131

32-
import importlib.metadata
33-
32+
## import importlib.metadata
33+
## from packaging import version
3434

3535
# bundle config system flags
3636
# set MONAI_EVAL_EXPR=1 to use 'eval', default value: run_eval=True
@@ -566,10 +566,10 @@ def version_leq(lhs: str, rhs: str) -> bool:
566566
"""
567567

568568
lhs, rhs = str(lhs), str(rhs)
569-
pkging, has_ver = optional_import("packaging")
569+
has_ver = optional_import("packaging")
570570
if has_ver:
571571
try:
572-
return cast(bool, pkging.version.Version(lhs) <= pkging.version.Version(rhs))
572+
return cast(bool, version(lhs) <= version(rhs))
573573
except version.InvalidVersion:
574574
return True
575575

@@ -593,10 +593,10 @@ def version_geq(lhs: str, rhs: str) -> bool:
593593
594594
"""
595595
lhs, rhs = str(lhs), str(rhs)
596-
pkging, has_ver = optional_import("packaging")
596+
has_ver = optional_import("packaging")
597597
if has_ver:
598598
try:
599-
return cast(bool, pkging.version.Version(lhs) >= pkging.version.Version(rhs))
599+
return cast(bool, version(lhs) >= version(rhs))
600600
except version.InvalidVersion:
601601
return True
602602

0 commit comments

Comments
 (0)