Commit 7c5eb76c authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

Unrolled dict comprehension for python 2.6 compatibility. fix #2161

parent fda75422
......@@ -845,9 +845,14 @@ class WatchSubscriber(object): # this should never be instanced manually
if not self.pattern or self.pattern.pattern != pattern:
self.pattern = re.compile(pattern)
self.reverse = reverse
self.subject_buffer = {event: [
subject for subject in subjects if bool(self.pattern.search(subject)) == self.reverse
] for event, subjects in self.subject_buffer.items()}
old_subject_buffer = self.subject_buffer
self.subject_buffer = {}
for event, subjects in old_subject_buffer.items():
new_subject_list = [
subject for subject in subjects if bool(self.pattern.search(subject)) == self.reverse
]
if len(new_subject_list):
self.subject_buffer[event] = new_subject_list
else:
self.pattern = None
self.reverse = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment