[arch-commits] CVS update of extra/devel/pyrex (exception.patch python2.5.patch)
Jason Chu
jason at archlinux.org
Tue May 22 22:07:24 UTC 2007
Date: Tuesday, May 22, 2007 @ 18:07:24
Author: jason
Path: /home/cvs-extra/extra/devel/pyrex
Removed: exception.patch (1.1) python2.5.patch (1.1)
Remove unused patches
-----------------+
exception.patch | 72 ----------
python2.5.patch | 355 ------------------------------------------------------
2 files changed, 427 deletions(-)
Index: extra/devel/pyrex/exception.patch
diff -u extra/devel/pyrex/exception.patch:1.1 extra/devel/pyrex/exception.patch:removed
--- extra/devel/pyrex/exception.patch:1.1 Wed Jan 24 11:06:42 2007
+++ extra/devel/pyrex/exception.patch Tue May 22 18:07:24 2007
@@ -1,72 +0,0 @@
-Index: Pyrex/Compiler/Nodes.py
-===================================================================
---- Pyrex/Compiler/Nodes.py (Revision 140)
-+++ Pyrex/Compiler/Nodes.py (Revision 145)
-@@ -3658,31 +3658,54 @@
- Py_INCREF(type);
- Py_DECREF(tmp);
- }
-- if (PyString_Check(type))
-- ;
-+ if (PyString_CheckExact(type)) {
-+ /* Raising builtin string is deprecated but still allowed --
-+ * do nothing. Raising an instance of a new-style str
-+ * subclass is right out. */
-+ if (PyErr_Warn(PyExc_DeprecationWarning,
-+ "raising a string exception is deprecated"))
-+ goto raise_error;
-+ }
- else if (PyType_Check(type) || PyClass_Check(type))
-- ; /*PyErr_NormalizeException(&type, &value, &tb);*/
-+ PyErr_NormalizeException(&type, &value, &tb);
- else if (PyInstance_Check(type)) {
- /* Raising an instance. The value should be a dummy. */
- if (value != Py_None) {
-- PyErr_SetString(PyExc_TypeError,
-- "instance exception may not have a separate value");
-- goto raise_error;
-+ PyErr_SetString(PyExc_TypeError,
-+ "instance exception may not have a separate value");
-+ goto raise_error;
- }
- else {
-- /* Normalize to raise <class>, <instance> */
-- Py_DECREF(value);
-- value = type;
-- type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-- Py_INCREF(type);
-+ /* Normalize to raise <class>, <instance> */
-+ Py_DECREF(value);
-+ value = type;
-+ type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-+ Py_INCREF(type);
- }
- }
-+ else if (PyType_IsSubtype(type->ob_type, (PyTypeObject*)PyExc_Exception)) {
-+ /* Raising a new-style object (in Py2.5).
-+ The value should be a dummy. */
-+ if (value != Py_None) {
-+ PyErr_SetString(PyExc_TypeError,
-+ "instance exception may not have a separate value");
-+ goto raise_error;
-+ }
-+ else {
-+ /* Normalize to raise <class>, <instance> */
-+ Py_DECREF(value);
-+ value = type;
-+ type = type->ob_type;
-+ Py_INCREF(type);
-+ }
-+ }
- else {
- /* Not something you can raise. You get an exception
- anyway, just not what you specified :-) */
- PyErr_Format(PyExc_TypeError,
-- "exceptions must be strings, classes, or "
-- "instances, not %s", type->ob_type->tp_name);
-+ "exceptions must be classes, instances, or "
-+ "strings (deprecated), not %s",
-+ type->ob_type->tp_name);
- goto raise_error;
- }
- PyErr_Restore(type, value, tb);
Index: extra/devel/pyrex/python2.5.patch
diff -u extra/devel/pyrex/python2.5.patch:1.1 extra/devel/pyrex/python2.5.patch:removed
--- extra/devel/pyrex/python2.5.patch:1.1 Wed Jan 24 11:06:42 2007
+++ extra/devel/pyrex/python2.5.patch Tue May 22 18:07:24 2007
@@ -1,355 +0,0 @@
-Index: Pyrex/Compiler/PyrexTypes.py
-===================================================================
---- Pyrex/Compiler/PyrexTypes.py (Revision 133)
-+++ Pyrex/Compiler/PyrexTypes.py (Arbeitskopie)
-@@ -293,8 +293,8 @@
- default_value = "0"
-
- parsetuple_formats = ( # rank -> format
-- "?HIkK???", # unsigned
-- "chilLfd?", # signed
-+ "?HIkK????", # unsigned
-+ "chilL?fd?", # signed
- )
-
- def __init__(self, rank, signed = 1, pymemberdef_typecode = None):
-@@ -340,6 +340,12 @@
- self.is_returncode = is_returncode
-
-
-+class CPySSizeTType(CIntType):
-+
-+ to_py_function = "PyInt_FromSsize_t"
-+ from_py_function = "PyInt_AsSsize_t"
-+
-+
- class CUIntType(CIntType):
-
- to_py_function = "PyLong_FromUnsignedLong"
-@@ -699,6 +705,7 @@
- c_int_type = CIntType(2, 1, "T_INT")
- c_long_type = CIntType(3, 1, "T_LONG")
- c_longlong_type = CLongLongType(4, 1, "T_LONGLONG")
-+c_py_ssize_t_type = CPySSizeTType(5, 1)
-
- c_uchar_type = CIntType(0, 0, "T_UBYTE")
- c_ushort_type = CIntType(1, 0, "T_USHORT")
-@@ -706,9 +713,9 @@
- c_ulong_type = CULongType(3, 0, "T_ULONG")
- c_ulonglong_type = CULongLongType(4, 0, "T_ULONGLONG")
-
--c_float_type = CFloatType(5, "T_FLOAT")
--c_double_type = CFloatType(6, "T_DOUBLE")
--c_longdouble_type = CFloatType(7)
-+c_float_type = CFloatType(6, "T_FLOAT")
-+c_double_type = CFloatType(7, "T_DOUBLE")
-+c_longdouble_type = CFloatType(8)
-
- c_null_ptr_type = CNullPtrType(c_void_type)
- c_char_array_type = CCharArrayType(None)
-@@ -720,7 +727,7 @@
-
- error_type = ErrorType()
-
--lowest_float_rank = 5
-+lowest_float_rank = 6
-
- rank_to_type_name = (
- "char", # 0
-@@ -728,9 +735,10 @@
- "int", # 2
- "long", # 3
- "PY_LONG_LONG", # 4
-- "float", # 5
-- "double", # 6
-- "long double", # 7
-+ "Py_ssize_t", # 5
-+ "float", # 6
-+ "double", # 7
-+ "long double", # 8
- )
-
- sign_and_rank_to_type = {
-@@ -745,9 +753,10 @@
- (1, 2): c_int_type,
- (1, 3): c_long_type,
- (1, 4): c_longlong_type,
-- (1, 5): c_float_type,
-- (1, 6): c_double_type,
-- (1, 7): c_longdouble_type,
-+ (1, 5): c_py_ssize_t_type,
-+ (1, 6): c_float_type,
-+ (1, 7): c_double_type,
-+ (1, 8): c_longdouble_type,
- }
-
- modifiers_and_name_to_type = {
-@@ -763,6 +772,7 @@
- (1, 0, "int"): c_int_type,
- (1, 1, "int"): c_long_type,
- (1, 2, "int"): c_longlong_type,
-+ (1, 0, "Py_ssize_t"): c_py_ssize_t_type,
- (1, 0, "float"): c_float_type,
- (1, 0, "double"): c_double_type,
- (1, 1, "double"): c_longdouble_type,
-Index: Pyrex/Compiler/Parsing.py
-===================================================================
---- Pyrex/Compiler/Parsing.py (Revision 133)
-+++ Pyrex/Compiler/Parsing.py (Arbeitskopie)
-@@ -1257,7 +1257,7 @@
- # "void", "signed", "unsigned"
- #)
-
--basic_c_type_names = ("void", "char", "int", "float", "double")
-+basic_c_type_names = ("void", "char", "int", "float", "double", "Py_ssize_t")
-
- sign_and_longness_words = ("short", "long", "signed", "unsigned")
-
-Index: Pyrex/Compiler/TypeSlots.py
-===================================================================
---- Pyrex/Compiler/TypeSlots.py (Revision 133)
-+++ Pyrex/Compiler/TypeSlots.py (Arbeitskopie)
-@@ -26,6 +26,7 @@
- # 'i' int
- # 'I' int *
- # 'l' long
-+ # 'Z' Py_ssize_t
- # 's' char *
- # 'S' char **
- # 'r' int used only to signal exception
-@@ -42,6 +43,7 @@
- 'i': PyrexTypes.c_int_type,
- 'I': PyrexTypes.c_int_ptr_type,
- 'l': PyrexTypes.c_long_type,
-+ 'Z': PyrexTypes.c_py_ssize_t_type,
- 's': PyrexTypes.c_char_ptr_type,
- 'S': PyrexTypes.c_char_ptr_ptr_type,
- 'r': PyrexTypes.c_returncode_type,
-@@ -354,18 +356,30 @@
- iternaryfunc = Signature("TOO", "O") # typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *);
- callfunc = Signature("T*", "O") # typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *);
- inquiry = Signature("T", "i") # typedef int (*inquiry)(PyObject *);
-+lenfunc = Signature("T", "Z") # typedef Py_ssize_t (*lenfunc)(PyObject *);
-+
- # typedef int (*coercion)(PyObject **, PyObject **);
- intargfunc = Signature("Ti", "O") # typedef PyObject *(*intargfunc)(PyObject *, int);
-+ssizeargfunc = Signature("TZ", "O") # typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
- intintargfunc = Signature("Tii", "O") # typedef PyObject *(*intintargfunc)(PyObject *, int, int);
-+ssizessizeargfunc = Signature("TZZ", "O") # typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
- intobjargproc = Signature("TiO", 'r') # typedef int(*intobjargproc)(PyObject *, int, PyObject *);
-+ssizeobjargproc = Signature("TZO", 'r') # typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
- intintobjargproc = Signature("TiiO", 'r') # typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *);
-+ssizessizeobjargproc = Signature("TZZO", 'r') # typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
-+
- intintargproc = Signature("Tii", 'r')
-+ssizessizeargproc = Signature("TZZ", 'r')
- objargfunc = Signature("TO", "O")
- objobjargproc = Signature("TOO", 'r') # typedef int (*objobjargproc)(PyObject *, PyObject *, PyObject *);
- getreadbufferproc = Signature("TiP", 'i') # typedef int (*getreadbufferproc)(PyObject *, int, void **);
- getwritebufferproc = Signature("TiP", 'i') # typedef int (*getwritebufferproc)(PyObject *, int, void **);
- getsegcountproc = Signature("TI", 'i') # typedef int (*getsegcountproc)(PyObject *, int *);
- getcharbufferproc = Signature("TiS", 'i') # typedef int (*getcharbufferproc)(PyObject *, int, const char **);
-+readbufferproc = Signature("TZP", "Z") # typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);
-+writebufferproc = Signature("TZP", "Z") # typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);
-+segcountproc = Signature("TZ", "Z") # typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *);
-+writebufferproc = Signature("TZS", "Z") # typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);
- objargproc = Signature("TO", 'r') # typedef int (*objobjproc)(PyObject *, PyObject *);
- # typedef int (*visitproc)(PyObject *, void *);
- # typedef int (*traverseproc)(PyObject *, visitproc, void *);
-@@ -454,14 +468,17 @@
- MethodSlot(binaryfunc, "nb_true_divide", "__truediv__"),
- MethodSlot(ibinaryfunc, "nb_inplace_floor_divide", "__ifloordiv__"),
- MethodSlot(ibinaryfunc, "nb_inplace_true_divide", "__itruediv__"),
-+
-+ # Added in release 2.5
-+# MethodSlot(lenfunc, "nb_index", "??"),
- )
-
- PySequenceMethods = (
-- MethodSlot(inquiry, "sq_length", "__len__"), # EmptySlot("sq_length"), # mp_length used instead
-+ MethodSlot(lenfunc, "sq_length", "__len__"), # EmptySlot("sq_length"), # mp_length used instead
- EmptySlot("sq_concat"), # nb_add used instead
- EmptySlot("sq_repeat"), # nb_multiply used instead
- SyntheticSlot("sq_item", ["__getitem__"], "0"), #EmptySlot("sq_item"), # mp_subscript used instead
-- MethodSlot(intintargfunc, "sq_slice", "__getslice__"),
-+ MethodSlot(ssizessizeargfunc, "sq_slice", "__getslice__"),
- EmptySlot("sq_ass_item"), # mp_ass_subscript used instead
- SyntheticSlot("sq_ass_slice", ["__setslice__", "__delslice__"], "0"),
- MethodSlot(cmpfunc, "sq_contains", "__contains__"),
-@@ -470,7 +487,7 @@
- )
-
- PyMappingMethods = (
-- MethodSlot(inquiry, "mp_length", "__len__"),
-+ MethodSlot(lenfunc, "mp_length", "__len__"),
- MethodSlot(objargfunc, "mp_subscript", "__getitem__"),
- SyntheticSlot("mp_ass_subscript", ["__setitem__", "__delitem__"], "0"),
- )
-@@ -565,8 +582,8 @@
- MethodSlot(destructor, "", "__dealloc__")
- MethodSlot(objobjargproc, "", "__setitem__")
- MethodSlot(objargproc, "", "__delitem__")
--MethodSlot(intintobjargproc, "", "__setslice__")
--MethodSlot(intintargproc, "", "__delslice__")
-+MethodSlot(ssizessizeobjargproc, "", "__setslice__")
-+MethodSlot(ssizessizeargproc, "", "__delslice__")
- MethodSlot(getattrofunc, "", "__getattr__")
- MethodSlot(setattrofunc, "", "__setattr__")
- MethodSlot(delattrofunc, "", "__delattr__")
-Index: Pyrex/Compiler/ExprNodes.py
-===================================================================
---- Pyrex/Compiler/ExprNodes.py (Revision 133)
-+++ Pyrex/Compiler/ExprNodes.py (Arbeitskopie)
-@@ -1035,7 +1035,7 @@
- self.type = PyrexTypes.error_type
- if self.index.type.is_pyobject:
- self.index = self.index.coerce_to(
-- PyrexTypes.c_int_type, env)
-+ PyrexTypes.c_py_ssize_t_type, env)
- if not self.index.type.is_int:
- error(self.pos,
- "Invalid index type '%s'" %
-@@ -1107,7 +1107,7 @@
- if self.stop:
- self.stop.analyse_types(env)
- self.base = self.base.coerce_to_pyobject(env)
-- c_int = PyrexTypes.c_int_type
-+ c_int = PyrexTypes.c_py_ssize_t_type
- if self.start:
- self.start = self.start.coerce_to(c_int, env)
- if self.stop:
-@@ -1157,7 +1157,7 @@
- if self.stop:
- return self.stop.result_code
- else:
-- return "0x7fffffff"
-+ return "PY_SSIZE_T_MAX"
-
- def calculate_result_code(self):
- # self.result_code is not used, but this method must exist
-@@ -3101,7 +3101,7 @@
- PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
- }
-
--static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {
-+static PyObject *__Pyx_UnpackItem(PyObject *seq, Py_ssize_t i) {
- PyObject *item;
- if (!(item = PySequence_GetItem(seq, i))) {
- if (PyErr_ExceptionMatches(PyExc_IndexError))
-@@ -3110,7 +3110,7 @@
- return item;
- }
-
--static int __Pyx_EndUnpack(PyObject *seq, int i) {
-+static int __Pyx_EndUnpack(PyObject *seq, Py_ssize_t i) {
- PyObject *item;
- if (item = PySequence_GetItem(seq, i)) {
- Py_DECREF(item);
-Index: Pyrex/Compiler/Nodes.py
-===================================================================
---- Pyrex/Compiler/Nodes.py (Revision 133)
-+++ Pyrex/Compiler/Nodes.py (Arbeitskopie)
-@@ -199,11 +199,19 @@
- code.putln('/* Generated by Pyrex %s on %s */' % (
- Version.version, time.asctime()))
- code.putln('')
-+ code.putln('#define PY_SSIZE_T_CLEAN')
- for filename in env.python_include_files:
- code.putln('#include "%s"' % filename)
- code.putln("#ifndef PY_LONG_LONG")
- code.putln(" #define PY_LONG_LONG LONG_LONG")
- code.putln("#endif")
-+ code.putln("#if PY_VERSION_HEX < 0x02050000")
-+ code.putln(" typedef int Py_ssize_t;")
-+ code.putln(" #define PY_SSIZE_T_MAX INT_MAX")
-+ code.putln(" #define PY_SSIZE_T_MIN INT_MIN")
-+ code.putln(" #define PyInt_FromSsize_t(z) PyInt_FromLong(z)")
-+ code.putln(" #define PyInt_AsSsize_t(o) PyInt_AsLong(o)")
-+ code.putln("#endif")
- self.generate_extern_c_macro_definition(code)
- code.putln("%s double pow(double, double);" % Naming.extern_c_macro)
- self.generate_includes(env, cimported_modules, code)
-@@ -624,12 +632,12 @@
- # a __getitem__ method is present. It converts its
- # argument to a Python integer and calls mp_subscript.
- code.putln(
-- "static PyObject *%s(PyObject *o, int i) {" %
-+ "static PyObject *%s(PyObject *o, Py_ssize_t i) {" %
- scope.mangle_internal("sq_item"))
- code.putln(
- "PyObject *r;")
- code.putln(
-- "PyObject *x = PyInt_FromLong(i); if(!x) return 0;")
-+ "PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;")
- code.putln(
- "r = o->ob_type->tp_as_mapping->mp_subscript(o, x);")
- code.putln(
-@@ -715,7 +723,7 @@
- del_entry = scope.lookup_here("__delslice__")
- code.putln("")
- code.putln(
-- "static int %s(PyObject *o, int i, int j, PyObject *v) {" %
-+ "static int %s(PyObject *o, Py_ssize_t i, Py_ssize_t j, PyObject *v) {" %
- scope.mangle_internal("sq_ass_slice"))
- code.putln(
- "if (v) {")
-@@ -3542,8 +3550,8 @@
- """
- typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
- typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
--static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
--static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
-+static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t); /*proto*/
-+static int __Pyx_EndUnpack(PyObject *, Py_ssize_t); /*proto*/
- static int __Pyx_PrintItem(PyObject *); /*proto*/
- static int __Pyx_PrintNewline(void); /*proto*/
- static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-@@ -3553,7 +3561,7 @@
- static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
- static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
- static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds,\
-- char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
-+ char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2); /*proto*/
- static void __Pyx_WriteUnraisable(char *name); /*proto*/
- static void __Pyx_AddTraceback(char *funcname); /*proto*/
- static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
-@@ -3595,7 +3603,7 @@
- return -1;
- if (PyString_Check(v)) {
- char *s = PyString_AsString(v);
-- int len = PyString_Size(v);
-+ Py_ssize_t len = PyString_Size(v);
- if (len > 0 &&
- isspace(Py_CHARMASK(s[len-1])) &&
- s[len-1] != ' ')
-@@ -3650,7 +3658,7 @@
- }
- if (PyString_Check(type))
- ;
-- else if (PyClass_Check(type))
-+ else if (PyType_Check(type) || PyClass_Check(type))
- ; /*PyErr_NormalizeException(&type, &value, &tb);*/
- else if (PyInstance_Check(type)) {
- /* Raising an instance. The value should be a dummy. */
-@@ -3739,7 +3747,7 @@
- PyObject **args,
- PyObject **kwds,
- char *kwd_list[],
-- int nargs,
-+ Py_ssize_t nargs,
- PyObject **args2,
- PyObject **kwds2)
- {
-@@ -3799,10 +3807,8 @@
- bad:
- Py_XDECREF(args1);
- Py_XDECREF(kwds1);
-- if (*args2)
-- Py_XDECREF(*args2);
-- if (*kwds2)
-- Py_XDECREF(*kwds2);
-+ Py_XDECREF(*args2);
-+ Py_XDECREF(*kwds2);
- return -1;
- }
- """
More information about the arch-commits
mailing list