Skip to content

Commit

Permalink
fixing python 33 error
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Milkin committed Feb 18, 2015
1 parent 75eb467 commit fe27bfa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/z3c/form/converter.py
Expand Up @@ -46,10 +46,15 @@ def toWidgetValue(self, value):

def toFieldValue(self, value):
"""See interfaces.IDataConverter"""
if self._strip_value and isinstance(value, basestring):
try:
value = value.strip()
except AttributeError:
# It just was not meant to be
pass

if value == u'':
return self.field.missing_value

return self.field.fromUnicode(value)

def __repr__(self):
Expand Down

0 comments on commit fe27bfa

Please sign in to comment.