Changeset 391 for python/trunk/Include/pyerrors.h
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Include/pyerrors.h
r2 r391 95 95 /* */ 96 96 97 #define PyExceptionClass_Check(x) 98 (PyClass_Check((x)) || (PyType_Check((x)) &&\99 100 101 #define PyExceptionInstance_Check(x) 102 (PyInstance_Check((x)) ||\103 104 105 #define PyExceptionClass_Name(x) 106 (PyClass_Check((x))\107 ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name)\108 109 110 #define PyExceptionInstance_Class(x) 111 ((PyInstance_Check((x))\112 ? (PyObject*)((PyInstanceObject*)(x))->in_class\113 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 116 116 /* Predefined exceptions */ 117 117 … … 185 185 PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); 186 186 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( 187 PyObject *, PyObject *); 188 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); 189 #ifdef Py_WIN_WIDE_FILENAMES 187 PyObject *, PyObject *); 188 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename( 189 PyObject *, const char *); 190 #ifdef MS_WINDOWS 190 191 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( 191 PyObject *,Py_UNICODE *);192 #endif /* Py_WIN_WIDE_FILENAMES */192 PyObject *, const Py_UNICODE *); 193 #endif /* MS_WINDOWS */ 193 194 194 195 PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) 195 196 Py_GCC_ATTRIBUTE((format(printf, 2, 3))); 196 197 197 198 #ifdef MS_WINDOWS 198 199 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject( 199 200 int, const char *); 200 201 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( 201 int, const char *); 202 #ifdef Py_WIN_WIDE_FILENAMES 202 int, const char *); 203 203 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( 204 int, const Py_UNICODE *); 205 #endif /* Py_WIN_WIDE_FILENAMES */ 204 int, const Py_UNICODE *); 206 205 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); 207 206 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( 208 207 PyObject *,int, PyObject *); 209 208 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( 210 PyObject *,int, const char *); 211 #ifdef Py_WIN_WIDE_FILENAMES 209 PyObject *,int, const char *); 212 210 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( 213 PyObject *,int, const Py_UNICODE *); 214 #endif /* Py_WIN_WIDE_FILENAMES */ 211 PyObject *,int, const Py_UNICODE *); 215 212 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); 216 213 #endif /* MS_WINDOWS */ … … 224 221 225 222 /* Function to create a new exception */ 226 PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base, 227 PyObject *dict); 223 PyAPI_FUNC(PyObject *) PyErr_NewException( 224 char *name, PyObject *base, PyObject *dict); 225 PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc( 226 char *name, char *doc, PyObject *base, PyObject *dict); 228 227 PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); 229 228 … … 245 244 /* create a UnicodeDecodeError object */ 246 245 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create( 247 246 const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); 248 247 249 248 /* create a UnicodeEncodeError object */ 250 249 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( 251 250 const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); 252 251 253 252 /* create a UnicodeTranslateError object */ 254 253 PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( 255 254 const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); 256 255 257 256 /* get the encoding attribute */ … … 296 295 return 0 on success, -1 on failure */ 297 296 PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason( 298 297 PyObject *, const char *); 299 298 PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason( 300 299 PyObject *, const char *); 301 300 PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( 302 301 PyObject *, const char *); 303 302 #endif 304 303 … … 320 319 #include <stdarg.h> 321 320 PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) 322 321 Py_GCC_ATTRIBUTE((format(printf, 3, 4))); 323 322 PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) 324 323 Py_GCC_ATTRIBUTE((format(printf, 3, 0))); 325 324 326 325 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.