changeset 844:0af77f663a65

Fix two instances of using None, which would cause an AttributeError. Submitted by: Jon Nelson
author jruigrok
date Mon, 29 Jun 2009 09:33:02 +0000
parents 004f81b59d97
children 9cabfbc4ac5c
files genshi/filters/html.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/genshi/filters/html.py
+++ b/genshi/filters/html.py
@@ -88,7 +88,7 @@
 
                 elif in_form:
                     if tagname == 'input':
-                        type = attrs.get('type').lower()
+                        type = attrs.get('type', '').lower()
                         if type in ('checkbox', 'radio'):
                             name = attrs.get('name')
                             if name and name in self.data:
@@ -110,7 +110,7 @@
                                     attrs |= [(QName('checked'), 'checked')]
                                 elif 'checked' in attrs:
                                     attrs -= 'checked'
-                        elif type in (None, 'hidden', 'text') \
+                        elif type in ('', 'hidden', 'text') \
                                 or type == 'password' and self.passwords:
                             name = attrs.get('name')
                             if name and name in self.data:
Copyright (C) 2012-2017 Edgewall Software