File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 2011-12-27 Work around an EINTR bug in some versions of subprocess. - JKS
2+
132011-08-18 Change api of Axes.get_tightbbox and add an optional
24 keyword parameter *call_axes_locator*. - JJL
35
Original file line number Diff line number Diff line change @@ -835,23 +835,17 @@ def find_tex_file(filename, format=None):
835835
836836 matplotlib .verbose .report ('find_tex_file(%s): %s' \
837837 % (filename ,cmd ), 'debug' )
838- pipe = subprocess .Popen (cmd , stdout = subprocess .PIPE )
838+ # stderr is unused, but reading it avoids a subprocess optimization
839+ # that breaks EINTR handling in some Python versions:
840+ # http://bugs.python.org/issue12493
841+ # https://github.com/matplotlib/matplotlib/issues/633
842+ pipe = subprocess .Popen (cmd , stdout = subprocess .PIPE ,
843+ stderr = subprocess .PIPE )
839844 result = pipe .communicate ()[0 ].rstrip ()
840845 matplotlib .verbose .report ('find_tex_file result: %s' % result ,
841846 'debug' )
842847 return result
843848
844- def _read_nointr (pipe , bufsize = - 1 ):
845- while True :
846- try :
847- return pipe .read (bufsize )
848- except OSError , e :
849- if e .errno == errno .EINTR :
850- continue
851- else :
852- raise
853-
854-
855849# With multiple text objects per figure (e.g. tick labels) we may end
856850# up reading the same tfm and vf files many times, so we implement a
857851# simple cache. TODO: is this worth making persistent?
You can’t perform that action at this time.
0 commit comments