python-syslogssl
python-syslogssl copied to clipboard
compatability with python3
I encountered two issues when using this extension with python3:
1. NameError: name 'unicode' is not defined
Referencing here, python3 has renamed the unicode type to str. It'll work with python3 by adding this:
import sys
if sys.version_info[0] >= 3:
unicode = str
2. TypeError: can only concatenate str (not "bytes") to str
Another error appeared after adding no.1. prio is in string format and can't be concatenated with msg that is in bytes. To fix it, we have to also convert prio to bytes.