mirror of
https://github.com/chubin/cheat.sh
synced 2024-11-10 05:24:13 +00:00
Fix search for uncached entries (#323)
This commit is contained in:
parent
717f89e0c2
commit
742dd9f452
1 changed files with 5 additions and 0 deletions
|
@ -103,6 +103,11 @@ def find_answers_by_keyword(directory, keyword, options="", request_options=None
|
|||
answer_dicts = get_answers(topic, request_options=request_options)
|
||||
for answer_dict in answer_dicts:
|
||||
answer_text = answer_dict.get('answer', '')
|
||||
# Temporary hotfix:
|
||||
# In some cases answer_text may be 'bytes' and not 'str'
|
||||
if type(b"") == type(answer_text):
|
||||
answer_text = answer_text.decode("utf-8")
|
||||
|
||||
if match(answer_text, keyword, options_dict=options_dict):
|
||||
answers_found.append(answer_dict)
|
||||
|
||||
|
|
Loading…
Reference in a new issue