Browse code

Improved compatibility with Python 2.4

Apparently in Py2.4 the Exception class doesn't have 'message'
attribute.

Michal Ludvig authored on 2012/01/12 10:53:35
Showing 1 changed files
... ...
@@ -42,7 +42,7 @@ try:
42 42
         def mime_magic(file):
43 43
             return magic_.file(file)
44 44
 except ImportError, e:
45
-    if e.message.find("magic") >= 0:
45
+    if str(e).find("magic") >= 0:
46 46
         magic_message = "Module python-magic is not available."
47 47
     else:
48 48
         magic_message = "Module python-magic can't be used (%s)." % e.message