From: David Howells Date: Wed, 16 Apr 2014 07:18:07 +0000 (+0100) Subject: rxgen: Use PyErr_NoMemory() rather than PyExc_MemoryError X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c9e6fb195c5053aec5573856ecc4522264e5a1a3;p=users%2Fdhowells%2Fkafs-utils.git rxgen: Use PyErr_NoMemory() rather than PyExc_MemoryError Use PyErr_NoMemory() rather than PyExc_MemoryError as the former actually raises an exception. The latter is just a class and is then just an object with no special meaning when returned. Signed-off-by: David Howells --- diff --git a/rxgen/emit_py_sync_funcs.pm b/rxgen/emit_py_sync_funcs.pm index 76f104f..ebc93d2 100644 --- a/rxgen/emit_py_sync_funcs.pm +++ b/rxgen/emit_py_sync_funcs.pm @@ -328,7 +328,7 @@ sub emit_py_func_simple_sync_call($) print PYOUT "\n"; print PYOUT "\tcall = rxrpc_alloc_call(z_conn->x, 0);\n"; print PYOUT "\tif (!call)\n"; - print PYOUT "\t\treturn PyExc_MemoryError;\n"; + print PYOUT "\t\treturn PyErr_NoMemory();\n"; # Marshal the arguments print PYOUT "\n"; @@ -405,7 +405,7 @@ sub emit_py_func_simple_sync_call($) print PYOUT "error_no_res:\n"; print PYOUT "\tif (errno == ENOMEM)\n"; print PYOUT "enomem:\n"; - print PYOUT "\t\tres = PyExc_MemoryError;\n"; + print PYOUT "\t\tres = PyErr_NoMemory();\n"; print PYOUT "\telse if (errno == ECONNABORTED)\n"; print PYOUT "\t\tres = py_rxgen_received_abort(call);\n"; print PYOUT "\telse\n";