Skip to content

Commit

Permalink
Make set step by step; Fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyX committed Nov 15, 2014
1 parent 604ca7e commit 06c46a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tracer/resources/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ def newer_than(self, timestamp):
return self.filtered(lambda process: process.create_time >= timestamp)

def unique(self):
return ProcessesCollection(set(self))
unique = set()
for process in self:
try: unique.add(process)
except NoSuchProcess: pass
return ProcessesCollection(unique)

def filtered(self, function):
processes = ProcessesCollection()
Expand Down

0 comments on commit 06c46a9

Please sign in to comment.