Fix deprecation GObject.GError -> GLib.GError

This commit is contained in:
prculley 2019-09-13 16:35:22 -05:00 committed by Nick Hall
parent 4d0e86a2e8
commit 290d6f7287
3 changed files with 8 additions and 8 deletions

View File

@ -161,12 +161,12 @@ def image_size(source):
:returns: a tuple consisting of the width and height
"""
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib
try:
img = GdkPixbuf.Pixbuf.new_from_file(source)
width = img.get_width()
height = img.get_height()
except GObject.GError:
except GLib.GError:
width = 0
height = 0
return (width, height)

View File

@ -36,7 +36,7 @@ from hashlib import md5
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import GdkPixbuf
try:
@ -98,7 +98,7 @@ def __get_gconf_string(key):
"""
try:
val = CLIENT.get_string(key)
except GObject.GError:
except GLib.GError:
val = None
return str(val)
@ -119,7 +119,7 @@ def __get_gconf_bool(key):
"""
try:
val = CLIENT.get_bool(key)
except GObject.GError:
except GLib.GError:
val = None
return val
@ -318,7 +318,7 @@ def get_thumbnail_image(src_file, mtype=None, rectangle=None, size=SIZE_NORMAL):
try:
filename = get_thumbnail_path(src_file, mtype, rectangle, size)
return GdkPixbuf.Pixbuf.new_from_file(filename)
except (GObject.GError, OSError):
except (GLib.GError, OSError):
if mtype:
return find_mime_type_pixbuf(mtype)
else:

View File

@ -26,7 +26,7 @@
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib, GObject
#-------------------------------------------------------------------------
#
@ -305,7 +305,7 @@ class SelectionWidget(Gtk.ScrolledWindow):
viewport_size.height)
self._rescale()
self.loaded = True
except (GObject.GError, OSError):
except (GLib.GError, OSError):
self.show_missing()
def show_missing(self):