]> jfr.im git - erebus.git/blobdiff - modules/trivia.py
control - be aware of dependents
[erebus.git] / modules / trivia.py
index f619fe564618a236a62563b13fa13533cf10420e..0055c422a3855d42f52844988ad5dd7fa0fb0120 100644 (file)
@@ -100,13 +100,22 @@ class TriviaState(object):
        def __del__(self):
                self.closeshop()
        def closeshop(self):
-               if threading is not None and threading._Timer is not None:
-                       if isinstance(self.steptimer, threading._Timer):
-                               self.steptimer.cancel()
-                       if isinstance(self.nextquestiontimer, threading._Timer):
-                               self.nextquestiontimer.cancel()
-                               self.nextquestiontimer = None
-               self.savedb()
+               try:
+                       self.steptimer.cancel()
+                       self.steptimer = None
+               except: pass
+               try:
+                       self.nextquestiontimer.cancel()
+                       self.nextquestiontimer = None
+               except: pass
+#TODO remove if the replacement works
+#              if threading is not None and threading._Timer is not None:
+#                      if isinstance(self.steptimer, threading._Timer):
+#                              self.steptimer.cancel()
+#                      if isinstance(self.nextquestiontimer, threading._Timer):
+#                              self.nextquestiontimer.cancel()
+#                              self.nextquestiontimer = None
+#              self.savedb()
 
        def savedb(self): #returns whether or not it was able to save
                if json is not None and json.dump is not None: