mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Merge branch 'py33' into devel
This commit is contained in:
commit
16d96fd43c
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ What's new in psycopg 2.5
|
|||
|
||||
- Added JSON adaptation.
|
||||
- Added support for PostgreSQL 9.2 range types.
|
||||
- Added support for Python 3.3.
|
||||
- 'connection' and 'cursor' objects can be used in 'with' statements
|
||||
as context managers as specified by recent DBAPI extension.
|
||||
- Added support for backward scrollable cursors. Thanks to Jon Nelson
|
||||
|
|
|
@ -55,7 +55,6 @@ chunk_repr(chunkObject *self)
|
|||
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
|
||||
/* XXX support 3.0 buffer protocol */
|
||||
static Py_ssize_t
|
||||
chunk_getreadbuffer(chunkObject *self, Py_ssize_t segment, void **ptr)
|
||||
{
|
||||
|
@ -90,9 +89,15 @@ static PyBufferProcs chunk_as_buffer =
|
|||
/* 3.0 buffer interface */
|
||||
int chunk_getbuffer(PyObject *_self, Py_buffer *view, int flags)
|
||||
{
|
||||
int rv;
|
||||
chunkObject *self = (chunkObject*)_self;
|
||||
return PyBuffer_FillInfo(view, _self, self->base, self->len, 1, flags);
|
||||
rv = PyBuffer_FillInfo(view, _self, self->base, self->len, 1, flags);
|
||||
if (rv == 0) {
|
||||
view->format = "c";
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
static PyBufferProcs chunk_as_buffer =
|
||||
{
|
||||
chunk_getbuffer,
|
||||
|
|
5
setup.py
5
setup.py
|
@ -347,14 +347,15 @@ class psycopg_build_ext(build_ext):
|
|||
self.libraries.append('ssl')
|
||||
self.libraries.append('crypto')
|
||||
|
||||
def finalize_linux2(self):
|
||||
def finalize_linux(self):
|
||||
"""Finalize build system configuration on GNU/Linux platform."""
|
||||
# tell piro that GCC is fine and dandy, but not so MS compilers
|
||||
for extension in self.extensions:
|
||||
extension.extra_compile_args.append(
|
||||
'-Wdeclaration-after-statement')
|
||||
|
||||
finalize_linux3 = finalize_linux2
|
||||
finalize_linux2 = finalize_linux
|
||||
finalize_linux3 = finalize_linux
|
||||
|
||||
def finalize_options(self):
|
||||
"""Complete the build system configuation."""
|
||||
|
|
|
@ -126,7 +126,7 @@ class TypesBasicTests(unittest.TestCase):
|
|||
s = bytes(range(256))
|
||||
b = psycopg2.Binary(s)
|
||||
buf = self.execute("SELECT %s::bytea AS foo", (b,))
|
||||
self.assertEqual(s, buf)
|
||||
self.assertEqual(s, buf.tobytes())
|
||||
|
||||
def testBinaryNone(self):
|
||||
b = psycopg2.Binary(None)
|
||||
|
@ -154,7 +154,7 @@ class TypesBasicTests(unittest.TestCase):
|
|||
s = bytes(range(256))
|
||||
buf = self.execute("SELECT %s::bytea AS foo", (psycopg2.Binary(s),))
|
||||
buf2 = self.execute("SELECT %s::bytea AS foo", (buf,))
|
||||
self.assertEqual(s, buf2)
|
||||
self.assertEqual(s, buf2.tobytes())
|
||||
|
||||
def testArray(self):
|
||||
s = self.execute("SELECT %s AS foo", ([[1,2],[3,4]],))
|
||||
|
|
Loading…
Reference in New Issue
Block a user