diff --git a/LunaTranslator/LunaTranslator/gui/edittext.py b/LunaTranslator/LunaTranslator/gui/edittext.py index 9094f2b7..0811a8fa 100644 --- a/LunaTranslator/LunaTranslator/gui/edittext.py +++ b/LunaTranslator/LunaTranslator/gui/edittext.py @@ -122,13 +122,10 @@ class edittrans(QMainWindow): self.trykeeppos() def trykeeppos(self): - try: - self.followhwnd = gobject.baseobject.textsource.hwnd - self.follow() - self.show() - except: - pass - + self.followhwnd = gobject.baseobject.textsource.hwnd + self.follow() + self.show() + @threader def follow(self): while True: diff --git a/LunaTranslator/LunaTranslator/myutils/wrapper.py b/LunaTranslator/LunaTranslator/myutils/wrapper.py index b00bf14e..3f35bfe0 100644 --- a/LunaTranslator/LunaTranslator/myutils/wrapper.py +++ b/LunaTranslator/LunaTranslator/myutils/wrapper.py @@ -43,8 +43,12 @@ def Singleton_impl(cls, behavior="activate"): self.deleteLater() _instance.pop(cls) _lock.release() - - _inst = __(*args, **kwagrs) + try: + _inst = __(*args, **kwagrs) + except: + print_exc() + _lock.release() + return None if _inst.Singleton_flag: _instance[cls] = _inst return _inst