Skip to content

Commit 29548bc

Browse files
committed
Use finally in run_bulk_job
While there is separate handling for `except` and `else` of a `try` block, they don't seem to be doing anything significantly different. So just use a `finally` statement instead and drop `except` and `else`.
1 parent 90ed24b commit 29548bc

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drmaa/helpers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@ 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:
292-
drmaa_release_job_ids(jids.contents)
293-
raise
294-
else:
291+
finally:
295292
drmaa_release_job_ids(jids.contents)
296293

297294

0 commit comments

Comments
 (0)