From ca75f6ae105d6e4d650fbf9aa2ab2ba35a2c8978 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 25 Jan 2018 12:52:58 +0100 Subject: [PATCH] Revert db/comments.py too --- isso/db/comments.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/isso/db/comments.py b/isso/db/comments.py index f70db58..b1f6f39 100644 --- a/isso/db/comments.py +++ b/isso/db/comments.py @@ -3,7 +3,7 @@ import time from isso.utils import Bloomfilter -# from isso.compat import memoryview # required for Python 2.6 +from isso.compat import buffer class Comments: """Hopefully DB-independend SQL to store, modify and retrieve all @@ -57,7 +57,7 @@ class Comments: 'FROM threads WHERE threads.uri = ?;'], ( c.get('parent'), c.get('created') or time.time(), None, c["mode"], c['remote_addr'], - c['text'], c.get('author'), c.get('email'), c.get('website'), memoryview( + c['text'], c.get('author'), c.get('email'), c.get('website'), buffer( Bloomfilter(iterable=[c['remote_addr']]).array), uri) ) @@ -255,7 +255,7 @@ class Comments: 'UPDATE comments SET', ' likes = likes + 1,' if upvote else 'dislikes = dislikes + 1,', ' voters = ?' - 'WHERE id=?;'], (memoryview(bf.array), id)) + 'WHERE id=?;'], (buffer(bf.array), id)) if upvote: return {'likes': likes + 1, 'dislikes': dislikes}