From f7cb2e4bd4cd6e59e5ada3119f63dfd811551d23 Mon Sep 17 00:00:00 2001 From: erpalma Date: Wed, 22 Aug 2018 12:07:42 +0200 Subject: [PATCH] fix #38 --- lenovo_fix.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lenovo_fix.py b/lenovo_fix.py index 4251010..6e326c1 100755 --- a/lenovo_fix.py +++ b/lenovo_fix.py @@ -12,15 +12,11 @@ import sys from collections import defaultdict from dbus.mainloop.glib import DBusGMainLoop from errno import EACCES, EPERM +from gi.repository import GLib from mmio import MMIO, MMIOError from multiprocessing import cpu_count from threading import Event, Thread -try: - from gi.repository import GObject -except ImportError: - import gobject as GObject - SYSFS_POWER_PATH = '/sys/class/power_supply/AC/online' VOLTAGE_PLANES = { @@ -418,8 +414,7 @@ def main(): path="/org/freedesktop/UPower/devices/line_power_AC") try: - GObject.threads_init() - loop = GObject.MainLoop() + loop = GLib.MainLoop() loop.run() except (KeyboardInterrupt, SystemExit): pass