]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: don't encode unicode strings
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 4 May 2016 13:06:26 +0000 (16:06 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 May 2016 06:26:43 +0000 (07:26 +0100)
Removed check for unicode type as it doesn't work in Python 3.
This check is not needed for wic as all its output seem to be
strings. This allows to run code under both pythons.

[YOCTO #9412]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/msger.py

index 2340ac2f1093e44a08aee06ab25c8b19063171c9..4d8e704172fcead87d6b1f16874a334eacba4b52 100644 (file)
@@ -66,10 +66,6 @@ def _general_print(head, color, msg=None, stream=None, level='normal'):
         # skip
         return
 
-    # encode raw 'unicode' str to utf8 encoded str
-    if msg and isinstance(msg, unicode):
-        msg = msg.encode('utf-8', 'ignore')
-
     errormsg = ''
     if CATCHERR_BUFFILE_FD > 0:
         size = os.lseek(CATCHERR_BUFFILE_FD, 0, os.SEEK_END)
@@ -118,9 +114,6 @@ def _color_print(head, color, msg, stream, level):
                 newline = True
 
     if msg is not None:
-        if isinstance(msg, unicode):
-            msg = msg.encode('utf8', 'ignore')
-
         stream.write('%s%s' % (head, msg))
         if newline:
             stream.write('\n')