]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
rxgen: Anchor kafs.RemoteAbort class to module
authorDavid Howells <dhowells@redhat.com>
Wed, 9 Apr 2014 20:25:30 +0000 (21:25 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 9 Apr 2014 20:25:30 +0000 (21:25 +0100)
Anchor the kafs.RemoteAbort exception class to module so that it can be
referred to by name from scripts.

Signed-off-by: David Howells <dhowells@redhat.com>
rxgen/emit_py_module.pm

index 88307304ba5375c63a26bebff746c49c2ede82d4..5e8efe099741a238c5007d9787f9767dcbabee3b 100644 (file)
@@ -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";