Skip to content

Commit 6110c7c

Browse files
committed
Get rid of xmllint and related verifier code.
1 parent 3903753 commit 6110c7c

File tree

2 files changed

+0
-50
lines changed

2 files changed

+0
-50
lines changed

lib/matplotlib/__init__.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -541,23 +541,6 @@ def checkdep_inkscape():
541541
checkdep_inkscape.version = None
542542

543543

544-
@cbook.deprecated("2.1")
545-
def checkdep_xmllint():
546-
try:
547-
s = subprocess.Popen([str('xmllint'), '--version'],
548-
stdout=subprocess.PIPE,
549-
stderr=subprocess.PIPE)
550-
stdout, stderr = s.communicate()
551-
lines = stderr.decode('ascii').split('\n')
552-
for line in lines:
553-
if 'version' in line:
554-
v = line.split()[-1]
555-
break
556-
return v
557-
except (IndexError, ValueError, UnboundLocalError, OSError):
558-
return None
559-
560-
561544
def checkdep_ps_distiller(s):
562545
if not s:
563546
return False

lib/matplotlib/testing/compare.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -316,39 +316,6 @@ def convert(filename, cache):
316316

317317
return newname
318318

319-
#: Maps file extensions to a function which takes a filename as its
320-
#: only argument to return a list suitable for execution with Popen.
321-
#: The purpose of this is so that the result file (with the given
322-
#: extension) can be verified with tools such as xmllint for svg.
323-
verifiers = {}
324-
325-
# Turning this off, because it seems to cause multiprocessing issues
326-
if False and matplotlib.checkdep_xmllint():
327-
verifiers['svg'] = lambda filename: [
328-
'xmllint', '--valid', '--nowarning', '--noout', filename]
329-
330-
331-
@cbook.deprecated("2.1")
332-
def verify(filename):
333-
"""Verify the file through some sort of verification tool."""
334-
if not os.path.exists(filename):
335-
raise IOError("'%s' does not exist" % filename)
336-
base, extension = filename.rsplit('.', 1)
337-
verifier = verifiers.get(extension, None)
338-
if verifier is not None:
339-
cmd = verifier(filename)
340-
pipe = subprocess.Popen(cmd, universal_newlines=True,
341-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
342-
stdout, stderr = pipe.communicate()
343-
errcode = pipe.wait()
344-
if errcode != 0:
345-
msg = "File verification command failed:\n%s\n" % ' '.join(cmd)
346-
if stdout:
347-
msg += "Standard output:\n%s\n" % stdout
348-
if stderr:
349-
msg += "Standard error:\n%s\n" % stderr
350-
raise IOError(msg)
351-
352319

353320
def crop_to_same(actual_path, actual_image, expected_path, expected_image):
354321
# clip the images to the same size -- this is useful only when

0 commit comments

Comments
 (0)