diff options
author | Joerg Behrmann <behrmann@physik.fu-berlin.de> | 2022-04-14 15:08:02 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-02-11 14:39:52 +0100 |
commit | 802c8dcaa3096719be0a1c121e747b2681ad31dc (patch) | |
tree | 4c859504bb703aac066ae635c24f7fa17f1a7d2c /systemd/journal.py | |
parent | 7e3313a15b83400f00d3891f16e0f85f19cb3862 (diff) | |
download | python-systemd-802c8dcaa3096719be0a1c121e747b2681ad31dc.tar.gz |
treewide: remove python 2 support and assume we have python 3.3+
Diffstat (limited to 'systemd/journal.py')
-rw-r--r-- | systemd/journal.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/systemd/journal.py b/systemd/journal.py index 9d33fa8..0de5a7f 100644 --- a/systemd/journal.py +++ b/systemd/journal.py @@ -34,14 +34,9 @@ from ._reader import (_Reader, NOP, APPEND, INVALIDATE, LOCAL_ONLY, RUNTIME_ONLY, SYSTEM, SYSTEM_ONLY, CURRENT_USER, OS_ROOT, - _get_catalog) + _get_catalog, Monotonic) from . import id128 as _id128 -if _sys.version_info >= (3,): - from ._reader import Monotonic -else: - Monotonic = tuple - def _convert_monotonic(m): return Monotonic((_datetime.timedelta(microseconds=m[0]), @@ -66,11 +61,10 @@ def _convert_timestamp(s): def _convert_trivial(x): return x -if _sys.version_info >= (3,): - def _convert_uuid(s): - return _uuid.UUID(s.decode()) -else: - _convert_uuid = _uuid.UUID + +def _convert_uuid(s): + return _uuid.UUID(s.decode()) + DEFAULT_CONVERTERS = { 'MESSAGE_ID': _convert_uuid, @@ -222,9 +216,6 @@ class Reader(_Reader): else: raise StopIteration() - if _sys.version_info < (3,): - next = __next__ - def add_match(self, *args, **kwargs): """Add one or more matches to the filter journal log entries. |