Package: jack / 3.1.1+cvs20050801-31

36_check_plugin.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Bette error checking for the plugin import.

--- a/jack_plugins.py
+++ b/jack_plugins.py
@@ -26,8 +26,14 @@
 def load_plugin(name, structure):
     import_statement = "from jack_%s import %s" % (name, structure)
     get_statement = "tmp = %s[name]" % structure
-    exec(import_statement) in locals()
-    exec(get_statement) in locals()
+    try:
+        exec(import_statement) in locals()
+    except ImportError, e:
+        error(str(e))
+    try:
+        exec(get_statement) in locals()
+    except KeyError:
+        error("Plugin %s doesn't have an appropriate helper definition." % name)
     return tmp
 
 def import_freedb_servers():