@@ -37,7 +37,7 @@ class _ConversionCache(object):
3737 Parameters
3838 ----------
3939 directory : str, optional
40- Files are stored in this directory, defaults to `'test_cache'` in
40+ Files are stored in this directory. Defaults to `'test_cache'` in
4141 the overall Matplotlib cache directory.
4242 max_size : int, optional
4343 The flush method will delete files until their combined size is
@@ -54,7 +54,8 @@ def __init__(self, directory=None, max_size=int(1e8)):
5454 self .cachedir = self .get_cache_dir ()
5555 self .ensure_cache_dir ()
5656 if not isinstance (max_size , int ):
57- raise ValueError ("max_size is %s, expected int" % type (max_size ))
57+ raise ValueError ("max_size is of type %s, expected int" %
58+ type (max_size ))
5859 self .max_size = max_size
5960 self .cached_ext = '.png'
6061 self .converter_version = {}
@@ -120,7 +121,9 @@ def _get_file_hash(self, path, block_size=2 ** 20):
120121 if version_tag is None :
121122 warnings .warn (
122123 ("Don't know the external converter for files with extension "
123- "%s, cannot ensure cache invalidation on version update." )
124+ "%s, cannot ensure cache invalidation on version update. "
125+ "Either the relevant conversion program is missing or caching"
126+ " is attempted for an unknown file type." )
124127 % ext )
125128 result = self ._get_file_hash_static (path , block_size , version_tag )
126129 self .hash_cache [path ] = result
0 commit comments