Skip to content

Commit c9ea211

Browse files
committed
Fixed an issue that resulted in errors on empty cachefiles, updated dependencies
1 parent d47e96b commit c9ea211

File tree

4 files changed

+945
-949
lines changed

4 files changed

+945
-949
lines changed

kernel_tuner/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,11 +1173,12 @@ def read_cache(cache, open_cache=True):
11731173
filestr = cachefile.read().strip()
11741174

11751175
# if file was not properly closed, pretend it was properly closed
1176-
if not filestr[-3:] == "}\n}":
1176+
if len(filestr) > 0 and not filestr[-3:] == "}\n}":
11771177
# remove the trailing comma if any, and append closing brackets
11781178
if filestr[-1] == ",":
11791179
filestr = filestr[:-1]
1180-
filestr = filestr + "}\n}"
1180+
if len(filestr) > 0:
1181+
filestr = filestr + "}\n}"
11811182
else:
11821183
if open_cache:
11831184
# if it was properly closed, open it for appending new entries

0 commit comments

Comments
 (0)