From 85de296cf74776175c241a338fba4dbb85c875a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Tue, 9 Aug 2011 21:40:51 +0000 Subject: [PATCH] cli: Ignore "unsupported locale setting" errors --- pisi/cli/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pisi/cli/__init__.py b/pisi/cli/__init__.py index 87722c71..d2b60789 100644 --- a/pisi/cli/__init__.py +++ b/pisi/cli/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2005-2010, TUBITAK/UEKAE +# Copyright (C) 2005-2011, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -151,7 +151,12 @@ class CLI(pisi.ui.UI): import re, tty - locale.setlocale(locale.LC_ALL, "") + try: + locale.setlocale(locale.LC_ALL, "") + except: + # Ignore "unsupported locale setting" errors + pass + yes_expr = re.compile(locale.nl_langinfo(locale.YESEXPR)) no_expr = re.compile(locale.nl_langinfo(locale.NOEXPR)) locale.setlocale(locale.LC_ALL, "C")