@@ -935,16 +935,17 @@ def print_figure(self, outfile, dpi=72,
935935 # need to make some temporary files so latex can run without
936936 # writing over something important.
937937 m = md5 .md5 (outfile )
938- tmpname = os .path .join (TexManager .texcache , m .hexdigest ())
939- os .environ ['TEXMFOUTPUT' ] = TexManager .texcache
938+ tmpname = m .hexdigest ()
940939
941940 epsfile = tmpname + '.eps'
942941 psfile = tmpname + '.ps'
943942 texfile = tmpname + '.tex'
944943 dvifile = tmpname + '.dvi'
945944 latexh = file (texfile , 'w' )
946945 fh = file (epsfile , 'w' )
947- else : fh = file (outfile , 'w' )
946+ else :
947+ fh = file (outfile , 'w' )
948+
948949 isEPSF = ext .lower ().startswith ('.ep' ) or rcParams ['text.usetex' ]
949950 needsClose = True
950951 title = outfile
@@ -1100,8 +1101,9 @@ def print_figure(self, outfile, dpi=72,
11001101 verbose .report ('' .join (stderr .readlines ()), 'helpful' )
11011102 shutil .move (epsfile , outfile )
11021103 else : shutil .move (psfile , outfile )
1103- cleanup = glob .glob (tmpname + '.*' )
1104- for fname in cleanup : os .remove (fname )
1104+
1105+ for fname in glob .glob (tmpname + '.*' ):
1106+ os .remove (fname )
11051107
11061108 if rcParams ['ps.usedistiller' ]:
11071109 dpi = rcParams ['ps.distiller.res' ]
0 commit comments