Is it possible to use the Python "with" statement with the ogr.open(file) function?
For example, I would like to do something like:
with ogr.open(file) as ds:
At the moment, I can only get the following to work:
try:
ds = ogr.open(file)
...
except:
del ds