From 2724e6409534a948b5a2c212ae0a7192326c1b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= Date: Fri, 19 Apr 2024 23:52:23 +0200 Subject: Run 2to3 on the entire project --- src/lib/Bcfg2/Server/FileMonitor/Inotify.py | 5 +++-- src/lib/Bcfg2/Server/FileMonitor/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/lib/Bcfg2/Server/FileMonitor') diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py index 8f6e136fd..6ed938e18 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py @@ -7,6 +7,7 @@ import pyinotify from Bcfg2.Compat import reduce # pylint: disable=W0622 from Bcfg2.Server.FileMonitor import Event from Bcfg2.Server.FileMonitor.Pseudo import Pseudo +from functools import reduce class Inotify(Pseudo, pyinotify.ProcessEvent): @@ -32,7 +33,7 @@ class Inotify(Pseudo, pyinotify.ProcessEvent): #: The pyinotify event mask. We only ask for events that are #: listed in :attr:`action_map` - mask = reduce(lambda x, y: x | y, action_map.keys()) + mask = reduce(lambda x, y: x | y, list(action_map.keys())) def __init__(self): Pseudo.__init__(self) @@ -106,7 +107,7 @@ class Inotify(Pseudo, pyinotify.ProcessEvent): :type ievent: pyinotify._Event """ action = ievent.maskname - for amask, aname in self.action_map.items(): + for amask, aname in list(self.action_map.items()): if ievent.mask & amask: action = aname break diff --git a/src/lib/Bcfg2/Server/FileMonitor/__init__.py b/src/lib/Bcfg2/Server/FileMonitor/__init__.py index c10677804..0f51e0d2b 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/__init__.py +++ b/src/lib/Bcfg2/Server/FileMonitor/__init__.py @@ -327,7 +327,7 @@ class FileMonitor(Debuggable): :attr:`Bcfg2.Server.FileMonitor.FileMonitor.handles` for debugging purposes. """ rv = dict() - for watch, handler in self.handles.items(): + for watch, handler in list(self.handles.items()): rv[watch] = getattr(handler, "name", handler.__class__.__name__) return rv @@ -377,7 +377,7 @@ try: except ImportError: pass -for fdrv in reversed(sorted(available.keys(), +for fdrv in reversed(sorted(list(available.keys()), key=lambda k: available[k].__priority__)): if fdrv in available: available['default'] = available[fdrv] -- cgit v1.2.3-1-g7c22