Fix invalid exceptions w/ preview API
authorCampbell Barton <ideasman42@gmail.com>
Sat, 24 Oct 2015 05:20:26 +0000 (16:20 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 24 Oct 2015 06:50:20 +0000 (17:50 +1100)
D1575 by @januz

release/scripts/modules/bpy/utils/previews.py

index 965971139e48009fdebcfb95ace9608f7b9676eb..c67c523ea72e40d4bfd78bb45de21e71b97f60d6 100644 (file)
@@ -86,7 +86,7 @@ class ImagePreviewCollection(dict):
 
     def new(self, name):
         if name in self:
-            raise KeyException("key %r already exists")
+            raise KeyError("key %r already exists" % name)
         p = self[name] = _utils_previews.new(
                 self._gen_key(name))
         return p
@@ -94,7 +94,7 @@ class ImagePreviewCollection(dict):
 
     def load(self, name, path, path_type, force_reload=False):
         if name in self:
-            raise KeyException("key %r already exists")
+            raise KeyError("key %r already exists" % name)
         p = self[name] = _utils_previews.load(
                 self._gen_key(name), path, path_type, force_reload)
         return p