From: David Howells Date: Wed, 9 Apr 2014 20:25:30 +0000 (+0100) Subject: rxgen: Anchor kafs.RemoteAbort class to module X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6d5293b747335a647895206d15b0247f8567378c;p=users%2Fdhowells%2Fkafs-utils.git rxgen: Anchor kafs.RemoteAbort class to module Anchor the kafs.RemoteAbort exception class to module so that it can be referred to by name from scripts. Signed-off-by: David Howells --- diff --git a/rxgen/emit_py_module.pm b/rxgen/emit_py_module.pm index 8830730..5e8efe0 100644 --- a/rxgen/emit_py_module.pm +++ b/rxgen/emit_py_module.pm @@ -97,6 +97,8 @@ sub emit_py_module() { print PYOUT "\tkafs_remote_abort = PyErr_NewException(\"kafs.RemoteAbort\", NULL, NULL);\n"; print PYOUT "\tif (!kafs_remote_abort)\n"; print PYOUT "\t\treturn NULL;\n"; + print PYOUT "\tPy_INCREF(kafs_remote_abort);\n"; + print PYOUT "\tPyModule_AddObject(m, \"RemoteAbort\", kafs_remote_abort);\n"; print PYOUT "\n"; print PYOUT "\treturn m;\n";