|
From: Mark J. <mja...@es...> - 2014-10-08 23:16:36
|
Hi All,
I am working on a platform that makes it difficult to provide repro cases... but I am hoping someone can shed some light on what I am seeing... Essentially, I have a program imports another script that* import matplotlib.pyplot as PLT... when it runs more than once then I get the following traceback:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "C:\Python27\lib\site-packages\matplotlib\_pylab_helpers.py", line 87, in
destroy_all
for manager in list(Gcf.figs.values()):
AttributeError: 'NoneType' object has no attribute 'figs'
Error in sys.exitfunc:
Traceback (most recent call last):
File "C:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "C:\Python27\lib\site-packages\matplotlib\_pylab_helpers.py", line 87, in
destroy_all
for manager in list(Gcf.figs.values()):
AttributeError: 'NoneType' object has no attribute 'figs'
This occurs because in this case the PLT functionality is NOT being used on the main script. If I edit the _pylab_helpers.py file and check to see if Gcf is None... if it is NOT then do the "destroy_all" logic... else it passes [code change below]... then the error disappears. I can make it disappear for many cases by creating a "dummy" figure so that Gcf gets created and therefore has some garbage to collect.
Any information you can give me would be greatly appreciated. TY,
MJ
[cid:image001.png@01CFE248.0F0A2700]
|