Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Include/pyerrors.h

    r2 r391  
    9595/* */
    9696
    97 #define PyExceptionClass_Check(x)                                       \
    98         (PyClass_Check((x)) || (PyType_Check((x)) &&                    \
    99           PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS)))
    100 
    101 #define PyExceptionInstance_Check(x)                    \
    102         (PyInstance_Check((x)) ||                       \
    103         PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS))
    104 
    105 #define PyExceptionClass_Name(x)                                   \
    106         (PyClass_Check((x))                                        \
    107          ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name)      \
    108         : (char *)(((PyTypeObject*)(x))->tp_name))
    109 
    110 #define PyExceptionInstance_Class(x)                                    \
    111         ((PyInstance_Check((x))                                         \
    112           ? (PyObject*)((PyInstanceObject*)(x))->in_class               \
    113           : (PyObject*)((x)->ob_type)))
    114 
    115        
     97#define PyExceptionClass_Check(x)                                       \
     98    (PyClass_Check((x)) || (PyType_Check((x)) &&                        \
     99      PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS)))
     100
     101#define PyExceptionInstance_Check(x)                    \
     102    (PyInstance_Check((x)) ||                           \
     103    PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS))
     104
     105#define PyExceptionClass_Name(x)                                   \
     106    (PyClass_Check((x))                                            \
     107     ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name)          \
     108    : (char *)(((PyTypeObject*)(x))->tp_name))
     109
     110#define PyExceptionInstance_Class(x)                                    \
     111    ((PyInstance_Check((x))                                             \
     112      ? (PyObject*)((PyInstanceObject*)(x))->in_class                   \
     113      : (PyObject*)((x)->ob_type)))
     114
     115
    116116/* Predefined exceptions */
    117117
     
    185185PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
    186186PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
    187         PyObject *, PyObject *);
    188 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
    189 #ifdef Py_WIN_WIDE_FILENAMES
     187    PyObject *, PyObject *);
     188PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
     189    PyObject *, const char *);
     190#ifdef MS_WINDOWS
    190191PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
    191         PyObject *, Py_UNICODE *);
    192 #endif /* Py_WIN_WIDE_FILENAMES */
     192    PyObject *, const Py_UNICODE *);
     193#endif /* MS_WINDOWS */
    193194
    194195PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
    195                         Py_GCC_ATTRIBUTE((format(printf, 2, 3)));
     196                        Py_GCC_ATTRIBUTE((format(printf, 2, 3)));
    196197
    197198#ifdef MS_WINDOWS
    198199PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
    199         int, const char *);
     200    int, const char *);
    200201PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
    201         int, const char *);
    202 #ifdef Py_WIN_WIDE_FILENAMES
     202    int, const char *);
    203203PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
    204         int, const Py_UNICODE *);
    205 #endif /* Py_WIN_WIDE_FILENAMES */
     204    int, const Py_UNICODE *);
    206205PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
    207206PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
    208         PyObject *,int, PyObject *);
     207    PyObject *,int, PyObject *);
    209208PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
    210         PyObject *,int, const char *);
    211 #ifdef Py_WIN_WIDE_FILENAMES
     209    PyObject *,int, const char *);
    212210PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
    213         PyObject *,int, const Py_UNICODE *);
    214 #endif /* Py_WIN_WIDE_FILENAMES */
     211    PyObject *,int, const Py_UNICODE *);
    215212PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
    216213#endif /* MS_WINDOWS */
     
    224221
    225222/* Function to create a new exception */
    226 PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base,
    227                                          PyObject *dict);
     223PyAPI_FUNC(PyObject *) PyErr_NewException(
     224    char *name, PyObject *base, PyObject *dict);
     225PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc(
     226    char *name, char *doc, PyObject *base, PyObject *dict);
    228227PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
    229228
     
    245244/* create a UnicodeDecodeError object */
    246245PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
    247         const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
     246    const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
    248247
    249248/* create a UnicodeEncodeError object */
    250249PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
    251         const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
     250    const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
    252251
    253252/* create a UnicodeTranslateError object */
    254253PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
    255         const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
     254    const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
    256255
    257256/* get the encoding attribute */
     
    296295   return 0 on success, -1 on failure */
    297296PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
    298         PyObject *, const char *);
     297    PyObject *, const char *);
    299298PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
    300         PyObject *, const char *);
     299    PyObject *, const char *);
    301300PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
    302         PyObject *, const char *);
     301    PyObject *, const char *);
    303302#endif
    304303
     
    320319#include <stdarg.h>
    321320PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char  *format, ...)
    322                         Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
     321                        Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
    323322PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char  *format, va_list va)
    324                         Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
     323                        Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
    325324
    326325#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.