mirror of
https://github.com/chubin/cheat.sh.git
synced 2026-06-20 13:16:44 +02:00
Fix search for uncached entries (#323)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user