Skip to content

Commit 1025313

Browse files
authored
fixed #13699 - donate-cpu-server.py: fixed exception when trying to delete non-existent result (danmar#7374)
1 parent 817eca2 commit 1025313

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/donate-cpu-server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
2727
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
2828
# changes)
29-
SERVER_VERSION = "1.3.64"
29+
SERVER_VERSION = "1.3.65"
3030

3131
# TODO: fetch from GitHub tags
3232
OLD_VERSION = '2.17.0'
@@ -1449,7 +1449,8 @@ def server(server_address_port: int, packages: list, packageIndex: int, resultPa
14491449
filename = os.path.join(resultPath, res.group(1))
14501450
if truncated_data:
14511451
print_ts('Data is too large. Removing result.')
1452-
os.remove(filename)
1452+
if os.path.exists(filename):
1453+
os.remove(filename)
14531454
continue
14541455
with open(filename, 'wt') as f:
14551456
f.write(strDateTime() + '\n' + data)
@@ -1496,7 +1497,8 @@ def server(server_address_port: int, packages: list, packageIndex: int, resultPa
14961497
filename = info_path + '/' + res.group(1)
14971498
if truncated_data:
14981499
print_ts('Data is too large. Removing result.')
1499-
os.remove(filename)
1500+
if os.path.exists(filename):
1501+
os.remove(filename)
15001502
continue
15011503
with open(filename, 'wt') as f:
15021504
f.write(strDateTime() + '\n' + data)

0 commit comments

Comments
 (0)