]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
rxgen: Use PyErr_NoMemory() rather than PyExc_MemoryError
authorDavid Howells <dhowells@redhat.com>
Wed, 16 Apr 2014 07:18:07 +0000 (08:18 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 16 Apr 2014 07:18:07 +0000 (08:18 +0100)
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 <dhowells@redhat.com>
rxgen/emit_py_sync_funcs.pm

index 76f104fc89bac78daae361c15e9cb22101040e84..ebc93d2140b206bdcb90f41720d1f621458aaabc 100644 (file)
@@ -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";