Skip to content
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
Improve wording
  • Loading branch information
jkseppan committed Feb 20, 2017
commit 9ea66ddf0f97ce30800c6c7081f2ac7d23e14f28
9 changes: 6 additions & 3 deletions lib/matplotlib/testing/_conversion_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _ConversionCache(object):
Parameters
----------
directory : str, optional
Files are stored in this directory, defaults to `'test_cache'` in
Files are stored in this directory. Defaults to `'test_cache'` in
the overall Matplotlib cache directory.
max_size : int, optional
The flush method will delete files until their combined size is
Expand All @@ -54,7 +54,8 @@ def __init__(self, directory=None, max_size=int(1e8)):
self.cachedir = self.get_cache_dir()
self.ensure_cache_dir()
if not isinstance(max_size, int):
raise ValueError("max_size is %s, expected int" % type(max_size))
raise ValueError("max_size is of type %s, expected int" %
type(max_size))
self.max_size = max_size
self.cached_ext = '.png'
self.converter_version = {}
Expand Down Expand Up @@ -120,7 +121,9 @@ def _get_file_hash(self, path, block_size=2 ** 20):
if version_tag is None:
warnings.warn(
("Don't know the external converter for files with extension "
"%s, cannot ensure cache invalidation on version update.")
"%s, cannot ensure cache invalidation on version update. "
"Either the relevant conversion program is missing or caching"
" is attempted for an unknown file type.")
% ext)
result = self._get_file_hash_static(path, block_size, version_tag)
self.hash_cache[path] = result
Expand Down