Skip to content

Commit

Permalink
Let match function return a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
dktrkranz committed Sep 25, 2021
1 parent c546679 commit 6171088
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Debomatic/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def __init__(self, build, package, version, distribution, queue):

def __enter__(self):
for task in self._queue:
if (self._package == task._package and
self._version == task._version and
self._distribution == task._distribution):
if self.match(task._package, task._version, task._distribution):
info(_('Build already scheduled for '
'package %(package)s_%(version)s in %(dist)s') %
{'package': self._package, 'version': self._version,
Expand Down Expand Up @@ -88,10 +86,9 @@ def set_pid(self, pid):
self._pid = 0

def match(self, package, version, distribution):
if (self._package == package and
return (self._package == package and
self._version == version and
self._distribution == distribution):
return self
self._distribution == distribution)


class Build:
Expand Down

0 comments on commit 6171088

Please sign in to comment.