Keep references to modules required in pgf LatexManager destructor#5249
Keep references to modules required in pgf LatexManager destructor#5249mdboom merged 1 commit intomatplotlib:masterfrom pwuertz:fix_5144
Conversation
|
I'm sure that's a solution but sure feels icky. Not that we shouldn't merge if we don't find anything better. Does putting inline imports in |
|
I remember a problem like this from another project, but I don't really remember what was the correct solution, reimport or holding on to a reference. I don't know or forgot how to provoke such errors though. Maybe one could also tweak LatexManager a bit so it doesn't involve |
|
Is this a case where |
|
The problem is specifically with As I initially reported, the problem that this patch deals with popped up in the project Sage. See http://trac.sagemath.org/ticket/14798 This ticket will be closed once any solution is merged to matplotlib. If other solution is suggested, then I can test it with Sage. Also the problem is not only with Windows. My Sage installation is on Mac. |
|
I am writing since I am wondering what would be done for this pull request, as I am ignorant of the general policies of matplotlib development. For this pull request to be accepted for a merge to the next release of matplotlib, should someone give a positive review or is this just up to the release manager? The solution in this pull request works though I am not completely satisfied with its method. So I would be happy if this pull request is accepted, unless someone proposes a better solution. |
|
Yeah -- we should probably hold our noses and merge as-is. 😉 |
Keep references to modules required in pgf LatexManager destructor
|
Backported to 1.5.x as a561593 |
Keep references to modules required in pgf LatexManager destructor
Alternative fix to issue described in #5144.
The
__del__method in LatexManager requires globals likeosandshutil, which may not be present anymore at the time the method is called. Keep local references to the required modules within the instance.