Sometimes when I'm testing an ArcPy script and it ends with exception, ArcMap is still holding locks to some temp files (I run my scripts through ArcMap).
I cannot run the script any more, because it cannot delete/overwrite the temp files and in the end I have to restart ArcMap to release the locks.
Is there a way to do in a more clever fashion?
Best Answer
I've just come up with the following construction:
This way I don't loose any messages and so far all locks have been released properly.