Skip to content

Commit 008a723

Browse files
author
Thinh Nguyen
committed
minor code cleanup
1 parent 291a468 commit 008a723

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

datajoint/autopopulate.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ def handler(signum, frame):
245245
else keys
246246
):
247247
status = self._populate1(key, jobs, **populate_kwargs)
248-
if status is not None:
249-
if isinstance(status, tuple):
250-
error_list.append(status)
251-
elif status:
252-
success_list.append(1)
248+
if status is True:
249+
success_list.append(1)
250+
elif isinstance(status, tuple):
251+
error_list.append(status)
252+
else:
253+
assert status is False
253254
else:
254255
# spawn multiple processes
255256
self.connection.close() # disconnect parent process from MySQL server
@@ -262,11 +263,12 @@ def handler(signum, frame):
262263
else contextlib.nullcontext()
263264
) as progress_bar:
264265
for status in pool.imap(_call_populate1, keys, chunksize=1):
265-
if status is not None:
266-
if isinstance(status, tuple):
267-
error_list.append(status)
268-
elif status:
269-
success_list.append(1)
266+
if status is True:
267+
success_list.append(1)
268+
elif isinstance(status, tuple):
269+
error_list.append(status)
270+
else:
271+
assert status is False
270272
if display_progress:
271273
progress_bar.update()
272274
self.connection.connect() # reconnect parent process to MySQL server

0 commit comments

Comments
 (0)