From f45badc34d5ea2657b15cc8b1e135ef39edabdec Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Thu, 26 Jun 2008 21:59:34 +0000 Subject: [PATCH] break webui if python-json is not installed --- deluge/ui/webui/json_api.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/deluge/ui/webui/json_api.py b/deluge/ui/webui/json_api.py index bc676825e..bb8ee4108 100644 --- a/deluge/ui/webui/json_api.py +++ b/deluge/ui/webui/json_api.py @@ -48,7 +48,10 @@ from deluge.log import LOG as log from deluge import component from page_decorators import check_session - +try: + import json #it's early enough to force people to install this +except: + raise Exception("please install python-json") class json_rpc: """ @@ -64,11 +67,6 @@ class json_rpc: def POST(self): web.header("Content-Type", "application/x-json") id = 0 - try: - import json #not listed in dependency's. - except: - log.error('{"error":"python-json is not installed"}') - return '{"error":"python-json is not installed"}' try: log.debug("json-data:") log.debug(webapi.data())