Catch the specific exception and see what information it has. The message is formatted from the exception object's parameters so its a good bet that its there. In this case, SyntaxError includes a filename attribute.
try:
package_info = __import__('app') #app.py
except SyntaxError, e:
print traceback.extract_tb(sys.exc_info()[-1])
print traceback.tb_lineno(sys.exc_info()[-1])
print e.filename