Skip to content

Commit c2dfd5c

Browse files
committed
Merge remote-tracking branch 'upstream/v1.1.x' into merge-v1.1.x
Conflicts: CHANGELOG lib/matplotlib/dviread.py
2 parents 098d198 + 6a02337 commit c2dfd5c

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2011-12-27 Work around an EINTR bug in some versions of subprocess. - JKS
2+
13
2011-10-25 added support for \operatorname to mathtext,
24
including the ability to insert spaces, such as
35
$\operatorname{arg\,max}$ - PI

lib/matplotlib/dviread.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff 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?

setupext.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import os
4747
import re
4848
import subprocess
49-
from distutils import sysconfig, version
49+
from distutils import sysconfig
5050

5151
basedir = {
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' %

0 commit comments

Comments
 (0)