Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r98444:def680385695
Date: 2020-01-04 20:37 +0200
http://bitbucket.org/pypy/pypy/changeset/def680385695/

Log:    merge default into py3.6

diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -31,7 +31,7 @@
     DEALINGS IN THE SOFTWARE.
 
 
-PyPy Copyright holders 2003-2019
+PyPy Copyright holders 2003-2020
 --------------------------------
 
 Except when otherwise stated (look for LICENSE files or information at
diff --git a/pypy/module/cpyext/include/dictobject.h 
b/pypy/module/cpyext/include/dictobject.h
--- a/pypy/module/cpyext/include/dictobject.h
+++ b/pypy/module/cpyext/include/dictobject.h
@@ -13,8 +13,8 @@
 } PyDictObject;
 
 #define PyDict_Check(op) \
-                PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_DICT_SUBCLASS)
-#define PyDict_CheckExact(op) ((op)->ob_type == &PyDict_Type)
+                PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
+#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
 
 #ifdef __cplusplus
 }
diff --git a/pypy/module/cpyext/include/floatobject.h 
b/pypy/module/cpyext/include/floatobject.h
--- a/pypy/module/cpyext/include/floatobject.h
+++ b/pypy/module/cpyext/include/floatobject.h
@@ -33,8 +33,8 @@
         } while(0)
 
 #define PyFloat_Check(op) \
-                _PyPy_Type_FastSubclass((op)->ob_type, 
Py_TPPYPYFLAGS_FLOAT_SUBCLASS)
-#define PyFloat_CheckExact(op) ((op)->ob_type == &PyFloat_Type)
+                _PyPy_Type_FastSubclass(Py_TYPE(op), 
Py_TPPYPYFLAGS_FLOAT_SUBCLASS)
+#define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
 
 
 #ifdef __cplusplus
diff --git a/pypy/module/cpyext/include/listobject.h 
b/pypy/module/cpyext/include/listobject.h
--- a/pypy/module/cpyext/include/listobject.h
+++ b/pypy/module/cpyext/include/listobject.h
@@ -1,4 +1,4 @@
 /* empty */
 #define PyList_Check(op) \
-                PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_LIST_SUBCLASS)
-#define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type)
+                PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
+#define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type)
diff --git a/pypy/module/cpyext/include/longobject.h 
b/pypy/module/cpyext/include/longobject.h
--- a/pypy/module/cpyext/include/longobject.h
+++ b/pypy/module/cpyext/include/longobject.h
@@ -15,8 +15,8 @@
 #define PyOS_strtoul strtoul
 #define PyOS_strtol strtoul
 #define PyLong_Check(op) \
-                PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_LONG_SUBCLASS)
-#define PyLong_CheckExact(op) ((op)->ob_type == &PyLong_Type)
+                PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
+#define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type)
 
 #define PyLong_AS_LONG(op) PyLong_AsLong(op)
 
diff --git a/pypy/module/cpyext/include/sliceobject.h 
b/pypy/module/cpyext/include/sliceobject.h
--- a/pypy/module/cpyext/include/sliceobject.h
+++ b/pypy/module/cpyext/include/sliceobject.h
@@ -17,7 +17,7 @@
     PyObject *step;
 } PySliceObject;
 
-#define PySlice_Check(op) ((op)->ob_type == &PySlice_Type)
+#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
 
 PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
                          Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t step);
diff --git a/pypy/module/cpyext/include/tupleobject.h 
b/pypy/module/cpyext/include/tupleobject.h
--- a/pypy/module/cpyext/include/tupleobject.h
+++ b/pypy/module/cpyext/include/tupleobject.h
@@ -32,8 +32,8 @@
 #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
 
 #define PyTuple_Check(op) \
-                PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_TUPLE_SUBCLASS)
-#define PyTuple_CheckExact(op) ((op)->ob_type == &PyTuple_Type)
+                PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
+#define PyTuple_CheckExact(op) (Py_TYPE(op) == &PyTuple_Type)
 
 #ifdef __cplusplus
 }
diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py
--- a/rpython/rlib/rutf8.py
+++ b/rpython/rlib/rutf8.py
@@ -153,22 +153,20 @@
     """Gives the position of the previous codepoint.
     'pos' must not be zero.
     """
-    assert pos != 0
     pos -= 1
+    assert pos >= 0
     if pos >= len(code):     # for the case where pos - 1 == len(code):
-        assert pos >= 0
         return pos           # assume there is an extra '\x00' character
     chr1 = ord(code[pos])
     if chr1 <= 0x7F:
-        assert pos >= 0
         return pos
     pos -= 1
+    assert pos >= 0
     if ord(code[pos]) >= 0xC0:
-        assert pos >= 0
         return pos
     pos -= 1
+    assert pos >= 0
     if ord(code[pos]) >= 0xC0:
-        assert pos >= 0
         return pos
     pos -= 1
     assert pos >= 0
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to