except ImportError as xcpt:
print "Import Error: " + xcpt.message
Gets you a deprecation warning in 2.6 because message is going away.
Stackoverflow
How should you be dealing with ImportError? (Note, this is a built-in exception, not one of my making….)
The correct approach is
Only the
messageattribute is going away. The exception will continue to exist and it will continue to have arguments.Read this: http://www.python.org/dev/peps/pep-0352/ which has some rational for removing the
messagesattribute.