I'm stuck on python2.4, so I can't use a finally clause with generators or yield
. Is there any way to work around this?
I can't find any mentions of how to work around this limitation in python 2.4, and I'm not a big fan of the workarounds I've thought of (mainly involving __del__
and trying to make sure it runs within a reasonable time) aren't very appealing.