Skip to content

Commit

Permalink
fix py3.3 basestring and unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
agroszer committed Feb 19, 2016
1 parent 94b0c5f commit 8103b43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/z3c/form/testing.py
Expand Up @@ -17,6 +17,7 @@
import pprint
import os
import re
import six
import zope.browserresource
import zope.component
import zope.configuration.xmlconfig
Expand Down Expand Up @@ -84,9 +85,9 @@ def __init__(self, body_instream=None, environ=None, form=None,
if form is not None:
lists = {}
for k in list(form.keys()):
if isinstance(form[k], basestring):
if isinstance(form[k], six.string_types):
# ensure unicode otherwise z3c.forms burps on str
form[k] = unicode(form[k])
form[k] = six.text_type(form[k])

if k.endswith(':list'):
key = k.split(':', 1)[0]
Expand Down

0 comments on commit 8103b43

Please sign in to comment.