diff --git a/src/bindings/python/flux/future.py b/src/bindings/python/flux/future.py index 446a2d6b7519..c1158741a71f 100644 --- a/src/bindings/python/flux/future.py +++ b/src/bindings/python/flux/future.py @@ -115,6 +115,9 @@ def then(self, callback, arg=None, timeout=-1.0): # For example `f.rpc('topic').then(cb).wait_for(-1) return self + def destroy(self): + self.pimpl.destroy() + def reset(self): self.pimpl.reset() diff --git a/src/bindings/python/flux/job.py b/src/bindings/python/flux/job.py index f3149b54e5d0..8c2a0bc3beb0 100644 --- a/src/bindings/python/flux/job.py +++ b/src/bindings/python/flux/job.py @@ -51,4 +51,6 @@ def submit_get_id(future): def submit(flux_handle, jobspec, priority=lib.FLUX_JOB_PRIORITY_DEFAULT, flags=0): future = submit_async(flux_handle, jobspec, priority, flags) - return submit_get_id(future) + jid = submit_get_id(future) + future.destroy() + return jid