diff options
author | Sebastien Martini <seb@dbzteam.org> | 2009-11-11 18:24:56 +0100 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2009-11-11 18:24:56 +0100 |
commit | 982496fdfabbb471117b55eaad0934d75d2506d1 (patch) | |
tree | f2acf5644fe8932a0f25fdbbd62c77c7b425e00c /python3 | |
parent | add26a10a28661d88710c99d10a1cf2065c06d04 (diff) | |
download | pyinotify-982496fdfabbb471117b55eaad0934d75d2506d1.tar.gz |
Improved handling of not guaranteed event attributes.
Diffstat (limited to 'python3')
-rwxr-xr-x | python3/pyinotify.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python3/pyinotify.py b/python3/pyinotify.py index d3c5013..bce5039 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -527,7 +527,9 @@ class Event(_Event): else: self.pathname = os.path.abspath(self.path) except AttributeError as err: - log.error(err) + # Usually it is not an error some events are perfectly valids + # despite the lack of these attributes. + log.debug(err) class ProcessEventError(PyinotifyError): @@ -1903,6 +1905,8 @@ class WatchManager: mask |= IN_CREATE | IN_DELETE def cmp_name(event): + if getattr(event, 'name') is None: + return False return basename == event.name return self.add_watch(dirname, mask, proc_fun=proc_class(ChainIfTrue(func=cmp_name)), |