From 4f3dfa69bc214e7e734b506f8e8379f8dd6269b3 Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Mon, 26 Feb 2007 18:20:15 +0000 Subject: 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 ........ --- Parser/asdl_c.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Parser') diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 082f232796..4877853dea 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -299,10 +299,8 @@ class FunctionVisitor(PrototypeVisitor): emit('}', 1) emit("p = (%s)PyArena_Malloc(arena, sizeof(*p));" % ctype, 1); - emit("if (!p) {", 1) - emit("PyErr_NoMemory();", 2) + emit("if (!p)", 1) emit("return NULL;", 2) - emit("}", 1) if union: self.emit_body_union(name, args, attrs) else: @@ -474,7 +472,7 @@ static PyObject* ast2obj_bool(bool b) return PyBool_FromLong(b); } -static PyObject* ast2obj_int(bool b) +static PyObject* ast2obj_int(long b) { return PyInt_FromLong(b); } -- cgit v1.2.1