Specify GTK version explicitly to shut GI up.
[automanga.git] / manga / reader.py
index c957b13..c4d322d 100644 (file)
@@ -1,4 +1,6 @@
 import threading
+import gi
+gi.require_version("Gtk", "3.0")
 from gi.repository import Gtk as gtk, GdkPixbuf as gdkpix, Gdk as gdk, GObject as gobject
 from . import lib, profile
 
@@ -157,7 +159,10 @@ class idpageget(future):
         self.idlist = idlist
 
     def value(self):
-        return lib.cursor(self.bnode.byidlist(self.idlist)).cur
+        try:
+            return lib.cursor(self.bnode.byidlist(self.idlist)).cur
+        except KeyError:
+            raise KeyError("could not find last read page: " + repr(self.idlist))
 
 class pageget(future):
     def __init__(self, fnode):