Dan Gass added the comment:
Sorry for not thinking of trying this sooner. Running garbage collection,
import gc; gc.collect(), releases the resources and restores the expected
reference counts.
>From my perspective, this is satisfactory and could justify closing this bug
>report.
New submission from Dan Gass :
Given
(1) instantiation of an enumeration class with an invalid value
(2) a try/except around the instantiation where the exception is ignored
Then:
An unneeded reference to the bad value is lost (as well as other values that I
suspect are local variables within