mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
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.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
889a90422d
commit
8ff8ee8373
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user