Skip to content

Commit

Permalink
Return matched license lines in binaries #2321
Browse files Browse the repository at this point in the history
This partially reverts changes from #2226

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Nov 17, 2020
1 parent 8e4120d commit 09a6867
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/licensedcode/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,17 +540,17 @@ def matched_text(self, whole_lines=False, highlight=True,
Return the matched text for this match or an empty string if no query
exists for this match.
`_usecache` can be set to False in testsing to avoid any unwanted
caching side effects as the caching is dependent on the index being used
and the index can change when testing.
`_usecache` can be set to False in testing to avoid any unwanted caching
side effects as the caching depends on which index instance is being
used and this index can change during testing.
"""
query = self.query
if not query:
# TODO: should we raise an exception instead???
# this case should never exist except for tests!
return u''

if whole_lines and (query.has_long_lines or query.is_binary):
if whole_lines and query.has_long_lines:
whole_lines = False

return u''.join(get_full_matched_text(
Expand Down

0 comments on commit 09a6867

Please sign in to comment.