Skip to content

Commit 49a9dcd

Browse files
Merge pull request #69 from python-thread/fix/enforce-nonempty-dataset
Fix: enforce nonempty dataset
2 parents 8cef28a + 4175792 commit 49a9dcd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/thread/thread.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,11 @@ def __init__(
368368
369369
Raises
370370
------
371+
AssertionError: invalid `dataset`
371372
AssertionError: invalid `max_threads`
372373
"""
373-
assert 0 <= max_threads, 'Cannot run a thread pool with max threads set to 0'
374+
assert len(dataset) > 0, 'dataset cannot be empty'
375+
assert 0 <= max_threads, 'max_threads cannot be set to 0'
374376

375377
self._threads = []
376378
self._completed = 0

0 commit comments

Comments
 (0)