From 7e56b4bbd79d9d42af23babc7496dd15d85d28ea Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Tue, 5 Jan 2016 08:49:04 +0100 Subject: 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 --- ipalib/cli.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'ipalib/cli.py') 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 -- cgit