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

Skip to content

[MRG+2] MAINT: Refactor the converted-image cache #7764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify gs and inkscape version checking logic
  • Loading branch information
jkseppan committed Feb 20, 2017
commit 0d51e03b702959ca9235eb200e76c08b18f685dd
16 changes: 6 additions & 10 deletions lib/matplotlib/testing/_conversion_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,12 @@ def __init__(self, directory=None, max_size=int(1e8)):
self.max_size = max_size
self.cached_ext = '.png'
self.converter_version = {}
try:
self.converter_version['.pdf'] = \
checkdep_ghostscript()[1].encode('utf-8')
except:
pass
try:
self.converter_version['.svg'] = \
checkdep_inkscape().encode('utf-8')
except:
pass
_, gs_version = checkdep_ghostscript()
if gs_version is not None:
self.converter_version['.pdf'] = gs_version.encode('utf-8')
is_version = checkdep_inkscape()
if is_version is not None:
self.converter_version['.svg'] = is_version.encode('utf-8')
self.hash_cache = {}

def get(self, filename, newname):
Expand Down