From 3282e62ff92f1c2158cb169d2a21a5988766450c Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Tue, 27 Jan 2015 22:39:25 +0100 Subject: [PATCH] Searchcode engines corrections --- searx/engines/searchcode_code.py | 2 +- searx/engines/searchcode_doc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/engines/searchcode_code.py b/searx/engines/searchcode_code.py index 655818da2..f276697b1 100644 --- a/searx/engines/searchcode_code.py +++ b/searx/engines/searchcode_code.py @@ -42,7 +42,7 @@ def response(resp): search_results = loads(resp.text) # parse results - for result in search_results['results']: + for result in search_results.get('results', []): href = result['url'] title = "" + result['name'] + " - " + result['filename'] repo = result['repo'] diff --git a/searx/engines/searchcode_doc.py b/searx/engines/searchcode_doc.py index b5b7159be..76da8d752 100644 --- a/searx/engines/searchcode_doc.py +++ b/searx/engines/searchcode_doc.py @@ -35,7 +35,7 @@ def response(resp): search_results = loads(resp.text) # parse results - for result in search_results['results']: + for result in search_results.get('results', []): href = result['url'] title = "[" + result['type'] + "] " +\ result['namespace'] +\