Author: Ronan Lamy <[email protected]>
Branch: py3k
Changeset: r87575:570001fa5784
Date: 2016-10-04 19:00 +0100
http://bitbucket.org/pypy/pypy/changeset/570001fa5784/
Log: fix some tests to pass on CPython
diff --git a/pypy/module/cpyext/test/foo3.c b/pypy/module/cpyext/test/foo3.c
--- a/pypy/module/cpyext/test/foo3.c
+++ b/pypy/module/cpyext/test/foo3.c
@@ -92,4 +92,5 @@
if (PyDict_SetItemString(d, "footype", (PyObject *)&footype) < 0)
return NULL;
Py_INCREF(&footype);
+ return mod;
}
diff --git a/pypy/module/cpyext/test/sre.h b/pypy/module/cpyext/test/sre.h
--- a/pypy/module/cpyext/test/sre.h
+++ b/pypy/module/cpyext/test/sre.h
@@ -19,7 +19,7 @@
#if SIZEOF_SIZE_T > 4
# define SRE_MAXREPEAT (~(SRE_CODE)0)
#else
-# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u)
+# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX)
#endif
typedef struct {
@@ -31,7 +31,8 @@
PyObject* pattern; /* pattern source (or None) */
int flags; /* flags used when compiling pattern source */
PyObject *weakreflist; /* List of weak references */
- int charsize; /* pattern charsize (or -1) */
+ int logical_charsize; /* pattern charsize (or -1) */
+ int charsize;
Py_buffer view;
/* pattern code */
Py_ssize_t codesize;
@@ -73,6 +74,7 @@
PyObject* string;
Py_ssize_t pos, endpos;
/* character size */
+ int logical_charsize; /* kind of thing: 1 - bytes, 2/4 - unicode */
int charsize;
/* registers */
Py_ssize_t lastindex;
diff --git a/pypy/module/cpyext/test/test_typeobject.py
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -50,7 +50,7 @@
raises(TypeError, "obj.int_member = 'not a number'")
raises(TypeError, "del obj.int_member")
raises(AttributeError, "obj.int_member_readonly = 42")
- exc = raises(TypeError, "del obj.int_member_readonly")
+ exc = raises(AttributeError, "del obj.int_member_readonly")
assert "readonly" in str(exc.value)
raises(SystemError, "obj.broken_member")
raises(SystemError, "obj.broken_member = 42")
@@ -971,8 +971,7 @@
assert str(e) == 'instance layout conflicts in multiple
inheritance'
else:
- assert str(e) == ('Error when calling the metaclass bases\n'
- ' multiple bases have instance lay-out conflict')
+ assert 'instance lay-out conflict' in str(e)
else:
raise AssertionError("did not get TypeError!")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit