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

Skip to content

Commit 6f61b26

Browse files
authored
Merge pull request #7833 from anntzer/deprecate-xmllint-verification
Deprecate unused verification code.
2 parents 86bf661 + cce8539 commit 6f61b26

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
import functools
121121
# cbook must import matplotlib only within function
122122
# definitions, so it is safe to import from it here.
123+
from . import cbook
123124
from matplotlib.cbook import (is_string_like,
124125
mplDeprecation,
125126
dedent, get_label,
@@ -438,6 +439,7 @@ def checkdep_inkscape():
438439
checkdep_inkscape.version = None
439440

440441

442+
@cbook.deprecated("2.1")
441443
def checkdep_xmllint():
442444
try:
443445
s = subprocess.Popen(['xmllint', '--version'], stdout=subprocess.PIPE,

lib/matplotlib/testing/compare.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ def convert(filename, cache):
216216
'xmllint', '--valid', '--nowarning', '--noout', filename]
217217

218218

219+
@cbook.deprecated("2.1")
219220
def verify(filename):
220221
"""Verify the file through some sort of verification tool."""
221222
if not os.path.exists(filename):
@@ -292,14 +293,10 @@ def compare_images(expected, actual, tol, in_decorator=False):
292293
293294
"""
294295
if not os.path.exists(actual):
295-
msg = "Output image %s does not exist." % actual
296-
raise Exception(msg)
296+
raise Exception("Output image %s does not exist." % actual)
297297

298298
if os.stat(actual).st_size == 0:
299-
msg = "Output image file %s is empty." % actual
300-
raise Exception(msg)
301-
302-
verify(actual)
299+
raise Exception("Output image file %s is empty." % actual)
303300

304301
# Convert the image to png
305302
extension = expected.split('.')[-1]

0 commit comments

Comments
 (0)