JGCRI / gcamreader

Python package for reading GCAM output databases
Other
4 stars 5 forks source link

Add try-finally in runQuery to ensure temporary file is deleted. #20

Closed rplzzz closed 3 years ago

rplzzz commented 4 years ago

In runQuery I've moved (almost) everything after the temp file is opened into a try block and moved the call to os.remove into the block's finally clause. That way, in the event of some kind of abnormal exit the temp file still gets deleted.