From: Simon Chopin <chopin.simon@gmail.com>
Date: Thu, 6 Jun 2013 12:10:24 +0200
Subject: Always specify the exception type in except: blocks
Forwarded: https://github.com/jart/fabulous/pull/1

diff --git a/fabulous/utils.py b/fabulous/utils.py
index 8ca3da4..9f99002 100644
--- a/fabulous/utils.py
+++ b/fabulous/utils.py
@@ -92,7 +92,7 @@ class TerminalInfo(object):
         """
         try:
             call = fcntl.ioctl(self.termfd, termios.TIOCGWINSZ, "\000" * 8)
-        except:
+        except IOError:
             return (79, 40)
         else:
             height, width = struct.unpack("hhhh", call)[:2]
diff --git a/fabulous/xterm256.py b/fabulous/xterm256.py
index 65ed75f..6662a89 100644
--- a/fabulous/xterm256.py
+++ b/fabulous/xterm256.py
@@ -91,7 +91,8 @@ def compile_speedup():
     sauce = join(dirname(__file__), '_xterm256.c')
     if not exists(library) or getmtime(sauce) > getmtime(library):
         build = "gcc -fPIC -shared -o %s %s" % (library, sauce)
-        assert os.system(build + " >/dev/null 2>&1") == 0
+        if (os.system(build + " >/dev/null 2>&1") != 0):
+            raise OSError("GCC error")
     xterm256_c = ctypes.cdll.LoadLibrary(library)
     xterm256_c.init()
     def xterm_to_rgb(xcolor):
@@ -102,5 +103,5 @@ def compile_speedup():
 
 try:
     (rgb_to_xterm, xterm_to_rgb) = compile_speedup()
-except:
+except OSError:
     logging.debug("fabulous failed to compile xterm256 speedup code")
-- 
1.7.10.4

