Fix multiple Python 3 compatibility issues

Changes in Python 3 that made the code choke:

  o basestring is merged into str
  o print() needs parentesis
  o Class inheritance syntax changed
  o Abstract baseclass (ABCMeta) syntax changed
  o map.iteritems() is replaced by map.items()
  o Inconsistent use of tabs and spaces are no longer tolerated

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-03-10 16:38:59 +01:00
commit 6dd594d47b
8 changed files with 44 additions and 32 deletions

View file

@ -3,7 +3,13 @@ import syslog
import sys
import inspect
from os.path import basename
import misc
from . import misc
# --- python 2 / 3 compatibility stuff
try:
basestring
except NameError:
basestring = str
EMERG = syslog.LOG_EMERG
ALERT = syslog.LOG_ALERT