comparison Python/ceval.c @ 40937:6aa1be5dd009

Merged revisions 53912-53951 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r53919 | thomas.wouters | 2007-02-25 23:12:31 +0100 (Sun, 25 Feb 2007) | 8 lines Backported r51621 from p3yk: Don't use a fixed temporary name (gdbm). Don't use our own temp name creation (dbm). Should be backported to 2.5. ........ r53935 | georg.brandl | 2007-02-26 14:51:29 +0100 (Mon, 26 Feb 2007) | 2 lines Backport from Py3k branch: fix refleak in PyString_Format. ........ r53943 | jeremy.hylton | 2007-02-26 17:14:51 +0100 (Mon, 26 Feb 2007) | 2 lines Reformat long lines. ........ r53947 | neal.norwitz | 2007-02-26 18:01:08 +0100 (Mon, 26 Feb 2007) | 1 line Add Steven Bethard to help out with patches. ........ r53949 | georg.brandl | 2007-02-26 18:09:03 +0100 (Mon, 26 Feb 2007) | 3 lines Fix typo. ........ r53951 | neal.norwitz | 2007-02-26 19:10:47 +0100 (Mon, 26 Feb 2007) | 5 lines Fix a couple of problems in generating the AST code: * use %r instead of backticks since backticks are going away in Py3k * PyArena_Malloc() already sets PyErr_NoMemory so we don't need to do it again * the signature for ast2obj_int incorrectly used a bool, rather than a long ........
author Thomas Wouters <thomas@python.org>
date Mon, 26 Feb 2007 18:20:15 +0000
parents 93f582803733
children 4b9d0dac79cc
comparison
equal deleted inserted replaced
40933:a2629be1b1d0 40937:6aa1be5dd009
4075 metaclass = PyDict_GetItemString(g, "__metaclass__"); 4075 metaclass = PyDict_GetItemString(g, "__metaclass__");
4076 if (metaclass == NULL) 4076 if (metaclass == NULL)
4077 metaclass = (PyObject *) &PyType_Type; 4077 metaclass = (PyObject *) &PyType_Type;
4078 Py_INCREF(metaclass); 4078 Py_INCREF(metaclass);
4079 } 4079 }
4080 result = PyObject_CallFunctionObjArgs(metaclass, name, bases, methods, NULL); 4080 result = PyObject_CallFunctionObjArgs(metaclass, name, bases, methods,
4081 NULL);
4081 Py_DECREF(metaclass); 4082 Py_DECREF(metaclass);
4082 if (result == NULL && PyErr_ExceptionMatches(PyExc_TypeError)) { 4083 if (result == NULL && PyErr_ExceptionMatches(PyExc_TypeError)) {
4083 /* A type error here likely means that the user passed 4084 /* A type error here likely means that the user passed
4084 in a base that was not a class (such the random module 4085 in a base that was not a class (such the random module
4085 instead of the random.random type). Help them out with 4086 instead of the random.random type). Help them out with
4089 4090
4090 PyErr_Fetch(&ptype, &pvalue, &ptraceback); 4091 PyErr_Fetch(&ptype, &pvalue, &ptraceback);
4091 if (PyString_Check(pvalue)) { 4092 if (PyString_Check(pvalue)) {
4092 PyObject *newmsg; 4093 PyObject *newmsg;
4093 newmsg = PyString_FromFormat( 4094 newmsg = PyString_FromFormat(
4094 "Error when calling the metaclass bases\n %s", 4095 "Error when calling the metaclass bases\n"
4096 " %s",
4095 PyString_AS_STRING(pvalue)); 4097 PyString_AS_STRING(pvalue));
4096 if (newmsg != NULL) { 4098 if (newmsg != NULL) {
4097 Py_DECREF(pvalue); 4099 Py_DECREF(pvalue);
4098 pvalue = newmsg; 4100 pvalue = newmsg;
4099 } 4101 }