summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bechtold <tbechtold@suse.com>2015-04-18 13:10:29 +0200
committerThomas Bechtold <tbechtold@suse.com>2015-04-18 13:12:20 +0200
commit3b138fe97daa37f3f92d999963f4f75dfab7c090 (patch)
treee23cf845790f02230e129fa3edb7d5a2adaf6cd8
parentf558d9e707ba85200f8b6157086069e05e142a41 (diff)
downloadcliff-3b138fe97daa37f3f92d999963f4f75dfab7c090.tar.gz
Catch and ignore error when locale can not be set1.11.0
Change-Id: I35485a360d54b3b692b7a7184827335bf64e6472 Closes-Bug: #1445760
-rw-r--r--cliff/app.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cliff/app.py b/cliff/app.py
index 9427634..a6db1f1 100644
--- a/cliff/app.py
+++ b/cliff/app.py
@@ -80,7 +80,10 @@ class App(object):
self.interpreter = None
def _set_streams(self, stdin, stdout, stderr):
- locale.setlocale(locale.LC_ALL, '')
+ try:
+ locale.setlocale(locale.LC_ALL, '')
+ except locale.Error:
+ pass
if sys.version_info[:2] == (2, 6):
# Configure the input and output streams. If a stream is
# provided, it must be configured correctly by the