Initial import to Tizen
[profile/ivi/python-twisted.git] / twisted / test / raiser.c
1 /* Generated by Cython 0.14.1 on Tue Mar  8 19:41:56 2011 */
2
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #else
8
9 #include <stddef.h> /* For offsetof */
10 #ifndef offsetof
11 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
12 #endif
13
14 #if !defined(WIN32) && !defined(MS_WINDOWS)
15   #ifndef __stdcall
16     #define __stdcall
17   #endif
18   #ifndef __cdecl
19     #define __cdecl
20   #endif
21   #ifndef __fastcall
22     #define __fastcall
23   #endif
24 #endif
25
26 #ifndef DL_IMPORT
27   #define DL_IMPORT(t) t
28 #endif
29 #ifndef DL_EXPORT
30   #define DL_EXPORT(t) t
31 #endif
32
33 #ifndef PY_LONG_LONG
34   #define PY_LONG_LONG LONG_LONG
35 #endif
36
37 #if PY_VERSION_HEX < 0x02040000
38   #define METH_COEXIST 0
39   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
40   #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
41 #endif
42
43 #if PY_VERSION_HEX < 0x02050000
44   typedef int Py_ssize_t;
45   #define PY_SSIZE_T_MAX INT_MAX
46   #define PY_SSIZE_T_MIN INT_MIN
47   #define PY_FORMAT_SIZE_T ""
48   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
49   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
50   #define PyNumber_Index(o)    PyNumber_Int(o)
51   #define PyIndex_Check(o)     PyNumber_Check(o)
52   #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
53 #endif
54
55 #if PY_VERSION_HEX < 0x02060000
56   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
57   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
58   #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
59   #define PyVarObject_HEAD_INIT(type, size) \
60           PyObject_HEAD_INIT(type) size,
61   #define PyType_Modified(t)
62
63   typedef struct {
64      void *buf;
65      PyObject *obj;
66      Py_ssize_t len;
67      Py_ssize_t itemsize;
68      int readonly;
69      int ndim;
70      char *format;
71      Py_ssize_t *shape;
72      Py_ssize_t *strides;
73      Py_ssize_t *suboffsets;
74      void *internal;
75   } Py_buffer;
76
77   #define PyBUF_SIMPLE 0
78   #define PyBUF_WRITABLE 0x0001
79   #define PyBUF_FORMAT 0x0004
80   #define PyBUF_ND 0x0008
81   #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
82   #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
83   #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
84   #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
85   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
86
87 #endif
88
89 #if PY_MAJOR_VERSION < 3
90   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
91 #else
92   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
93 #endif
94
95 #if PY_MAJOR_VERSION >= 3
96   #define Py_TPFLAGS_CHECKTYPES 0
97   #define Py_TPFLAGS_HAVE_INDEX 0
98 #endif
99
100 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
102 #endif
103
104 #if PY_MAJOR_VERSION >= 3
105   #define PyBaseString_Type            PyUnicode_Type
106   #define PyStringObject               PyUnicodeObject
107   #define PyString_Type                PyUnicode_Type
108   #define PyString_Check               PyUnicode_Check
109   #define PyString_CheckExact          PyUnicode_CheckExact
110 #endif
111
112 #if PY_VERSION_HEX < 0x02060000
113   #define PyBytesObject                PyStringObject
114   #define PyBytes_Type                 PyString_Type
115   #define PyBytes_Check                PyString_Check
116   #define PyBytes_CheckExact           PyString_CheckExact
117   #define PyBytes_FromString           PyString_FromString
118   #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
119   #define PyBytes_FromFormat           PyString_FromFormat
120   #define PyBytes_DecodeEscape         PyString_DecodeEscape
121   #define PyBytes_AsString             PyString_AsString
122   #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
123   #define PyBytes_Size                 PyString_Size
124   #define PyBytes_AS_STRING            PyString_AS_STRING
125   #define PyBytes_GET_SIZE             PyString_GET_SIZE
126   #define PyBytes_Repr                 PyString_Repr
127   #define PyBytes_Concat               PyString_Concat
128   #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
129 #endif
130
131 #if PY_VERSION_HEX < 0x02060000
132   #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
133   #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
134 #endif
135 #ifndef PySet_CheckExact
136   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
137 #endif
138
139 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
140
141 #if PY_MAJOR_VERSION >= 3
142   #define PyIntObject                  PyLongObject
143   #define PyInt_Type                   PyLong_Type
144   #define PyInt_Check(op)              PyLong_Check(op)
145   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
146   #define PyInt_FromString             PyLong_FromString
147   #define PyInt_FromUnicode            PyLong_FromUnicode
148   #define PyInt_FromLong               PyLong_FromLong
149   #define PyInt_FromSize_t             PyLong_FromSize_t
150   #define PyInt_FromSsize_t            PyLong_FromSsize_t
151   #define PyInt_AsLong                 PyLong_AsLong
152   #define PyInt_AS_LONG                PyLong_AS_LONG
153   #define PyInt_AsSsize_t              PyLong_AsSsize_t
154   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
155   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
156 #endif
157
158 #if PY_MAJOR_VERSION >= 3
159   #define PyBoolObject                 PyLongObject
160 #endif
161
162
163 #if PY_MAJOR_VERSION >= 3
164   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
165   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
166 #else
167   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
168   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
169 #endif
170
171 #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
172   #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
173   #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
174   #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
175 #else
176   #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
177         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
178         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
179             (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
180   #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
181         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
182         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
183             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
184   #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
185         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
186         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
187             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
188 #endif
189
190 #if PY_MAJOR_VERSION >= 3
191   #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
192 #endif
193
194 #if PY_VERSION_HEX < 0x02050000
195   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
196   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
197   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
198 #else
199   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
200   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
201   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
202 #endif
203
204 #if PY_VERSION_HEX < 0x02050000
205   #define __Pyx_NAMESTR(n) ((char *)(n))
206   #define __Pyx_DOCSTR(n)  ((char *)(n))
207 #else
208   #define __Pyx_NAMESTR(n) (n)
209   #define __Pyx_DOCSTR(n)  (n)
210 #endif
211
212 #ifdef __cplusplus
213 #define __PYX_EXTERN_C extern "C"
214 #else
215 #define __PYX_EXTERN_C extern
216 #endif
217
218 #if defined(WIN32) || defined(MS_WINDOWS)
219 #define _USE_MATH_DEFINES
220 #endif
221 #include <math.h>
222 #define __PYX_HAVE_API__twisted__test__raiser
223
224 #ifdef PYREX_WITHOUT_ASSERTIONS
225 #define CYTHON_WITHOUT_ASSERTIONS
226 #endif
227
228
229 /* inline attribute */
230 #ifndef CYTHON_INLINE
231   #if defined(__GNUC__)
232     #define CYTHON_INLINE __inline__
233   #elif defined(_MSC_VER)
234     #define CYTHON_INLINE __inline
235   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
236     #define CYTHON_INLINE inline
237   #else
238     #define CYTHON_INLINE
239   #endif
240 #endif
241
242 /* unused attribute */
243 #ifndef CYTHON_UNUSED
244 # if defined(__GNUC__)
245 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
246 #     define CYTHON_UNUSED __attribute__ ((__unused__))
247 #   else
248 #     define CYTHON_UNUSED
249 #   endif
250 # elif defined(__ICC) || defined(__INTEL_COMPILER)
251 #   define CYTHON_UNUSED __attribute__ ((__unused__))
252 # else
253 #   define CYTHON_UNUSED
254 # endif
255 #endif
256
257 typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
258
259
260 /* Type Conversion Predeclarations */
261
262 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
263 #define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
264
265 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
266 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
267 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
268
269 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
270 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
271 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
272
273 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
274
275
276 #ifdef __GNUC__
277 /* Test for GCC > 2.95 */
278 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
279 #define likely(x)   __builtin_expect(!!(x), 1)
280 #define unlikely(x) __builtin_expect(!!(x), 0)
281 #else /* __GNUC__ > 2 ... */
282 #define likely(x)   (x)
283 #define unlikely(x) (x)
284 #endif /* __GNUC__ > 2 ... */
285 #else /* __GNUC__ */
286 #define likely(x)   (x)
287 #define unlikely(x) (x)
288 #endif /* __GNUC__ */
289     
290 static PyObject *__pyx_m;
291 static PyObject *__pyx_b;
292 static PyObject *__pyx_empty_tuple;
293 static PyObject *__pyx_empty_bytes;
294 static int __pyx_lineno;
295 static int __pyx_clineno = 0;
296 static const char * __pyx_cfilenm= __FILE__;
297 static const char *__pyx_filename;
298
299
300 static const char *__pyx_f[] = {
301   "raiser.pyx",
302 };
303
304 /* Type declarations */
305
306 #ifndef CYTHON_REFNANNY
307   #define CYTHON_REFNANNY 0
308 #endif
309
310 #if CYTHON_REFNANNY
311   typedef struct {
312     void (*INCREF)(void*, PyObject*, int);
313     void (*DECREF)(void*, PyObject*, int);
314     void (*GOTREF)(void*, PyObject*, int);
315     void (*GIVEREF)(void*, PyObject*, int);
316     void* (*SetupContext)(const char*, int, const char*);
317     void (*FinishContext)(void**);
318   } __Pyx_RefNannyAPIStruct;
319   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
320   static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
321     PyObject *m = NULL, *p = NULL;
322     void *r = NULL;
323     m = PyImport_ImportModule((char *)modname);
324     if (!m) goto end;
325     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
326     if (!p) goto end;
327     r = PyLong_AsVoidPtr(p);
328   end:
329     Py_XDECREF(p);
330     Py_XDECREF(m);
331     return (__Pyx_RefNannyAPIStruct *)r;
332   }
333   #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
334   #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
335   #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
336   #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
337   #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
338   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
339   #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
340 #else
341   #define __Pyx_RefNannySetupContext(name)
342   #define __Pyx_RefNannyFinishContext()
343   #define __Pyx_INCREF(r) Py_INCREF(r)
344   #define __Pyx_DECREF(r) Py_DECREF(r)
345   #define __Pyx_GOTREF(r)
346   #define __Pyx_GIVEREF(r)
347   #define __Pyx_XDECREF(r) Py_XDECREF(r)
348 #endif /* CYTHON_REFNANNY */
349 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
350 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
351
352 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
353
354 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
355 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
356
357 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
358
359 static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
360
361 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
362                                    PyObject *modname); /*proto*/
363
364 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
365
366 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
367
368 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
369
370 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
371
372 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
373
374 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
375
376 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
377
378 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
379
380 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
381
382 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
383
384 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
385
386 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
387
388 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
389
390 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
391
392 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
393
394 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
395
396 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
397
398 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
399 /* Module declarations from twisted.test.raiser */
400
401 #define __Pyx_MODULE_NAME "twisted.test.raiser"
402 static int __pyx_module_is_main_twisted__test__raiser = 0;
403
404 /* Implementation of twisted.test.raiser */
405 static PyObject *__pyx_builtin_Exception;
406 static char __pyx_k_1[] = "This function is intentionally broken";
407 static char __pyx_k_3[] = "\nA trivial extension that just raises an exception.\nSee L{twisted.test.test_failure.test_failureConstructionWithMungedStackSucceeds}.\n";
408 static char __pyx_k_4[] = "\n    A speficic exception only used to be identified in tests.\n    ";
409 static char __pyx_k_5[] = "twisted.test.raiser";
410 static char __pyx_k____main__[] = "__main__";
411 static char __pyx_k____test__[] = "__test__";
412 static char __pyx_k__Exception[] = "Exception";
413 static char __pyx_k__raiseException[] = "raiseException";
414 static char __pyx_k__RaiserException[] = "RaiserException";
415 static PyObject *__pyx_kp_s_1;
416 static PyObject *__pyx_kp_s_4;
417 static PyObject *__pyx_n_s_5;
418 static PyObject *__pyx_n_s__Exception;
419 static PyObject *__pyx_n_s__RaiserException;
420 static PyObject *__pyx_n_s____main__;
421 static PyObject *__pyx_n_s____test__;
422 static PyObject *__pyx_n_s__raiseException;
423 static PyObject *__pyx_k_tuple_2;
424
425 /* "twisted/test/raiser.pyx":17
426  * 
427  * 
428  * def raiseException():             # <<<<<<<<<<<<<<
429  *     """
430  *     Raise L{RaiserException}.
431  */
432
433 static PyObject *__pyx_pf_7twisted_4test_6raiser_raiseException(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
434 static char __pyx_doc_7twisted_4test_6raiser_raiseException[] = "\n    Raise L{RaiserException}.\n    ";
435 static PyMethodDef __pyx_mdef_7twisted_4test_6raiser_raiseException = {__Pyx_NAMESTR("raiseException"), (PyCFunction)__pyx_pf_7twisted_4test_6raiser_raiseException, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7twisted_4test_6raiser_raiseException)};
436 static PyObject *__pyx_pf_7twisted_4test_6raiser_raiseException(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
437   PyObject *__pyx_r = NULL;
438   PyObject *__pyx_t_1 = NULL;
439   PyObject *__pyx_t_2 = NULL;
440   __Pyx_RefNannySetupContext("raiseException");
441   __pyx_self = __pyx_self;
442
443   /* "twisted/test/raiser.pyx":21
444  *     Raise L{RaiserException}.
445  *     """
446  *     raise RaiserException("This function is intentionally broken")             # <<<<<<<<<<<<<<
447  */
448   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__RaiserException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
449   __Pyx_GOTREF(__pyx_t_1);
450   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
451   __Pyx_GOTREF(__pyx_t_2);
452   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
453   __Pyx_Raise(__pyx_t_2, 0, 0);
454   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
455   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
456
457   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
458   goto __pyx_L0;
459   __pyx_L1_error:;
460   __Pyx_XDECREF(__pyx_t_1);
461   __Pyx_XDECREF(__pyx_t_2);
462   __Pyx_AddTraceback("twisted.test.raiser.raiseException");
463   __pyx_r = NULL;
464   __pyx_L0:;
465   __Pyx_XGIVEREF(__pyx_r);
466   __Pyx_RefNannyFinishContext();
467   return __pyx_r;
468 }
469
470 static PyMethodDef __pyx_methods[] = {
471   {0, 0, 0, 0}
472 };
473
474 #if PY_MAJOR_VERSION >= 3
475 static struct PyModuleDef __pyx_moduledef = {
476     PyModuleDef_HEAD_INIT,
477     __Pyx_NAMESTR("raiser"),
478     __Pyx_DOCSTR(__pyx_k_3), /* m_doc */
479     -1, /* m_size */
480     __pyx_methods /* m_methods */,
481     NULL, /* m_reload */
482     NULL, /* m_traverse */
483     NULL, /* m_clear */
484     NULL /* m_free */
485 };
486 #endif
487
488 static __Pyx_StringTabEntry __pyx_string_tab[] = {
489   {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
490   {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
491   {&__pyx_n_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 1},
492   {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
493   {&__pyx_n_s__RaiserException, __pyx_k__RaiserException, sizeof(__pyx_k__RaiserException), 0, 0, 1, 1},
494   {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
495   {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
496   {&__pyx_n_s__raiseException, __pyx_k__raiseException, sizeof(__pyx_k__raiseException), 0, 0, 1, 1},
497   {0, 0, 0, 0, 0, 0, 0}
498 };
499 static int __Pyx_InitCachedBuiltins(void) {
500   __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
501   return 0;
502   __pyx_L1_error:;
503   return -1;
504 }
505
506 static int __Pyx_InitCachedConstants(void) {
507   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
508
509   /* "twisted/test/raiser.pyx":21
510  *     Raise L{RaiserException}.
511  *     """
512  *     raise RaiserException("This function is intentionally broken")             # <<<<<<<<<<<<<<
513  */
514   __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
515   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2));
516   __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
517   PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1));
518   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
519   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
520   __Pyx_RefNannyFinishContext();
521   return 0;
522   __pyx_L1_error:;
523   __Pyx_RefNannyFinishContext();
524   return -1;
525 }
526
527 static int __Pyx_InitGlobals(void) {
528   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
529   return 0;
530   __pyx_L1_error:;
531   return -1;
532 }
533
534 #if PY_MAJOR_VERSION < 3
535 PyMODINIT_FUNC initraiser(void); /*proto*/
536 PyMODINIT_FUNC initraiser(void)
537 #else
538 PyMODINIT_FUNC PyInit_raiser(void); /*proto*/
539 PyMODINIT_FUNC PyInit_raiser(void)
540 #endif
541 {
542   PyObject *__pyx_t_1 = NULL;
543   PyObject *__pyx_t_2 = NULL;
544   PyObject *__pyx_t_3 = NULL;
545   #if CYTHON_REFNANNY
546   void* __pyx_refnanny = NULL;
547   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
548   if (!__Pyx_RefNanny) {
549       PyErr_Clear();
550       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
551       if (!__Pyx_RefNanny)
552           Py_FatalError("failed to import 'refnanny' module");
553   }
554   __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_raiser(void)", __LINE__, __FILE__);
555   #endif
556   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
557   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
558   #ifdef __pyx_binding_PyCFunctionType_USED
559   if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
560   #endif
561   /*--- Library function declarations ---*/
562   /*--- Threads initialization code ---*/
563   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
564   #ifdef WITH_THREAD /* Python build with threading support? */
565   PyEval_InitThreads();
566   #endif
567   #endif
568   /*--- Module creation code ---*/
569   #if PY_MAJOR_VERSION < 3
570   __pyx_m = Py_InitModule4(__Pyx_NAMESTR("raiser"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_3), 0, PYTHON_API_VERSION);
571   #else
572   __pyx_m = PyModule_Create(&__pyx_moduledef);
573   #endif
574   if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
575   #if PY_MAJOR_VERSION < 3
576   Py_INCREF(__pyx_m);
577   #endif
578   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
579   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
580   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
581   /*--- Initialize various global constants etc. ---*/
582   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
583   if (__pyx_module_is_main_twisted__test__raiser) {
584     if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
585   }
586   /*--- Builtin init code ---*/
587   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
588   /*--- Constants init code ---*/
589   if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
590   /*--- Global init code ---*/
591   /*--- Function export code ---*/
592   /*--- Type init code ---*/
593   /*--- Type import code ---*/
594   /*--- Function import code ---*/
595   /*--- Execution code ---*/
596
597   /* "twisted/test/raiser.pyx":11
598  * 
599  * 
600  * class RaiserException(Exception):             # <<<<<<<<<<<<<<
601  *     """
602  *     A speficic exception only used to be identified in tests.
603  */
604   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
605   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
606   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
607   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
608   __Pyx_INCREF(__pyx_builtin_Exception);
609   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception);
610   __Pyx_GIVEREF(__pyx_builtin_Exception);
611   if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
612   __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__RaiserException, __pyx_n_s_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
613   __Pyx_GOTREF(__pyx_t_3);
614   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
615   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__RaiserException, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
616   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
617   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
618
619   /* "twisted/test/raiser.pyx":17
620  * 
621  * 
622  * def raiseException():             # <<<<<<<<<<<<<<
623  *     """
624  *     Raise L{RaiserException}.
625  */
626   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7twisted_4test_6raiser_raiseException, NULL, __pyx_n_s_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
627   __Pyx_GOTREF(__pyx_t_1);
628   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__raiseException, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
629   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
630
631   /* "twisted/test/raiser.pyx":1
632  * # Copyright (c) Twisted Matrix Laboratories.             # <<<<<<<<<<<<<<
633  * # See LICENSE for details.
634  * 
635  */
636   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
637   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
638   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
639   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
640   goto __pyx_L0;
641   __pyx_L1_error:;
642   __Pyx_XDECREF(__pyx_t_1);
643   __Pyx_XDECREF(__pyx_t_2);
644   __Pyx_XDECREF(__pyx_t_3);
645   if (__pyx_m) {
646     __Pyx_AddTraceback("init twisted.test.raiser");
647     Py_DECREF(__pyx_m); __pyx_m = 0;
648   } else if (!PyErr_Occurred()) {
649     PyErr_SetString(PyExc_ImportError, "init twisted.test.raiser");
650   }
651   __pyx_L0:;
652   __Pyx_RefNannyFinishContext();
653   #if PY_MAJOR_VERSION < 3
654   return;
655   #else
656   return __pyx_m;
657   #endif
658 }
659
660 /* Runtime support code */
661
662 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
663     PyObject *result;
664     result = PyObject_GetAttr(dict, name);
665     if (!result)
666         PyErr_SetObject(PyExc_NameError, name);
667     return result;
668 }
669
670 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
671     PyObject *tmp_type, *tmp_value, *tmp_tb;
672     PyThreadState *tstate = PyThreadState_GET();
673
674     tmp_type = tstate->curexc_type;
675     tmp_value = tstate->curexc_value;
676     tmp_tb = tstate->curexc_traceback;
677     tstate->curexc_type = type;
678     tstate->curexc_value = value;
679     tstate->curexc_traceback = tb;
680     Py_XDECREF(tmp_type);
681     Py_XDECREF(tmp_value);
682     Py_XDECREF(tmp_tb);
683 }
684
685 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
686     PyThreadState *tstate = PyThreadState_GET();
687     *type = tstate->curexc_type;
688     *value = tstate->curexc_value;
689     *tb = tstate->curexc_traceback;
690
691     tstate->curexc_type = 0;
692     tstate->curexc_value = 0;
693     tstate->curexc_traceback = 0;
694 }
695
696
697 #if PY_MAJOR_VERSION < 3
698 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
699     Py_XINCREF(type);
700     Py_XINCREF(value);
701     Py_XINCREF(tb);
702     /* First, check the traceback argument, replacing None with NULL. */
703     if (tb == Py_None) {
704         Py_DECREF(tb);
705         tb = 0;
706     }
707     else if (tb != NULL && !PyTraceBack_Check(tb)) {
708         PyErr_SetString(PyExc_TypeError,
709             "raise: arg 3 must be a traceback or None");
710         goto raise_error;
711     }
712     /* Next, replace a missing value with None */
713     if (value == NULL) {
714         value = Py_None;
715         Py_INCREF(value);
716     }
717     #if PY_VERSION_HEX < 0x02050000
718     if (!PyClass_Check(type))
719     #else
720     if (!PyType_Check(type))
721     #endif
722     {
723         /* Raising an instance.  The value should be a dummy. */
724         if (value != Py_None) {
725             PyErr_SetString(PyExc_TypeError,
726                 "instance exception may not have a separate value");
727             goto raise_error;
728         }
729         /* Normalize to raise <class>, <instance> */
730         Py_DECREF(value);
731         value = type;
732         #if PY_VERSION_HEX < 0x02050000
733             if (PyInstance_Check(type)) {
734                 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
735                 Py_INCREF(type);
736             }
737             else {
738                 type = 0;
739                 PyErr_SetString(PyExc_TypeError,
740                     "raise: exception must be an old-style class or instance");
741                 goto raise_error;
742             }
743         #else
744             type = (PyObject*) Py_TYPE(type);
745             Py_INCREF(type);
746             if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
747                 PyErr_SetString(PyExc_TypeError,
748                     "raise: exception class must be a subclass of BaseException");
749                 goto raise_error;
750             }
751         #endif
752     }
753
754     __Pyx_ErrRestore(type, value, tb);
755     return;
756 raise_error:
757     Py_XDECREF(value);
758     Py_XDECREF(type);
759     Py_XDECREF(tb);
760     return;
761 }
762
763 #else /* Python 3+ */
764
765 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
766     if (tb == Py_None) {
767         tb = 0;
768     } else if (tb && !PyTraceBack_Check(tb)) {
769         PyErr_SetString(PyExc_TypeError,
770             "raise: arg 3 must be a traceback or None");
771         goto bad;
772     }
773     if (value == Py_None)
774         value = 0;
775
776     if (PyExceptionInstance_Check(type)) {
777         if (value) {
778             PyErr_SetString(PyExc_TypeError,
779                 "instance exception may not have a separate value");
780             goto bad;
781         }
782         value = type;
783         type = (PyObject*) Py_TYPE(value);
784     } else if (!PyExceptionClass_Check(type)) {
785         PyErr_SetString(PyExc_TypeError,
786             "raise: exception class must be a subclass of BaseException");
787         goto bad;
788     }
789
790     PyErr_SetObject(type, value);
791
792     if (tb) {
793         PyThreadState *tstate = PyThreadState_GET();
794         PyObject* tmp_tb = tstate->curexc_traceback;
795         if (tb != tmp_tb) {
796             Py_INCREF(tb);
797             tstate->curexc_traceback = tb;
798             Py_XDECREF(tmp_tb);
799         }
800     }
801
802 bad:
803     return;
804 }
805 #endif
806
807 static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
808     PyObject *metaclass;
809     /* Default metaclass */
810 #if PY_MAJOR_VERSION < 3
811     if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
812         PyObject *base = PyTuple_GET_ITEM(bases, 0);
813         metaclass = PyObject_GetAttrString(base, "__class__");
814         if (!metaclass) {
815             PyErr_Clear();
816             metaclass = (PyObject*) Py_TYPE(base);
817         }
818     } else {
819         metaclass = (PyObject *) &PyClass_Type;
820     }
821 #else
822     if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
823         PyObject *base = PyTuple_GET_ITEM(bases, 0);
824         metaclass = (PyObject*) Py_TYPE(base);
825     } else {
826         metaclass = (PyObject *) &PyType_Type;
827     }
828 #endif
829     Py_INCREF(metaclass);
830     return metaclass;
831 }
832
833 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
834                                    PyObject *modname) {
835     PyObject *result;
836     PyObject *metaclass;
837
838     if (PyDict_SetItemString(dict, "__module__", modname) < 0)
839         return NULL;
840
841     /* Python2 __metaclass__ */
842     metaclass = PyDict_GetItemString(dict, "__metaclass__");
843     if (metaclass) {
844         Py_INCREF(metaclass);
845     } else {
846         metaclass = __Pyx_FindPy2Metaclass(bases);
847     }
848     result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
849     Py_DECREF(metaclass);
850     return result;
851 }
852
853 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
854     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
855     const int is_unsigned = neg_one > const_zero;
856     if (sizeof(unsigned char) < sizeof(long)) {
857         long val = __Pyx_PyInt_AsLong(x);
858         if (unlikely(val != (long)(unsigned char)val)) {
859             if (!unlikely(val == -1 && PyErr_Occurred())) {
860                 PyErr_SetString(PyExc_OverflowError,
861                     (is_unsigned && unlikely(val < 0)) ?
862                     "can't convert negative value to unsigned char" :
863                     "value too large to convert to unsigned char");
864             }
865             return (unsigned char)-1;
866         }
867         return (unsigned char)val;
868     }
869     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
870 }
871
872 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
873     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
874     const int is_unsigned = neg_one > const_zero;
875     if (sizeof(unsigned short) < sizeof(long)) {
876         long val = __Pyx_PyInt_AsLong(x);
877         if (unlikely(val != (long)(unsigned short)val)) {
878             if (!unlikely(val == -1 && PyErr_Occurred())) {
879                 PyErr_SetString(PyExc_OverflowError,
880                     (is_unsigned && unlikely(val < 0)) ?
881                     "can't convert negative value to unsigned short" :
882                     "value too large to convert to unsigned short");
883             }
884             return (unsigned short)-1;
885         }
886         return (unsigned short)val;
887     }
888     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
889 }
890
891 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
892     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
893     const int is_unsigned = neg_one > const_zero;
894     if (sizeof(unsigned int) < sizeof(long)) {
895         long val = __Pyx_PyInt_AsLong(x);
896         if (unlikely(val != (long)(unsigned int)val)) {
897             if (!unlikely(val == -1 && PyErr_Occurred())) {
898                 PyErr_SetString(PyExc_OverflowError,
899                     (is_unsigned && unlikely(val < 0)) ?
900                     "can't convert negative value to unsigned int" :
901                     "value too large to convert to unsigned int");
902             }
903             return (unsigned int)-1;
904         }
905         return (unsigned int)val;
906     }
907     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
908 }
909
910 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
911     const char neg_one = (char)-1, const_zero = 0;
912     const int is_unsigned = neg_one > const_zero;
913     if (sizeof(char) < sizeof(long)) {
914         long val = __Pyx_PyInt_AsLong(x);
915         if (unlikely(val != (long)(char)val)) {
916             if (!unlikely(val == -1 && PyErr_Occurred())) {
917                 PyErr_SetString(PyExc_OverflowError,
918                     (is_unsigned && unlikely(val < 0)) ?
919                     "can't convert negative value to char" :
920                     "value too large to convert to char");
921             }
922             return (char)-1;
923         }
924         return (char)val;
925     }
926     return (char)__Pyx_PyInt_AsLong(x);
927 }
928
929 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
930     const short neg_one = (short)-1, const_zero = 0;
931     const int is_unsigned = neg_one > const_zero;
932     if (sizeof(short) < sizeof(long)) {
933         long val = __Pyx_PyInt_AsLong(x);
934         if (unlikely(val != (long)(short)val)) {
935             if (!unlikely(val == -1 && PyErr_Occurred())) {
936                 PyErr_SetString(PyExc_OverflowError,
937                     (is_unsigned && unlikely(val < 0)) ?
938                     "can't convert negative value to short" :
939                     "value too large to convert to short");
940             }
941             return (short)-1;
942         }
943         return (short)val;
944     }
945     return (short)__Pyx_PyInt_AsLong(x);
946 }
947
948 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
949     const int neg_one = (int)-1, const_zero = 0;
950     const int is_unsigned = neg_one > const_zero;
951     if (sizeof(int) < sizeof(long)) {
952         long val = __Pyx_PyInt_AsLong(x);
953         if (unlikely(val != (long)(int)val)) {
954             if (!unlikely(val == -1 && PyErr_Occurred())) {
955                 PyErr_SetString(PyExc_OverflowError,
956                     (is_unsigned && unlikely(val < 0)) ?
957                     "can't convert negative value to int" :
958                     "value too large to convert to int");
959             }
960             return (int)-1;
961         }
962         return (int)val;
963     }
964     return (int)__Pyx_PyInt_AsLong(x);
965 }
966
967 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
968     const signed char neg_one = (signed char)-1, const_zero = 0;
969     const int is_unsigned = neg_one > const_zero;
970     if (sizeof(signed char) < sizeof(long)) {
971         long val = __Pyx_PyInt_AsLong(x);
972         if (unlikely(val != (long)(signed char)val)) {
973             if (!unlikely(val == -1 && PyErr_Occurred())) {
974                 PyErr_SetString(PyExc_OverflowError,
975                     (is_unsigned && unlikely(val < 0)) ?
976                     "can't convert negative value to signed char" :
977                     "value too large to convert to signed char");
978             }
979             return (signed char)-1;
980         }
981         return (signed char)val;
982     }
983     return (signed char)__Pyx_PyInt_AsSignedLong(x);
984 }
985
986 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
987     const signed short neg_one = (signed short)-1, const_zero = 0;
988     const int is_unsigned = neg_one > const_zero;
989     if (sizeof(signed short) < sizeof(long)) {
990         long val = __Pyx_PyInt_AsLong(x);
991         if (unlikely(val != (long)(signed short)val)) {
992             if (!unlikely(val == -1 && PyErr_Occurred())) {
993                 PyErr_SetString(PyExc_OverflowError,
994                     (is_unsigned && unlikely(val < 0)) ?
995                     "can't convert negative value to signed short" :
996                     "value too large to convert to signed short");
997             }
998             return (signed short)-1;
999         }
1000         return (signed short)val;
1001     }
1002     return (signed short)__Pyx_PyInt_AsSignedLong(x);
1003 }
1004
1005 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
1006     const signed int neg_one = (signed int)-1, const_zero = 0;
1007     const int is_unsigned = neg_one > const_zero;
1008     if (sizeof(signed int) < sizeof(long)) {
1009         long val = __Pyx_PyInt_AsLong(x);
1010         if (unlikely(val != (long)(signed int)val)) {
1011             if (!unlikely(val == -1 && PyErr_Occurred())) {
1012                 PyErr_SetString(PyExc_OverflowError,
1013                     (is_unsigned && unlikely(val < 0)) ?
1014                     "can't convert negative value to signed int" :
1015                     "value too large to convert to signed int");
1016             }
1017             return (signed int)-1;
1018         }
1019         return (signed int)val;
1020     }
1021     return (signed int)__Pyx_PyInt_AsSignedLong(x);
1022 }
1023
1024 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
1025     const int neg_one = (int)-1, const_zero = 0;
1026     const int is_unsigned = neg_one > const_zero;
1027     if (sizeof(int) < sizeof(long)) {
1028         long val = __Pyx_PyInt_AsLong(x);
1029         if (unlikely(val != (long)(int)val)) {
1030             if (!unlikely(val == -1 && PyErr_Occurred())) {
1031                 PyErr_SetString(PyExc_OverflowError,
1032                     (is_unsigned && unlikely(val < 0)) ?
1033                     "can't convert negative value to int" :
1034                     "value too large to convert to int");
1035             }
1036             return (int)-1;
1037         }
1038         return (int)val;
1039     }
1040     return (int)__Pyx_PyInt_AsLong(x);
1041 }
1042
1043 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
1044     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
1045     const int is_unsigned = neg_one > const_zero;
1046 #if PY_VERSION_HEX < 0x03000000
1047     if (likely(PyInt_Check(x))) {
1048         long val = PyInt_AS_LONG(x);
1049         if (is_unsigned && unlikely(val < 0)) {
1050             PyErr_SetString(PyExc_OverflowError,
1051                             "can't convert negative value to unsigned long");
1052             return (unsigned long)-1;
1053         }
1054         return (unsigned long)val;
1055     } else
1056 #endif
1057     if (likely(PyLong_Check(x))) {
1058         if (is_unsigned) {
1059             if (unlikely(Py_SIZE(x) < 0)) {
1060                 PyErr_SetString(PyExc_OverflowError,
1061                                 "can't convert negative value to unsigned long");
1062                 return (unsigned long)-1;
1063             }
1064             return PyLong_AsUnsignedLong(x);
1065         } else {
1066             return PyLong_AsLong(x);
1067         }
1068     } else {
1069         unsigned long val;
1070         PyObject *tmp = __Pyx_PyNumber_Int(x);
1071         if (!tmp) return (unsigned long)-1;
1072         val = __Pyx_PyInt_AsUnsignedLong(tmp);
1073         Py_DECREF(tmp);
1074         return val;
1075     }
1076 }
1077
1078 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
1079     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
1080     const int is_unsigned = neg_one > const_zero;
1081 #if PY_VERSION_HEX < 0x03000000
1082     if (likely(PyInt_Check(x))) {
1083         long val = PyInt_AS_LONG(x);
1084         if (is_unsigned && unlikely(val < 0)) {
1085             PyErr_SetString(PyExc_OverflowError,
1086                             "can't convert negative value to unsigned PY_LONG_LONG");
1087             return (unsigned PY_LONG_LONG)-1;
1088         }
1089         return (unsigned PY_LONG_LONG)val;
1090     } else
1091 #endif
1092     if (likely(PyLong_Check(x))) {
1093         if (is_unsigned) {
1094             if (unlikely(Py_SIZE(x) < 0)) {
1095                 PyErr_SetString(PyExc_OverflowError,
1096                                 "can't convert negative value to unsigned PY_LONG_LONG");
1097                 return (unsigned PY_LONG_LONG)-1;
1098             }
1099             return PyLong_AsUnsignedLongLong(x);
1100         } else {
1101             return PyLong_AsLongLong(x);
1102         }
1103     } else {
1104         unsigned PY_LONG_LONG val;
1105         PyObject *tmp = __Pyx_PyNumber_Int(x);
1106         if (!tmp) return (unsigned PY_LONG_LONG)-1;
1107         val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
1108         Py_DECREF(tmp);
1109         return val;
1110     }
1111 }
1112
1113 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
1114     const long neg_one = (long)-1, const_zero = 0;
1115     const int is_unsigned = neg_one > const_zero;
1116 #if PY_VERSION_HEX < 0x03000000
1117     if (likely(PyInt_Check(x))) {
1118         long val = PyInt_AS_LONG(x);
1119         if (is_unsigned && unlikely(val < 0)) {
1120             PyErr_SetString(PyExc_OverflowError,
1121                             "can't convert negative value to long");
1122             return (long)-1;
1123         }
1124         return (long)val;
1125     } else
1126 #endif
1127     if (likely(PyLong_Check(x))) {
1128         if (is_unsigned) {
1129             if (unlikely(Py_SIZE(x) < 0)) {
1130                 PyErr_SetString(PyExc_OverflowError,
1131                                 "can't convert negative value to long");
1132                 return (long)-1;
1133             }
1134             return PyLong_AsUnsignedLong(x);
1135         } else {
1136             return PyLong_AsLong(x);
1137         }
1138     } else {
1139         long val;
1140         PyObject *tmp = __Pyx_PyNumber_Int(x);
1141         if (!tmp) return (long)-1;
1142         val = __Pyx_PyInt_AsLong(tmp);
1143         Py_DECREF(tmp);
1144         return val;
1145     }
1146 }
1147
1148 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
1149     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
1150     const int is_unsigned = neg_one > const_zero;
1151 #if PY_VERSION_HEX < 0x03000000
1152     if (likely(PyInt_Check(x))) {
1153         long val = PyInt_AS_LONG(x);
1154         if (is_unsigned && unlikely(val < 0)) {
1155             PyErr_SetString(PyExc_OverflowError,
1156                             "can't convert negative value to PY_LONG_LONG");
1157             return (PY_LONG_LONG)-1;
1158         }
1159         return (PY_LONG_LONG)val;
1160     } else
1161 #endif
1162     if (likely(PyLong_Check(x))) {
1163         if (is_unsigned) {
1164             if (unlikely(Py_SIZE(x) < 0)) {
1165                 PyErr_SetString(PyExc_OverflowError,
1166                                 "can't convert negative value to PY_LONG_LONG");
1167                 return (PY_LONG_LONG)-1;
1168             }
1169             return PyLong_AsUnsignedLongLong(x);
1170         } else {
1171             return PyLong_AsLongLong(x);
1172         }
1173     } else {
1174         PY_LONG_LONG val;
1175         PyObject *tmp = __Pyx_PyNumber_Int(x);
1176         if (!tmp) return (PY_LONG_LONG)-1;
1177         val = __Pyx_PyInt_AsLongLong(tmp);
1178         Py_DECREF(tmp);
1179         return val;
1180     }
1181 }
1182
1183 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
1184     const signed long neg_one = (signed long)-1, const_zero = 0;
1185     const int is_unsigned = neg_one > const_zero;
1186 #if PY_VERSION_HEX < 0x03000000
1187     if (likely(PyInt_Check(x))) {
1188         long val = PyInt_AS_LONG(x);
1189         if (is_unsigned && unlikely(val < 0)) {
1190             PyErr_SetString(PyExc_OverflowError,
1191                             "can't convert negative value to signed long");
1192             return (signed long)-1;
1193         }
1194         return (signed long)val;
1195     } else
1196 #endif
1197     if (likely(PyLong_Check(x))) {
1198         if (is_unsigned) {
1199             if (unlikely(Py_SIZE(x) < 0)) {
1200                 PyErr_SetString(PyExc_OverflowError,
1201                                 "can't convert negative value to signed long");
1202                 return (signed long)-1;
1203             }
1204             return PyLong_AsUnsignedLong(x);
1205         } else {
1206             return PyLong_AsLong(x);
1207         }
1208     } else {
1209         signed long val;
1210         PyObject *tmp = __Pyx_PyNumber_Int(x);
1211         if (!tmp) return (signed long)-1;
1212         val = __Pyx_PyInt_AsSignedLong(tmp);
1213         Py_DECREF(tmp);
1214         return val;
1215     }
1216 }
1217
1218 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
1219     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
1220     const int is_unsigned = neg_one > const_zero;
1221 #if PY_VERSION_HEX < 0x03000000
1222     if (likely(PyInt_Check(x))) {
1223         long val = PyInt_AS_LONG(x);
1224         if (is_unsigned && unlikely(val < 0)) {
1225             PyErr_SetString(PyExc_OverflowError,
1226                             "can't convert negative value to signed PY_LONG_LONG");
1227             return (signed PY_LONG_LONG)-1;
1228         }
1229         return (signed PY_LONG_LONG)val;
1230     } else
1231 #endif
1232     if (likely(PyLong_Check(x))) {
1233         if (is_unsigned) {
1234             if (unlikely(Py_SIZE(x) < 0)) {
1235                 PyErr_SetString(PyExc_OverflowError,
1236                                 "can't convert negative value to signed PY_LONG_LONG");
1237                 return (signed PY_LONG_LONG)-1;
1238             }
1239             return PyLong_AsUnsignedLongLong(x);
1240         } else {
1241             return PyLong_AsLongLong(x);
1242         }
1243     } else {
1244         signed PY_LONG_LONG val;
1245         PyObject *tmp = __Pyx_PyNumber_Int(x);
1246         if (!tmp) return (signed PY_LONG_LONG)-1;
1247         val = __Pyx_PyInt_AsSignedLongLong(tmp);
1248         Py_DECREF(tmp);
1249         return val;
1250     }
1251 }
1252
1253 #include "compile.h"
1254 #include "frameobject.h"
1255 #include "traceback.h"
1256
1257 static void __Pyx_AddTraceback(const char *funcname) {
1258     PyObject *py_srcfile = 0;
1259     PyObject *py_funcname = 0;
1260     PyObject *py_globals = 0;
1261     PyCodeObject *py_code = 0;
1262     PyFrameObject *py_frame = 0;
1263
1264     #if PY_MAJOR_VERSION < 3
1265     py_srcfile = PyString_FromString(__pyx_filename);
1266     #else
1267     py_srcfile = PyUnicode_FromString(__pyx_filename);
1268     #endif
1269     if (!py_srcfile) goto bad;
1270     if (__pyx_clineno) {
1271         #if PY_MAJOR_VERSION < 3
1272         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
1273         #else
1274         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
1275         #endif
1276     }
1277     else {
1278         #if PY_MAJOR_VERSION < 3
1279         py_funcname = PyString_FromString(funcname);
1280         #else
1281         py_funcname = PyUnicode_FromString(funcname);
1282         #endif
1283     }
1284     if (!py_funcname) goto bad;
1285     py_globals = PyModule_GetDict(__pyx_m);
1286     if (!py_globals) goto bad;
1287     py_code = PyCode_New(
1288         0,            /*int argcount,*/
1289         #if PY_MAJOR_VERSION >= 3
1290         0,            /*int kwonlyargcount,*/
1291         #endif
1292         0,            /*int nlocals,*/
1293         0,            /*int stacksize,*/
1294         0,            /*int flags,*/
1295         __pyx_empty_bytes, /*PyObject *code,*/
1296         __pyx_empty_tuple,  /*PyObject *consts,*/
1297         __pyx_empty_tuple,  /*PyObject *names,*/
1298         __pyx_empty_tuple,  /*PyObject *varnames,*/
1299         __pyx_empty_tuple,  /*PyObject *freevars,*/
1300         __pyx_empty_tuple,  /*PyObject *cellvars,*/
1301         py_srcfile,   /*PyObject *filename,*/
1302         py_funcname,  /*PyObject *name,*/
1303         __pyx_lineno,   /*int firstlineno,*/
1304         __pyx_empty_bytes  /*PyObject *lnotab*/
1305     );
1306     if (!py_code) goto bad;
1307     py_frame = PyFrame_New(
1308         PyThreadState_GET(), /*PyThreadState *tstate,*/
1309         py_code,             /*PyCodeObject *code,*/
1310         py_globals,          /*PyObject *globals,*/
1311         0                    /*PyObject *locals*/
1312     );
1313     if (!py_frame) goto bad;
1314     py_frame->f_lineno = __pyx_lineno;
1315     PyTraceBack_Here(py_frame);
1316 bad:
1317     Py_XDECREF(py_srcfile);
1318     Py_XDECREF(py_funcname);
1319     Py_XDECREF(py_code);
1320     Py_XDECREF(py_frame);
1321 }
1322
1323 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1324     while (t->p) {
1325         #if PY_MAJOR_VERSION < 3
1326         if (t->is_unicode) {
1327             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
1328         } else if (t->intern) {
1329             *t->p = PyString_InternFromString(t->s);
1330         } else {
1331             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1332         }
1333         #else  /* Python 3+ has unicode identifiers */
1334         if (t->is_unicode | t->is_str) {
1335             if (t->intern) {
1336                 *t->p = PyUnicode_InternFromString(t->s);
1337             } else if (t->encoding) {
1338                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
1339             } else {
1340                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
1341             }
1342         } else {
1343             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
1344         }
1345         #endif
1346         if (!*t->p)
1347             return -1;
1348         ++t;
1349     }
1350     return 0;
1351 }
1352
1353 /* Type Conversion Functions */
1354
1355 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
1356    int is_true = x == Py_True;
1357    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1358    else return PyObject_IsTrue(x);
1359 }
1360
1361 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
1362   PyNumberMethods *m;
1363   const char *name = NULL;
1364   PyObject *res = NULL;
1365 #if PY_VERSION_HEX < 0x03000000
1366   if (PyInt_Check(x) || PyLong_Check(x))
1367 #else
1368   if (PyLong_Check(x))
1369 #endif
1370     return Py_INCREF(x), x;
1371   m = Py_TYPE(x)->tp_as_number;
1372 #if PY_VERSION_HEX < 0x03000000
1373   if (m && m->nb_int) {
1374     name = "int";
1375     res = PyNumber_Int(x);
1376   }
1377   else if (m && m->nb_long) {
1378     name = "long";
1379     res = PyNumber_Long(x);
1380   }
1381 #else
1382   if (m && m->nb_int) {
1383     name = "int";
1384     res = PyNumber_Long(x);
1385   }
1386 #endif
1387   if (res) {
1388 #if PY_VERSION_HEX < 0x03000000
1389     if (!PyInt_Check(res) && !PyLong_Check(res)) {
1390 #else
1391     if (!PyLong_Check(res)) {
1392 #endif
1393       PyErr_Format(PyExc_TypeError,
1394                    "__%s__ returned non-%s (type %.200s)",
1395                    name, name, Py_TYPE(res)->tp_name);
1396       Py_DECREF(res);
1397       return NULL;
1398     }
1399   }
1400   else if (!PyErr_Occurred()) {
1401     PyErr_SetString(PyExc_TypeError,
1402                     "an integer is required");
1403   }
1404   return res;
1405 }
1406
1407 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
1408   Py_ssize_t ival;
1409   PyObject* x = PyNumber_Index(b);
1410   if (!x) return -1;
1411   ival = PyInt_AsSsize_t(x);
1412   Py_DECREF(x);
1413   return ival;
1414 }
1415
1416 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1417 #if PY_VERSION_HEX < 0x02050000
1418    if (ival <= LONG_MAX)
1419        return PyInt_FromLong((long)ival);
1420    else {
1421        unsigned char *bytes = (unsigned char *) &ival;
1422        int one = 1; int little = (int)*(unsigned char*)&one;
1423        return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
1424    }
1425 #else
1426    return PyInt_FromSize_t(ival);
1427 #endif
1428 }
1429
1430 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
1431    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
1432    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
1433        return (size_t)-1;
1434    } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
1435        PyErr_SetString(PyExc_OverflowError,
1436                        "value too large to convert to size_t");
1437        return (size_t)-1;
1438    }
1439    return (size_t)val;
1440 }
1441
1442
1443 #endif /* Py_PYTHON_H */