[GTK] Remove PyGIWarning in gtk3/files_tab.py
Remove warning: PyGIWarning: Gtk was imported without specifying a version first
This commit is contained in:
parent
034db27936
commit
3427ae4b90
|
@ -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()
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue