[GTK] Remove PyGIWarning in gtk3/files_tab.py

Remove warning: PyGIWarning: Gtk was imported without specifying a version first
This commit is contained in:
bendikro 2020-04-12 19:24:34 +02:00 committed by Calum Lind
parent 034db27936
commit 3427ae4b90
2 changed files with 9 additions and 1 deletions

View File

@ -24,7 +24,8 @@ try:
from deluge.ui.gtk3.files_tab import FilesTab
from deluge.ui.gtk3.gtkui import DEFAULT_PREFS
from deluge.ui.gtk3.mainwindow import MainWindow
except ImportError:
except (ImportError, ValueError):
# gi.require_version gives ValueError if library not available
libs_available = False
setup_translation()

View File

@ -13,15 +13,22 @@ import json
import logging
import os.path
import gi # isort:skip (Required before Gtk import).
gi.require_version('Gtk', '3.0') # NOQA: E402
# isort:imports-thirdparty
from gi.repository import Gio, Gtk
from gi.repository.Gdk import DragAction, ModifierType, keyval_name
from gi.repository.GObject import TYPE_UINT64
# isort:imports-firstparty
import deluge.component as component
from deluge.common import open_file, show_file
from deluge.ui.client import client
from deluge.ui.common import FILE_PRIORITY
# isort:imports-localfolder
from .common import (
listview_replace_treestore,
load_pickled_state_file,