stendec/siding — pull request #1 by apt-shansen (2012-07-30 18:39:04+00:00)
Title: Keep references for __del__

During shutdown, module globals can be set to None *before* __del__ is called, so when using __del__ you need to explicitly keep references to those things you need for cleanup purposes.

Without this, I sometimes get "AttributeError: NoneType has no attribute 'name'" and the cleanup code doesn't get called, because its testing "if os.name == 'nt'". (This might just be a Python 2.7 issue: I don't remember when cleanup started explicitly setting globals to None)