commit: 46ffaeaee872aa71b5e83133ccb3a2a3ea3efc03 Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org> AuthorDate: Thu Dec 4 20:41:10 2014 +0000 Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org> CommitDate: Thu Dec 4 20:41:10 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=46ffaeae
output.py: Removes check for encoding output strings In py2.7 when trying to view an overlay info it will cause a runtime error if the string isn't encoded properly. So output.py will now indiscriminately encode all string values. X-Gentoo-Bug: 530064 X-Gentoo-Bug-URL: https://bugs.gentoo.org/530064 --- layman/output.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/layman/output.py b/layman/output.py index 21a7d6c..b22d33e 100644 --- a/layman/output.py +++ b/layman/output.py @@ -133,8 +133,7 @@ class Message(MessageBase): """empty debug function, does nothing, declared here for compatibility with DebugMessage """ - if type(info) != str:#not in types.StringTypes: - info = encode(info) + info = encode(info) if level > self.debug_lev: return @@ -153,8 +152,7 @@ class Message(MessageBase): def info (self, info, level = INFO_LEVEL): - if type(info) != str:#not in types.StringTypes: - info = encode(info) + info = encode(info) if level > self.info_lev: return @@ -165,8 +163,7 @@ class Message(MessageBase): def status (self, message, status, info = 'ignored'): - if type(message) != str:#not in types.StringTypes: - message = encode(message) + message = encode(message) lines = message.split('\n') @@ -194,8 +191,7 @@ class Message(MessageBase): def warn (self, warn, level = WARN_LEVEL): - if type(warn) != str:#not in types.StringTypes: - warn = encode(warn) + warn = encode(warn) if level > self.warn_lev: return @@ -206,8 +202,7 @@ class Message(MessageBase): def error (self, error, level = None): - if type(error) != str:#not in types.StringTypes: - error = encode(error) + error = encode(error) for i in error.split('\n'): # NOTE: Forced flushing ensures that stdout and stderr @@ -222,8 +217,7 @@ class Message(MessageBase): def die (self, error): - if type(error) != str:#not in types.StringTypes: - error = encode(error) + error = encode(error) for i in error.split('\n'): self.error(self.color_func('red', 'Fatal error: ') + i)
