[PATCH] inotify: _inotify.c: bugfix: remove_watch has to return PyNone on success

Nicolas Dumazet nicdumz at gmail.com
Fri Sep 4 16:40:14 CDT 2009


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1251366921 -7200
# Node ID 545f9f3f5273d9955f200c5146d12024063bf143
# Parent  7345fa5e572e029362bc6f2f96af452607ebb1ff
inotify: _inotify.c: bugfix: remove_watch has to return PyNone on success

We are not currently using that API function in inotify, hence the reason
for the "silent" bug. But returning NULL here causes the interpreter to crash.
Let's keep code clean for reusers :)

diff --git a/hgext/inotify/linux/_inotify.c b/hgext/inotify/linux/_inotify.c
--- a/hgext/inotify/linux/_inotify.c
+++ b/hgext/inotify/linux/_inotify.c
@@ -123,6 +123,7 @@
 	goto bail;
     }
 
+    ret = Py_None;
     Py_INCREF(Py_None);
 
     goto done;


More information about the Mercurial-devel mailing list