Skip to content

Commit 9ed51ce

Browse files
committed
Fix another missing import
1 parent 286b49d commit 9ed51ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugwise_usb/helpers/cache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from asyncio import get_running_loop
66
import logging
7-
from os import getenv as os_getenv, name as os_name
7+
from os import getenv as os_getenv, getpid as os_getpid, name as os_name
88
from os.path import expanduser as os_path_expand_user, join as os_path_join
99
from pathlib import Path
1010

@@ -110,7 +110,7 @@ async def write_cache(self, data: dict[str, str], rewrite: bool = False) -> None
110110
# Atomic write using aiofiles with temporary file
111111
cache_file_path = Path(self._cache_file)
112112
temp_path = cache_file_path.with_name(
113-
f".{cache_file_path.name}.tmp.{os.getpid()}"
113+
f".{cache_file_path.name}.tmp.{os_getpid()}"
114114
)
115115

116116
try:
@@ -124,7 +124,7 @@ async def write_cache(self, data: dict[str, str], rewrite: bool = False) -> None
124124
await temp_file.flush()
125125

126126
# Atomic rename
127-
if os.name == "nt" and cache_file_path.exists():
127+
if os_name == "nt" and cache_file_path.exists():
128128
cache_file_path.unlink()
129129

130130
temp_path.replace(cache_file_path)

0 commit comments

Comments
 (0)