From 7040ea6b2ea7cbee1cab8d58a61185b268c0dd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 21 May 2018 02:39:29 +0200 Subject: [PATCH] Move module calls into init On Linux ctypes has not attr windll, move it into the __init__() so it does not get evaluatet on module import --- gajim/common/idle.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gajim/common/idle.py b/gajim/common/idle.py index 8b00bef4e..97eeb9276 100644 --- a/gajim/common/idle.py +++ b/gajim/common/idle.py @@ -145,14 +145,13 @@ class XssIdleMonitor: class WindowsIdleMonitor: - - OpenInputDesktop = ctypes.windll.user32.OpenInputDesktop - CloseDesktop = ctypes.windll.user32.CloseDesktop - SystemParametersInfo = ctypes.windll.user32.SystemParametersInfoW - GetTickCount = ctypes.windll.kernel32.GetTickCount - GetLastInputInfo = ctypes.windll.user32.GetLastInputInfo - def __init__(self): + self.OpenInputDesktop = ctypes.windll.user32.OpenInputDesktop + self.CloseDesktop = ctypes.windll.user32.CloseDesktop + self.SystemParametersInfo = ctypes.windll.user32.SystemParametersInfoW + self.GetTickCount = ctypes.windll.kernel32.GetTickCount + self.GetLastInputInfo = ctypes.windll.user32.GetLastInputInfo + class LASTINPUTINFO(ctypes.Structure): _fields_ = [('cbSize', ctypes.c_uint), ('dwTime', ctypes.c_uint)]