Fix flake8 is None problems
authorKarl O. Pinc <kop@meme.com>
Sun, 21 Oct 2018 22:45:38 +0000 (17:45 -0500)
committerKarl O. Pinc <kop@meme.com>
Sun, 21 Oct 2018 23:58:53 +0000 (18:58 -0500)
src/pgwui_core/pgwui_core.py

index 58cd3e1957c2e4704068f096931a4768bd1f9c6b..a538ee0734e8fe793d85d4c77449f8ffb6574700 100644 (file)
@@ -555,7 +555,7 @@ def textualize(st):
     '''
     Return pg representation of NULL for None when string st is None.
     '''
-    return 'NULL' if st == None else st
+    return 'NULL' if st is None else st
 
 
 def is_checked(val):
@@ -726,12 +726,12 @@ class DBError(Error):
         '''
         primary = cgi_escape(ex.diag.message_primary)
 
-        if ex.diag.message_detail == None:
+        if ex.diag.message_detail is None:
             detail = ''
         else:
             detail = '<br />DETAIL: ' + cgi_escape(ex.diag.message_detail)
 
-        if ex.diag.message_hint == None:
+        if ex.diag.message_hint is None:
             hint = ''
         else:
             hint = '<br />HINT: ' + cgi_escape(ex.diag.message_hint)
@@ -818,7 +818,7 @@ class SQLCommand(object):
         try:
             cur.execute(self.stmt, self.args)
         except psycopg2.DatabaseError as ex:
-            if self.ec == None:
+            if self.ec is None:
                 raise ex
             else:
                 raise self.ec(ex)