From 504044b2833479a167b6967e02dfb9bcf6f26967 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 2 Oct 2018 07:37:31 +0200 Subject: [PATCH] Fix passing back results from Background window --- resources/lib/plex.py | 6 +++--- resources/lib/windows/background.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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