python: Add a contextlib function
This function can be used alongside the "with" statement. Python will
close the handle automatically, even if the body throws an exception:
with nbd.nbd() as h:
# use handle here
Please register or sign in to comment