changeset 7023:ae6fa7b32e2d

flake8: E711 comparison to None should be 'if cond is not None:'
author John Rouillard <rouilj@ieee.org>
date Sun, 09 Oct 2022 17:40:14 -0400
parents f4bfc1af5d95
children bac315283a55
files roundup/cgi/templating.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Sun Oct 09 17:34:42 2022 -0400
+++ b/roundup/cgi/templating.py	Sun Oct 09 17:40:14 2022 -0400
@@ -585,7 +585,7 @@
         Code can use None to indicate a pure boolean.
     '''
     return ' '.join(['%s="%s"'%(k,html_escape(str(v), True))
-                         if v != None else '%s'%(k)
+                         if v is not None else '%s'%(k)
                          for k,v in sorted(attrs.items())])
 
 
@@ -599,7 +599,7 @@
         Code can use None to indicate a pure boolean.
     '''
     return ' '.join(['%s="%s"'%(k,html_escape(str(v), True))
-                         if v != None else '%s="%s"'%(k,k)
+                         if v is not None else '%s="%s"'%(k,k)
                          for k,v in sorted(attrs.items())])
 
 
@@ -3284,7 +3284,7 @@
         q = urllib_.quote
         sc = self.special_char
         l = ['%s=%s'%(k,is_us(v) and q(v) or v)
-             for k,v in args.items() if v != None]
+             for k,v in args.items() if v is not None]
         # pull out the special values (prefixed by @ or :)
         specials = {}
         for key in args.keys():

Roundup Issue Tracker: http://roundup-tracker.org/