Author: Armin Rigo <[email protected]>
Branch:
Changeset: r3270:666f45a62a98
Date: 2019-04-19 18:30 +0200
http://bitbucket.org/cffi/cffi/changeset/666f45a62a98/
Log: hg merge release-1.12
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,3 +20,4 @@
170fb3d1f0b30d32c9794ea40dbb51836dc7d947 v1.12.0
ac7cb142e8f5dc73033d89c54c54e1b1a6413946 v1.12.1
e0c76668ecf5ab1ad005799cfe1b7cb58610f155 v1.12.2
+bf80722dea36237710083315e336c81bc8571fd0 v1.12.3
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -2338,7 +2338,11 @@
return pyres;
}
-static long cdata_hash(CDataObject *v)
+#if PY_MAJOR_VERSION < 3
+typedef long Py_hash_t;
+#endif
+
+static Py_hash_t cdata_hash(PyObject *v)
{
if (((CDataObject *)v)->c_type->ct_flags & CT_PRIMITIVE_ANY) {
PyObject *vv = convert_to_object(((CDataObject *)v)->c_data,
@@ -2346,13 +2350,13 @@
if (vv == NULL)
return -1;
if (!CData_Check(vv)) {
- long hash = PyObject_Hash(vv);
+ Py_hash_t hash = PyObject_Hash(vv);
Py_DECREF(vv);
return hash;
}
Py_DECREF(vv);
}
- return _Py_HashPointer(v->c_data);
+ return _Py_HashPointer(((CDataObject *)v)->c_data);
}
static Py_ssize_t
@@ -3296,7 +3300,7 @@
&CData_as_number, /* tp_as_number */
0, /* tp_as_sequence */
&CData_as_mapping, /* tp_as_mapping */
- (hashfunc)cdata_hash, /* tp_hash */
+ cdata_hash, /* tp_hash */
(ternaryfunc)cdata_call, /* tp_call */
0, /* tp_str */
(getattrofunc)cdata_getattro, /* tp_getattro */
diff --git a/c/call_python.c b/c/call_python.c
--- a/c/call_python.c
+++ b/c/call_python.c
@@ -24,6 +24,7 @@
PyThreadState *tstate;
PyObject *d, *interpdict;
int err;
+ PyInterpreterState *interp;
tstate = PyThreadState_GET();
if (tstate == NULL) {
@@ -31,7 +32,7 @@
return NULL;
}
- PyInterpreterState *interp = tstate->interp;
+ interp = tstate->interp;
#ifdef HAVE_PYINTERPSTATE_GETDICT
interpdict = PyInterpreterState_GetDict(interp); /* shared reference */
#else
diff --git a/cffi/_embedding.h b/cffi/_embedding.h
--- a/cffi/_embedding.h
+++ b/cffi/_embedding.h
@@ -145,6 +145,7 @@
int result;
PyGILState_STATE state;
PyObject *pycode=NULL, *global_dict=NULL, *x;
+ PyObject *builtins;
state = PyGILState_Ensure();
@@ -169,7 +170,7 @@
global_dict = PyDict_New();
if (global_dict == NULL)
goto error;
- PyObject *builtins = PyEval_GetBuiltins();
+ builtins = PyEval_GetBuiltins();
if (builtins == NULL)
goto error;
if (PyDict_SetItemString(global_dict, "__builtins__", builtins) < 0)
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -54,11 +54,11 @@
* Checksums of the "source" package version 1.12.3:
- - MD5: ...
+ - MD5: 35ad1f9e1003cac9404c1493eb10d7f5
- - SHA: ...
+ - SHA: ccc49cf31bc3f4248f45b9ec83685e4e8090a9fa
- - SHA256: ...
+ - SHA256: 041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774
* Or grab the most current version from the `Bitbucket page`_:
``hg clone https://bitbucket.org/cffi/cffi``
diff --git a/testing/cffi0/test_zintegration.py
b/testing/cffi0/test_zintegration.py
--- a/testing/cffi0/test_zintegration.py
+++ b/testing/cffi0/test_zintegration.py
@@ -1,11 +1,13 @@
import py, os, sys, shutil
import subprocess
from testing.udir import udir
+import pytest
if sys.platform == 'win32':
- py.test.skip('snippets do not run on win32')
+ pytestmark = pytest.mark.skip('snippets do not run on win32')
if sys.version_info < (2, 7):
- py.test.skip('fails e.g. on a Debian/Ubuntu which patches virtualenv'
+ pytestmark = pytest.mark.skip(
+ 'fails e.g. on a Debian/Ubuntu which patches virtualenv'
' in a non-2.6-friendly way')
def create_venv(name):
diff --git a/testing/embedding/test_basic.py b/testing/embedding/test_basic.py
--- a/testing/embedding/test_basic.py
+++ b/testing/embedding/test_basic.py
@@ -63,8 +63,8 @@
output = popen.stdout.read()
err = popen.wait()
if err:
- raise OSError("popen failed with exit code %r: %r" % (
- err, args))
+ raise OSError(("popen failed with exit code %r: %r\n\n%s" % (
+ err, args, output)).rstrip())
print(output.rstrip())
return output
diff --git a/testing/embedding/test_performance.py
b/testing/embedding/test_performance.py
--- a/testing/embedding/test_performance.py
+++ b/testing/embedding/test_performance.py
@@ -2,8 +2,8 @@
from testing.embedding.test_basic import EmbeddingTests
if sys.platform == 'win32':
- import py
- py.test.skip("written with POSIX functions")
+ import pytest
+ pytestmark = pytest.mark.skip("written with POSIX functions")
class TestPerformance(EmbeddingTests):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit