File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed 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
+
1
3
2011-08-18 Change api of Axes.get_tightbbox and add an optional
2
4
keyword parameter *call_axes_locator*. - JJL
3
5
Original file line number Diff line number Diff line change @@ -835,23 +835,17 @@ def find_tex_file(filename, format=None):
835
835
836
836
matplotlib .verbose .report ('find_tex_file(%s): %s' \
837
837
% (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 )
839
844
result = pipe .communicate ()[0 ].rstrip ()
840
845
matplotlib .verbose .report ('find_tex_file result: %s' % result ,
841
846
'debug' )
842
847
return result
843
848
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
-
855
849
# With multiple text objects per figure (e.g. tick labels) we may end
856
850
# up reading the same tfm and vf files many times, so we implement a
857
851
# simple cache. TODO: is this worth making persistent?
You can’t perform that action at this time.
0 commit comments