Skip to content

Commit 6dae015

Browse files
committed
flake8: E711 comparison to None should be 'if cond is not None:'
1 parent 7056418 commit 6dae015

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roundup/cgi/templating.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def html4_cgi_escape_attrs(**attrs):
585585
Code can use None to indicate a pure boolean.
586586
'''
587587
return ' '.join(['%s="%s"'%(k,html_escape(str(v), True))
588-
if v != None else '%s'%(k)
588+
if v is not None else '%s'%(k)
589589
for k,v in sorted(attrs.items())])
590590

591591

@@ -599,7 +599,7 @@ def xhtml_cgi_escape_attrs(**attrs):
599599
Code can use None to indicate a pure boolean.
600600
'''
601601
return ' '.join(['%s="%s"'%(k,html_escape(str(v), True))
602-
if v != None else '%s="%s"'%(k,k)
602+
if v is not None else '%s="%s"'%(k,k)
603603
for k,v in sorted(attrs.items())])
604604

605605

@@ -3284,7 +3284,7 @@ def indexargs_url(self, url, args):
32843284
q = urllib_.quote
32853285
sc = self.special_char
32863286
l = ['%s=%s'%(k,is_us(v) and q(v) or v)
3287-
for k,v in args.items() if v != None]
3287+
for k,v in args.items() if v is not None]
32883288
# pull out the special values (prefixed by @ or :)
32893289
specials = {}
32903290
for key in args.keys():

0 commit comments

Comments
 (0)