Fix flake8 None comparison errors
authorKarl O. Pinc <kop@meme.com>
Thu, 25 Oct 2018 14:05:33 +0000 (09:05 -0500)
committerKarl O. Pinc <kop@meme.com>
Thu, 25 Oct 2018 14:05:33 +0000 (09:05 -0500)
src/pgwui_upload/views/upload.py

index c160d120804952e2003ba4fc8a20b3754fd66644..93f6cb628b2d5eed7942e8e351e9187a5dca90eb 100644 (file)
@@ -200,7 +200,7 @@ class TableUploadHandler(TabularFileUploadHandler):
                # there's an insert trigger on the table.
                "             OR tables.table_type = 'VIEW')")
         self.cur.execute(sql, (table, schema))
-        return self.cur.fetchone() != None
+        return self.cur.fetchone() is not None
 
     def factory(self, ue):
         '''Make a db loader function from an UploadEngine.
@@ -238,7 +238,7 @@ class TableUploadHandler(TabularFileUploadHandler):
         for col_name in data.headers.tuples:
             # Check that colum name exists
             self.cur.execute(column_sql, (table, schema, col_name))
-            if self.cur.fetchone() == None:
+            if self.cur.fetchone() is None:
                 bad_cols.append(col_name)
             else:
                 # Add column to sql statement