From cd3221baf68ed4ea13c9793ada96952cbdfefb43 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 21 Dec 2009 19:41:31 +0000 Subject: [PATCH] Fix exceptions when gettext/locale cannot be initialized properly --- deluge/core/daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deluge/core/daemon.py b/deluge/core/daemon.py index 90bfb79b0..a943ac71d 100644 --- a/deluge/core/daemon.py +++ b/deluge/core/daemon.py @@ -105,6 +105,8 @@ class Daemon(object): gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n")) except Exception, e: log.error("Unable to initialize gettext/locale: %s", e) + import __builtin__ + __builtin__.__dict__["_"] = lambda x: x # Twisted catches signals to terminate, so just have it call the shutdown # method.