diff --git a/resources/lib/plex.py b/resources/lib/plex.py index 8f79ef08..cb11263c 100644 --- a/resources/lib/plex.py +++ b/resources/lib/plex.py @@ -356,7 +356,7 @@ def _authorize(): if pinLoginWindow.abort: util.DEBUG_LOG('SIGN IN: Pin login aborted') pl.abort() - return None + return xbmc.sleep(100) else: if not pl.expired(): @@ -364,7 +364,7 @@ def _authorize(): pinLoginWindow.setLinking() return pl.authenticationToken else: - return None + return finally: pinLoginWindow.doClose() del pinLoginWindow @@ -375,7 +375,7 @@ def _authorize(): try: if not expiredWindow.refresh: util.DEBUG_LOG('SIGN IN: Pin refresh aborted') - return None + return finally: del expiredWindow finally: diff --git a/resources/lib/windows/background.py b/resources/lib/windows/background.py index d1ce08e0..869d46a4 100644 --- a/resources/lib/windows/background.py +++ b/resources/lib/windows/background.py @@ -61,8 +61,8 @@ class BackgroundContext(object): def __enter__(self): self.window = BackgroundWindow.create(function=self.function) self.window.modal() + self.result = self.window.result return self def __exit__(self, exc_type, exc_val, exc_tb): - self.result = self.window.result del self.window