File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed
Expand file tree Collapse file tree 3 files changed +11
-15
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+
132011-10-25 added support for \operatorname to mathtext,
24 including the ability to insert spaces, such as
35 $\operatorname{arg\,max}$ - PI
Original file line number Diff line number Diff line change @@ -840,23 +840,17 @@ def find_tex_file(filename, format=None):
840840
841841 matplotlib .verbose .report ('find_tex_file(%s): %s' \
842842 % (filename ,cmd ), 'debug' )
843- pipe = subprocess .Popen (cmd , stdout = subprocess .PIPE )
843+ # stderr is unused, but reading it avoids a subprocess optimization
844+ # that breaks EINTR handling in some Python versions:
845+ # http://bugs.python.org/issue12493
846+ # https://github.com/matplotlib/matplotlib/issues/633
847+ pipe = subprocess .Popen (cmd , stdout = subprocess .PIPE ,
848+ stderr = subprocess .PIPE )
844849 result = pipe .communicate ()[0 ].rstrip ()
845850 matplotlib .verbose .report ('find_tex_file result: %s' % result ,
846851 'debug' )
847852 return result .decode ('ascii' )
848853
849- def _read_nointr (pipe , bufsize = - 1 ):
850- while True :
851- try :
852- return pipe .read (bufsize )
853- except OSError as e :
854- if e .errno == errno .EINTR :
855- continue
856- else :
857- raise
858-
859-
860854# With multiple text objects per figure (e.g. tick labels) we may end
861855# up reading the same tfm and vf files many times, so we implement a
862856# simple cache. TODO: is this worth making persistent?
Original file line number Diff line number Diff line change 4646import os
4747import re
4848import subprocess
49- from distutils import sysconfig , version
49+ from distutils import sysconfig
5050
5151basedir = {
5252 'win32' : ['win32_static' ,],
@@ -558,8 +558,8 @@ def check_for_numpy(min_version):
558558 min_version )
559559 return False
560560
561- expected_version = version . StrictVersion ( min_version )
562- found_version = version . StrictVersion ( numpy .__version__ )
561+ expected_version = min_version . split ( '.' )
562+ found_version = numpy .__version__ . split ( '.' )
563563 if not found_version >= expected_version :
564564 print_message (
565565 'numpy %s or later is required; you have %s' %
You can’t perform that action at this time.
0 commit comments