mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords
This commit is contained in:
parent
f3175f6341
commit
45aecf451a
24 changed files with 87 additions and 6365 deletions
|
@ -28,25 +28,18 @@ PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
|
|||
|
||||
/* */
|
||||
|
||||
#define PyExceptionClass_Check(x) \
|
||||
(PyClass_Check((x)) \
|
||||
|| (PyType_Check((x)) && PyType_IsSubtype( \
|
||||
(PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException)))
|
||||
#define PyExceptionClass_Check(x) \
|
||||
(PyType_Check((x)) && PyType_IsSubtype( \
|
||||
(PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException))
|
||||
|
||||
|
||||
#define PyExceptionInstance_Check(x) \
|
||||
(PyInstance_Check((x)) || \
|
||||
(PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException)))
|
||||
#define PyExceptionInstance_Check(x) \
|
||||
(PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException))
|
||||
|
||||
#define PyExceptionClass_Name(x) \
|
||||
(PyClass_Check((x)) \
|
||||
? PyString_AS_STRING(((PyClassObject*)(x))->cl_name) \
|
||||
: (char *)(((PyTypeObject*)(x))->tp_name))
|
||||
#define PyExceptionClass_Name(x) \
|
||||
((char *)(((PyTypeObject*)(x))->tp_name))
|
||||
|
||||
#define PyExceptionInstance_Class(x) \
|
||||
((PyInstance_Check((x)) \
|
||||
? (PyObject*)((PyInstanceObject*)(x))->in_class \
|
||||
: (PyObject*)((x)->ob_type)))
|
||||
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
|
||||
|
||||
|
||||
/* Predefined exceptions */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue