summaryrefslogtreecommitdiff
path: root/lib/extras.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-11-28 03:23:42 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-11-28 03:23:42 +0000
commit914ccbacb5a21bd1f7f0bbdc32b01d73bea6dd4e (patch)
treefee08b5a1fa16758764c6de4e2e710aa608736bb /lib/extras.py
parent1959d2403f41c4aea3473b6cc2fe1b74ada6d02b (diff)
parentb4f066bd43545a96ec98c94a4460d2b5372379a7 (diff)
downloadpsycopg2-914ccbacb5a21bd1f7f0bbdc32b01d73bea6dd4e.tar.gz
Merge branch 'python3_mintimeloggingconnection'
Diffstat (limited to 'lib/extras.py')
-rw-r--r--lib/extras.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/extras.py b/lib/extras.py
index bdd61f7..8b43053 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -450,6 +450,8 @@ class MinTimeLoggingConnection(LoggingConnection):
def filter(self, msg, curs):
t = (_time.time() - curs.timestamp) * 1000
if t > self._mintime:
+ if _sys.version_info[0] >= 3 and isinstance(msg, bytes):
+ msg = msg.decode(_ext.encodings[self.encoding], 'replace')
return msg + _os.linesep + " (execution time: %d ms)" % t
def cursor(self, *args, **kwargs):