diff --git a/send2trash/plat_gio.py b/send2trash/plat_gio.py index 178b033..9c249be 100644 --- a/send2trash/plat_gio.py +++ b/send2trash/plat_gio.py @@ -4,7 +4,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license -from gi.repository import GObject, Gio +from gi.repository import Gio, GLib from send2trash.exceptions import TrashPermissionError from send2trash.util import preprocess_paths @@ -15,7 +15,7 @@ def send2trash(paths): try: f = Gio.File.new_for_path(path) f.trash(cancellable=None) - except GObject.GError as e: + except GLib.Error as e: if e.code == Gio.IOErrorEnum.NOT_SUPPORTED: # We get here if we can't create a trash directory on the same # device. I don't know if other errors can result in NOT_SUPPORTED.