Skip to content

Commit c3b4b33

Browse files
[coingecko] Fix crash on initial fetch
1 parent 6e785f3 commit c3b4b33

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

coingecko/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def finalize(self):
104104
self.thread.join()
105105

106106
def updateIndexItems(self):
107-
mtime = self.coinCacheFilePath.lstat().st_mtime
108-
if self.coinCacheFilePath.is_file() and mtime > self.mtime:
107+
if self.coinCacheFilePath.is_file() and (mtime := self.coinCacheFilePath.lstat().st_mtime) > self.mtime:
109108
self.mtime = mtime
110109
with open(self.coinCacheFilePath) as f:
111110
self.items.clear()

0 commit comments

Comments
 (0)