diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-01-05 08:49:04 +0100 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2016-01-15 13:39:52 +0100 |
commit | 7e56b4bbd79d9d42af23babc7496dd15d85d28ea (patch) | |
tree | 3716b9a6747789dd37554bd7e2fb5b49ef193e1e /ipalib/cli.py | |
parent | 58c42ddac0964a8cce7c1e1faa7516da53f028ad (diff) | |
download | freeipa-7e56b4bbd79d9d42af23babc7496dd15d85d28ea.tar.gz freeipa-7e56b4bbd79d9d42af23babc7496dd15d85d28ea.tar.xz freeipa-7e56b4bbd79d9d42af23babc7496dd15d85d28ea.zip |
ipapython: remove default_encoding_utf8
Replace the "import default_encoding_utf8" in ipalib/cli.py with equivalent
Python code.
https://fedorahosted.org/freeipa/ticket/5596
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r-- | ipalib/cli.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index 3b1b5a393..a95648533 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -39,16 +39,9 @@ from six.moves import input if six.PY3: unicode = str -try: - #pylint: disable=F0401 - import default_encoding_utf8 # pylint: disable=unused-import -except ImportError: - # This is a chicken-and-egg problem. The api can't be imported unless - # this is already installed and since it is installed with IPA therein - # lies the problem. Skip it for now so ipalib can be imported in-tree - # even in cases that IPA isn't installed on the dev machine. - # Also, under Python 3, default_encoding_utf8 is not built at all. - pass +if six.PY2: + reload(sys) + sys.setdefaultencoding('utf-8') # pylint: disable=no-member from ipalib import frontend from ipalib import backend |