2222
2323import debug # pyflakes:ignore
2424
25+ from ietf .doc .models import BallotDocEvent
2526from ietf .doc .models import ConsensusDocEvent
26- from ietf .utils .text import wordwrap , fill , wrap_text_if_unwrapped
2727from ietf .utils .html import sanitize_fragment
28- from ietf .doc .models import BallotDocEvent
28+ from ietf .utils import log
29+ from ietf .utils .text import wordwrap , fill , wrap_text_if_unwrapped
2930
3031register = template .Library ()
3132
@@ -70,7 +71,7 @@ def parse_email_list(value):
7071
7172
7273 """
73- if value and isinstance (value , ( six . binary_type , six . text_type ) ): # testing for 'value' being true isn't necessary; it's a fast-out route
74+ if value and isinstance (value , str ): # testing for 'value' being true isn't necessary; it's a fast-out route
7475 addrs = re .split (", ?" , value )
7576 ret = []
7677 for addr in addrs :
@@ -79,6 +80,8 @@ def parse_email_list(value):
7980 name = email
8081 ret .append ('<a href="mailto:%s">%s</a>' % ( email .replace ('&' , '&' ), escape (name ) ))
8182 return mark_safe (", " .join (ret ))
83+ elif value and isinstance (value , bytes ):
84+ log .assertion ('isinstance(value, str)' )
8285 else :
8386 return value
8487
@@ -151,10 +154,12 @@ def sanitize(value):
151154@register .filter (name = 'bracket' )
152155def square_brackets (value ):
153156 """Adds square brackets around text."""
154- if isinstance (value , ( six . binary_type , six . text_type ) ):
157+ if isinstance (value , str ):
155158 if value == "" :
156159 value = " "
157160 return "[ %s ]" % value
161+ elif isinstance (value , bytes ):
162+ log .assertion ('isinstance(value, str)' )
158163 elif value > 0 :
159164 return "[ X ]"
160165 elif value < 0 :
@@ -344,7 +349,7 @@ def expires_soon(x,request):
344349
345350@register .filter (name = 'startswith' )
346351def startswith (x , y ):
347- return six . text_type (x ).startswith (y )
352+ return str (x ).startswith (y )
348353
349354@register .filter
350355def has_role (user , role_names ):
0 commit comments