summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpython2/pyinotify.py5
-rwxr-xr-xpython3/pyinotify.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py
index 2e562f5..1372951 100755
--- a/python2/pyinotify.py
+++ b/python2/pyinotify.py
@@ -1575,6 +1575,9 @@ class Watch:
Represent a watch, i.e. a file or directory being watched.
"""
+ __slots__ = ('wd', 'path', 'mask', 'proc_fun', 'auto_add',
+ 'exclude_filter', 'dir')
+
def __init__(self, wd, path, mask, proc_fun, auto_add, exclude_filter):
"""
Initializations.
@@ -1611,7 +1614,7 @@ class Watch:
output_format.punctuation('='),
output_format.field_value(getattr(self,
attr))) \
- for attr in self.__dict__ if not attr.startswith('_')])
+ for attr in self.__slots__ if not attr.startswith('_')])
s = '%s%s %s %s' % (output_format.punctuation('<'),
output_format.class_name(self.__class__.__name__),
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index 858ab42..fcc1e79 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -1519,6 +1519,9 @@ class Watch:
Represent a watch, i.e. a file or directory being watched.
"""
+ __slots__ = ('wd', 'path', 'mask', 'proc_fun', 'auto_add',
+ 'exclude_filter', 'dir')
+
def __init__(self, wd, path, mask, proc_fun, auto_add, exclude_filter):
"""
Initializations.
@@ -1555,7 +1558,7 @@ class Watch:
output_format.punctuation('='),
output_format.field_value(getattr(self,
attr))) \
- for attr in self.__dict__ if not attr.startswith('_')])
+ for attr in self.__slots__ if not attr.startswith('_')])
s = '%s%s %s %s' % (output_format.punctuation('<'),
output_format.class_name(self.__class__.__name__),