R. David Murray added the comment:
Yes, well, that is part of the fragility of python2's shutdown garbage
collection, and one of the reasons it got improved. Changing the name of a
function can change the order things get retrieved from various internal
dictionaries, because they are hash
R. David Murray added the comment:
Yes, python2 shutdown has this problem: modules and their attributes are set to
None during interpreter shutdown. Things are much better in python3. If you
want to avoid the error messages, finalize the objects explicitly (making sure
to break gc cycles)
R. David Murray added the comment:
Best practice, by the way, is to be explicit about the scope of any resource
and clean it up before program end...this is often done by using the context
manager protocol.
--
___
Python tracker
New submission from terry:
The attached code generates this output:
init called
finished init
init called
finished init
init called
finished init
initPorts done
alldone
destroying /sys/class/gpio/gpio16/
destroying /sys/class/gpio/gpio6/
Exception AttributeError: "'NoneType' object has no
python.org>
> <http://bugs.python.org/issue25619>
> _______
--
title: Exception AttributeError: "'NoneType' thrown on exit -> Exception
AttributeError: "'NoneType' thrown on exit
__