summaryrefslogtreecommitdiff
path: root/pygments/styles/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/styles/__init__.py')
-rw-r--r--pygments/styles/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pygments/styles/__init__.py b/pygments/styles/__init__.py
index 1b75dcbc..cd172adf 100644
--- a/pygments/styles/__init__.py
+++ b/pygments/styles/__init__.py
@@ -8,7 +8,9 @@
:copyright: 2006-2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
+
from pygments.plugin import find_plugin_styles
+from pygments.util import ClassNotFound
#: Maps style names to 'submodule::classname'.
@@ -45,12 +47,12 @@ def get_style_by_name(name):
try:
mod = __import__('pygments.styles.' + mod, None, None, [cls])
except ImportError:
- raise ValueError("Could not find style module %r" % mod +
+ raise ClassNotFound("Could not find style module %r" % mod +
(builtin and ", though it should be builtin") + ".")
try:
return getattr(mod, cls)
except AttributeError:
- raise ValueError("Could not find style class %r in style module." % cls)
+ raise ClassNotFound("Could not find style class %r in style module." % cls)
def get_all_styles():