From 899cdbe6744239293f3fbcc573ab32a77ddc1950 Mon Sep 17 00:00:00 2001
From: Roger Siddons <dizygotheca@ntlworld.com>
Date: Fri, 13 Nov 2015 17:02:02 +0000
Subject: [PATCH] Fix python mysqldb upstream changes
mysqlclient-python 1.3.4 changed cursor connection from weakref proxy to a ref
Fixes 12491
diff --git a/mythtv/bindings/python/MythTV/_conn_mysqldb.py b/mythtv/bindings/python/MythTV/_conn_mysqldb.py
index a3ac3b6..42f368a 100644
a
|
b
|
class LoggedCursor( MySQLdb.cursors.Cursor ): |
38 | 38 | self.ping = ref(self._ping122) |
39 | 39 | self.ping() |
40 | 40 | |
41 | | def _ping121(self): self.connection.ping(True) |
42 | | def _ping122(self): self.connection.ping() |
| 41 | def _ping121(self): self._get_db().ping(True) |
| 42 | def _ping122(self): self._get_db().ping() |
43 | 43 | |
44 | 44 | def _sanitize(self, query): return query.replace('?', '%s') |
45 | 45 | |
… |
… |
class LoggedCursor( MySQLdb.cursors.Cursor ): |
95 | 95 | except Exception, e: |
96 | 96 | raise MythDBError(MythDBError.DB_RAW, e.args) |
97 | 97 | |
98 | | def commit(self): self.connection.commit() |
99 | | def rollback(self): self.connection.rollback() |
| 98 | def commit(self): self._get_db().commit() |
| 99 | def rollback(self): self._get_db().rollback() |
100 | 100 | |
101 | 101 | def __enter__(self): |
102 | 102 | return self |