Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9a67b6

Browse files
committed
Get rid of xmllint and related verifier code.
1 parent c3ac4ec commit b9a67b6

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
@@ -440,23 +440,6 @@ def checkdep_inkscape():
440440
checkdep_inkscape.version = None
441441

442442

443-
@cbook.deprecated("2.1")
444-
def checkdep_xmllint():
445-
try:
446-
s = subprocess.Popen([str('xmllint'), '--version'],
447-
stdout=subprocess.PIPE,
448-
stderr=subprocess.PIPE)
449-
stdout, stderr = s.communicate()
450-
lines = stderr.decode('ascii').split('\n')
451-
for line in lines:
452-
if 'version' in line:
453-
v = line.split()[-1]
454-
break
455-
return v
456-
except (IndexError, ValueError, UnboundLocalError, OSError):
457-
return None
458-
459-
460443
def checkdep_ps_distiller(s):
461444
if not s:
462445
return False

lib/matplotlib/testing/compare.py

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

318318
return newname
319319

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

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

0 commit comments

Comments
 (0)