From a828ef4cb5ee60e448a95bb746a55fb476b1c575 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 28 Oct 2011 17:12:11 -0700 Subject: Use bytes instead of unicode with isinstance. This is preferred since the bytes type is available in all supported python versions, while the unicode type is only available in python2. --- pym/portage/elog/mod_syslog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pym/portage/elog') diff --git a/pym/portage/elog/mod_syslog.py b/pym/portage/elog/mod_syslog.py index 79b11a68c..64558410d 100644 --- a/pym/portage/elog/mod_syslog.py +++ b/pym/portage/elog/mod_syslog.py @@ -23,7 +23,7 @@ def process(mysettings, key, logentries, fulltext): for msgtype,msgcontent in logentries[phase]: for line in msgcontent: line = "%s: %s: %s" % (key, phase, line) - if sys.hexversion < 0x3000000 and isinstance(line, unicode): + if sys.hexversion < 0x3000000 and not isinstance(line, bytes): # Avoid TypeError from syslog.syslog() line = line.encode(_encodings['content'], 'backslashreplace') -- cgit v1.2.3-1-g7c22