[PATCH 3/3] Make range usage Python 3 compatible (#1014220)

Martin Kolman mkolman at redhat.com
Fri Feb 13 18:33:57 UTC 2015


Range returns an iterator in Python 3, wrap it in list() so that
code that expects a list keeps working.

Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 pyanaconda/ui/gui/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 8aab09f..c42744e 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -566,7 +566,7 @@ class GraphicalUserInterface(UserInterface):
             (handler, signum) = user_data
             handler(signum, None)
 
-        for signum in range(1, signal.SIGCHLD) + range(signal.SIGCHLD + 1, signal.NSIG):
+        for signum in (s for s in range(1, signal.NSIG) if s != signal.SIGCHLD):
             handler = signal.getsignal(signum)
             if handler and handler not in (signal.SIG_DFL, signal.SIG_IGN):
                 # NB: if you are looking at the glib documentation you are in for
-- 
2.1.0



More information about the anaconda-patches mailing list