--- src/mklibs
+++ src/mklibs
@@ -85,7 +85,7 @@
 
 def elf_header(obj):
     if not os.access(obj, os.F_OK):
-        raise "Cannot find lib: " + obj
+        raise Exception, "Cannot find lib: " + obj
     output = command("mklibs-readelf", "--print-elf-header", obj)
     s = [int(i) for i in output[0].split()]
     return {'class': s[0], 'data': s[1], 'machine': s[2], 'flags': s[3]}
@@ -100,7 +100,7 @@
 # Return a set of libraries the passed objects depend on.
 def library_depends(obj):
     if not os.access(obj, os.F_OK):
-        raise "Cannot find lib: " + obj
+        raise Exception, "Cannot find lib: " + obj
     return command("mklibs-readelf", "--print-needed", obj)
 
 # Return a list of libraries the passed objects depend on. The
@@ -136,7 +136,7 @@
 # Return undefined symbols in an object as a set of tuples (name, weakness)
 def undefined_symbols(obj):
     if not os.access(obj, os.F_OK):
-        raise "Cannot find lib" + obj
+        raise Exception, "Cannot find lib" + obj
 
     output = command("mklibs-readelf", "--print-symbols-undefined", obj)
 
@@ -192,7 +192,7 @@
 # Return a set of symbols provided by a library
 def provided_symbols(obj):
     if not os.access(obj, os.F_OK):
-        raise "Cannot find lib" + obj
+        raise Exception, "Cannot find lib" + obj
     library = extract_soname(obj)
 
     output = command("mklibs-readelf", "--print-symbols-provided", obj)
