From c9e6fb195c5053aec5573856ecc4522264e5a1a3 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 16 Apr 2014 08:18:07 +0100 Subject: [PATCH] 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 --- rxgen/emit_py_sync_funcs.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"; -- 2.49.0