mytest.py: Check if self.summary has value
authorAthanasios Oikonomou <athoik@gmail.com>
Sun, 3 Jan 2016 18:41:44 +0000 (20:41 +0200)
committerErik Slagter <erik@openpli.org>
Mon, 4 Jan 2016 17:42:44 +0000 (18:42 +0100)
After commit ae7f6aeacc53344 it is possible to get the following error when osd3dsetup is not installed.

File "/usr/lib/enigma2/python/mytest.py", line 315, in pushSummary
    self.summary.hide()
AttributeError: 'list' object has no attribute 'hide'

Checking if self.summary has value fixes the issue.

(cherry picked from commit 2d3b84c5abca2e818f49f8be9fce3b4561a4e2d3)
Signed-off-by: Erik Slagter <erik@openpli.org>

mytest.py

index 3c21846..0833cb9 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -224,7 +224,7 @@ class Session:
                self.current_dialog.restoreKeyboardMode()
                self.current_dialog.hide()
 
-               if last and self.summary is not None:
+               if last and self.summary:
                        self.current_dialog.removeSummary(self.summary)
                        self.popSummary()
 
@@ -311,7 +311,7 @@ class Session:
                self.execEnd()
 
        def pushSummary(self):
-               if self.summary is not None:
+               if self.summary:
                        self.summary.hide()
                        self.summary_stack.append(self.summary)
                        self.summary = None