Removed unused imports. Raise ImportError when import fails.

svn path=/plone.app.discussion/trunk/; revision=39571
This commit is contained in:
Timo Stollenwerk 2010-08-31 17:36:28 +00:00
parent 77d3bc2eb1
commit 87ce946947
1 changed files with 6 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Captcha validator, see captcha.txt for design notes.
"""Captcha validator, see captcha.txt for design notes.
"""
from Acquisition import aq_inner
@ -10,6 +10,8 @@ from z3c.form.interfaces import IValidator
from zope.component import getMultiAdapter, queryUtility
from zope.interface import implements, Interface
from zope.schema.interfaces import IField
from zope.component import adapts
@ -21,18 +23,14 @@ from plone.app.discussion.interfaces import IDiscussionLayer
try:
from plone.formwidget.captcha.validator import WrongCaptchaCode
except:
except ImportError:
pass
try:
from plone.formwidget.recaptcha.validator import WrongCaptchaCode
except:
except ImportError:
pass
from zope.interface import implements, Interface
from zope.schema.interfaces import IField
from zope.component import adapts
class CaptchaValidator(validator.SimpleFieldValidator):
implements(IValidator)