Permalink
Browse files

Removes a vestigial try-except.

  • Loading branch information...
1 parent e0b7593 commit 780a87a3606655ffcd7f0830e819a0de45aa02f6 @BertrandBordage committed Sep 8, 2012
Showing with 9 additions and 14 deletions.
  1. +9 −14 terms/forms.py
View
@@ -6,21 +6,16 @@
from .settings import AVAILABLE_WIDGETS, TERMS_DEFINITION_WIDGET as WIDGET
from django.conf import settings
-# If WIDGET == 'auto': get the best widget one can import and ignore
-# ImportError if it is raised.
-# Otherwise: Get the specified widget and raises an error if not found.
-try:
- if WIDGET in AVAILABLE_WIDGETS[:2]:
- from django.forms import Textarea # 'basic'
- if WIDGET == AVAILABLE_WIDGETS[2] or (WIDGET == AVAILABLE_WIDGETS[0]
- and 'tinymce' in settings.INSTALLED_APPS):
- from tinymce.widgets import TinyMCE as Textarea # 'tinymce'
- if WIDGET == AVAILABLE_WIDGETS[3] or (WIDGET == AVAILABLE_WIDGETS[0]
+# If WIDGET == 'auto': get the best widget one can import.
+# Otherwise: Get the specified widget.
+if WIDGET in AVAILABLE_WIDGETS[:2]:
+ from django.forms import Textarea # 'basic'
+if WIDGET == AVAILABLE_WIDGETS[2] or (WIDGET == AVAILABLE_WIDGETS[0]
+ and 'tinymce' in settings.INSTALLED_APPS):
+ from tinymce.widgets import TinyMCE as Textarea # 'tinymce'
+if WIDGET == AVAILABLE_WIDGETS[3] or (WIDGET == AVAILABLE_WIDGETS[0]
and 'ckeditor' in settings.INSTALLED_APPS):
- from ckeditor.widgets import CKEditorWidget as Textarea # 'ckeditor'
-except ImportError as e:
- if WIDGET != AVAILABLE_WIDGETS[0]:
- raise e
+ from ckeditor.widgets import CKEditorWidget as Textarea # 'ckeditor'
class TermForm(ModelForm):

0 comments on commit 780a87a

Please sign in to comment.