Skip to content

Commit 459c6ca

Browse files
committed
Catch StopIteration in run_bulk_job
As `run_bulk_job` can sometimes raise a `StopIteration` and this is deprecated behavior, catch and squash this exception. Thus avoiding the deprecated behavior. As this still breaks the loop and ends the generator, this has no real effect on how this generator behaves.
1 parent 29548bc commit 459c6ca

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drmaa/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ def run_bulk_job(jt, start, end, incr=1):
288288
while drmaa_get_next_job_id(jids.contents, jid,
289289
_BUFLEN) != NO_MORE_ELEMENTS:
290290
yield jid.value.decode()
291+
except StopIteration:
292+
pass
291293
finally:
292294
drmaa_release_job_ids(jids.contents)
293295

0 commit comments

Comments
 (0)