From 7c9fc8dfbb8a9b9e72f078a5f598afa335ba3bd1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 21 Jun 2021 15:39:05 +0100 Subject: [PATCH] Simpler update of blocking cache --- blocking.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/blocking.py b/blocking.py index 364fc068c..72ce46958 100644 --- a/blocking.py +++ b/blocking.py @@ -186,9 +186,12 @@ def updateBlockedCache(baseDir: str, return blockedCacheLastUpdated with open(globalBlockingFilename, 'r') as fpBlocked: blockedLines = fpBlocked.readlines() + # remove newlines + for index in range(len(blockedLines)): + blockedLines[index] = blockedLines[index].replace('\n', '') + # update the cache blockedCache.clear() - for line in blockedLines: - blockedCache.append(line.replace('\n', '')) + blockedCache += blockedLines return currTime