mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
Merge branch 'mogrify-on-closed-cursor' into maint_2_7
This commit is contained in:
commit
7be099bd80
1
NEWS
1
NEWS
|
@ -5,6 +5,7 @@ What's new in psycopg 2.7.4
|
|||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed Solaris 10 support (:ticket:`#532`).
|
||||
- `cursor.mogrify()` can be called on closed cursors (:ticket:`#579`).
|
||||
- Fixed `~psycopg2.extras.MinTimeLoggingCursor` on Python 3 (:ticket:`#609`).
|
||||
- Fixed parsing of array of points as floats (:ticket:`#613`).
|
||||
- Fixed `~psycopg2.__libpq_version__` building with libpq >= 10.1
|
||||
|
|
|
@ -592,8 +592,6 @@ psyco_curs_mogrify(cursorObject *self, PyObject *args, PyObject *kwargs)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
EXC_IF_CURS_CLOSED(self);
|
||||
|
||||
return _psyco_curs_mogrify(self, operation, vars);
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,12 @@ class CursorTests(ConnectingTestCase):
|
|||
nref2 = sys.getrefcount(foo)
|
||||
self.assertEqual(nref1, nref2)
|
||||
|
||||
def test_modify_closed(self):
|
||||
cur = self.conn.cursor()
|
||||
cur.close()
|
||||
sql = cur.mogrify("select %s", (10,))
|
||||
self.assertEqual(sql, b"select 10")
|
||||
|
||||
def test_bad_placeholder(self):
|
||||
cur = self.conn.cursor()
|
||||
self.assertRaises(psycopg2.ProgrammingError,
|
||||
|
|
Loading…
Reference in New Issue
Block a user