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>
This commit is contained in:
Jan Cholasta authored and Tomas Babej committed 2016-01-15 13:39:52 +01:00
1 parent 58c42ddac0
commit 7e56b4bbd7
8 files changed
+4 -142

No files matched your search

+3 -10
View File
@@ -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