Closed Bug 1259354 Opened 4 years ago Closed 4 years ago
"checking yasm version" still written out when we actually don't do the check
MozReview Request: Bug 1259354 - Avoid "checking yasm version" being written out when yasm was not found. r?ted
58 bytes, text/x-review-board-request
No description provided.
The reason the "checking" string always appears is that @depends functions are always called, regardless of the value of the dependency. This introduces a new decorator @depends_true, which works like @depends, but the decorated function is not called unless one of the dependency value resolves to True. The new decorator can also be used to replace many cases where we do @depends(foo) def bar(foo): if foo: ... Review commit: https://reviewboard.mozilla.org/r/42145/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/42145/
Attachment #8734255 - Flags: review?(ted)
Comment on attachment 8734255 [details] MozReview Request: Bug 1259354 - Avoid "checking yasm version" being written out when yasm was not found. r?ted https://reviewboard.mozilla.org/r/42145/#review38715 ::: build/moz.configure/util.configure:138 (Diff revision 1) > + > + > +# Like @depends, but the decorated function is only called if one of the > +# arguments it would be called with has a positive value (bool(value) is True) > +@template > +def depends_true(*args): Bikeshed: I think this might read more nicely as `depends_if`.
Attachment #8734255 - Flags: review?(ted) → review+
You need to log in before you can comment on or make changes to this bug.