From: Richard Marko Date: Tue, 5 Nov 2013 14:41:20 +0000 (+0100) Subject: systemd-python: convert keyword value to string X-Git-Tag: v209~1571 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=8ff8ee837357c54bb8845df2c7a30ec05da02367 systemd-python: convert keyword value to string Allows using journal.send('msg', PRIORITY=journal.LOG_CRIT) Before this commit this results in TypeError: cannot concatenate 'str' and 'int' objects and requires passing PRIORITY value as string to work. --- diff --git a/src/python-systemd/journal.py b/src/python-systemd/journal.py index d0bcd24d1..9c7e0045e 100644 --- a/src/python-systemd/journal.py +++ b/src/python-systemd/journal.py @@ -352,6 +352,8 @@ def get_catalog(mid): def _make_line(field, value): if isinstance(value, bytes): return field.encode('utf-8') + b'=' + value + elif isinstance(value, int): + return field + '=' + str(value) else: return field + '=' + value