Browse Source

Merge pull request #1084 from moon2l/master

fix bug: TypeError: set(['bing', 'google']) is not JSON serializable,…
Adam Tauber 7 years ago
parent
commit
5ceaf21399
No account linked to committer's email
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      searx/webapp.py

+ 2
- 1
searx/webapp.py View File

541
                                     'corrections': list(result_container.corrections),
541
                                     'corrections': list(result_container.corrections),
542
                                     'infoboxes': result_container.infoboxes,
542
                                     'infoboxes': result_container.infoboxes,
543
                                     'suggestions': list(result_container.suggestions),
543
                                     'suggestions': list(result_container.suggestions),
544
-                                    'unresponsive_engines': list(result_container.unresponsive_engines)}),
544
+                                    'unresponsive_engines': list(result_container.unresponsive_engines)},
545
+                                   default=lambda item: list(item) if isinstance(item, set) else item),
545
                         mimetype='application/json')
546
                         mimetype='application/json')
546
     elif output_format == 'csv':
547
     elif output_format == 'csv':
547
         csv = UnicodeWriter(StringIO())
548
         csv = UnicodeWriter(StringIO())