Skip to content

Commit 4317211

Browse files
committed
misc: flake8 fixes
1 parent 4250ac3 commit 4317211

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

devito/tools/abc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ def get_or_create(self, key: KeyType,
344344
obj = supplier()
345345

346346
# Listener for when the weak reference expires
347-
def on_obj_destroyed(k: KeyType = key, f: Future[ReferenceType[ValueType]] = future):
347+
def on_obj_destroyed(k: KeyType = key,
348+
f: Future[ReferenceType[ValueType]] = future) \
349+
-> None:
348350
with self._lock:
349351
if self._futures.get(k, None) is f:
350352
del self._futures[k]

tests/test_tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ def worker(key: int) -> CacheObject:
257257

258258
with ThreadPoolExecutor(max_workers=num_threads) as executor:
259259
start_time = time.perf_counter()
260-
results = list(executor.map(worker, (i % num_keys for i in range(num_threads))))
260+
results = list(executor.map(worker, (i % num_keys
261+
for i in range(num_threads))))
261262
duration = time.perf_counter() - start_time
262263

263264
# Ensure construction took a reasonable amount of time

0 commit comments

Comments
 (0)