From 722cce1b6b1f953e0a99e6860917e7c0fe93235b Mon Sep 17 00:00:00 2001 From: Sebastien Martini Date: Wed, 19 May 2010 15:25:58 +0200 Subject: Reverts previous commit for the following reasons: - Preserve backward compatibility; - Returning a dictionary with all the iterated directories for which ENOSPC was raised gives the information these directories existed and were iterated and something wrong happened, it is useful information; - It is definitively developer's responsibility to check a given subtree is not too deep or that max_user_watches is not large enough before calling add_watch(). This reverts commit be91bfbbe7a849952b2fe61a49205d66fb5c850c. --- python2/pyinotify.py | 7 ------- python3/pyinotify.py | 5 ----- 2 files changed, 12 deletions(-) diff --git a/python2/pyinotify.py b/python2/pyinotify.py index 6f24a3f..3ff0f05 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -1646,8 +1646,6 @@ class WatchManager: If |path| si already watched it is ignored, but if it is called with option rec=True a watch is put on each one of its not-watched subdirectory. - This method returns immediately on first ENOSPC error encountered - (see http://trac.dbzteam.org/pyinotify/wiki/FrequentlyAskedQuestions). @param path: Path to watch, the path can either be a file or a directory. Also accepts a sequence (list) of paths. @@ -1709,11 +1707,6 @@ class WatchManager: err = err % (rpath, wd, STRERRNO()) if quiet: log.error(err) - if (sys.version_info[0] >= 2 and - sys.version_info[1] >= 6 and - errno.ENOSPC == ctypes.get_errno()): - # In this case return immediately - return ret_ else: raise WatchManagerError(err, ret_) else: diff --git a/python3/pyinotify.py b/python3/pyinotify.py index c3b7626..c3de72a 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -1593,8 +1593,6 @@ class WatchManager: If |path| is already watched it is ignored, but if it is called with option rec=True a watch is put on each one of its not-watched subdirectory. - This method returns immediately on first ENOSPC error encountered - (see http://trac.dbzteam.org/pyinotify/wiki/FrequentlyAskedQuestions). @param path: Path to watch, the path can either be a file or a directory. Also accepts a sequence (list) of paths. @@ -1660,9 +1658,6 @@ class WatchManager: err = err % (rpath, wd, STRERRNO()) if quiet: log.error(err) - if errno.ENOSPC == ctypes.get_errno(): - # In this case return immediately - return ret_ else: raise WatchManagerError(err, ret_) else: -- cgit v1.2.1