summaryrefslogtreecommitdiffstats
path: root/pym/portage/elog
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-28 17:12:11 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-28 17:12:11 -0700
commita828ef4cb5ee60e448a95bb746a55fb476b1c575 (patch)
treed9832e8bfae8c266da28d72e665f5d3c165e52f3 /pym/portage/elog
parent967bc855b7e4db529afbe8b7bf7f8ed7ea55858a (diff)
downloadportage-a828ef4cb5ee60e448a95bb746a55fb476b1c575.tar.gz
portage-a828ef4cb5ee60e448a95bb746a55fb476b1c575.tar.bz2
portage-a828ef4cb5ee60e448a95bb746a55fb476b1c575.zip
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.
Diffstat (limited to 'pym/portage/elog')
-rw-r--r--pym/portage/elog/mod_syslog.py2
1 files changed, 1 insertions, 1 deletions
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')