Skip to content

Commit b381928

Browse files
committed
mypy
1 parent 083f47d commit b381928

File tree

1 file changed

+10
-11
lines changed
  • services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules

1 file changed

+10
-11
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22
import logging
3-
import os
43
import sys
54
import time
65
from asyncio import CancelledError
@@ -47,22 +46,22 @@ class PortTypeName(str, Enum):
4746

4847
_logger = logging.getLogger(__name__)
4948

50-
# OUTPUTS section
5149

52-
53-
def _get_size_of_value(value: tuple[ItemConcreteValue | None, SetKWargs | None]) -> int:
54-
if value is None:
50+
def _get_size_of_value(
51+
value: tuple[ItemConcreteValue | None, SetKWargs | None],
52+
) -> int:
53+
concrete_value, _ = value
54+
if concrete_value is None:
5555
return 0
56-
if isinstance(value, Path):
56+
if isinstance(concrete_value, Path):
5757
# if symlink we need to fetch the pointer to the file
5858
# relative symlink need to know which their parent is
5959
# in oder to properly resolve the path since the workdir
6060
# does not equal to their parent dir
61-
path = value
62-
if value.is_symlink():
63-
path = Path(value.parent) / Path(os.readlink(value))
64-
size_bytes = path.stat().st_size
65-
return size_bytes
61+
path = concrete_value
62+
if concrete_value.is_symlink():
63+
path = Path(concrete_value.parent) / Path(Path.readlink(concrete_value))
64+
return path.stat().st_size
6665
return sys.getsizeof(value)
6766

6867

0 commit comments

Comments
 (0)