Allow run_line_magic to be called from scripts
Allow run_line_magic to be called from scripts

Don't blow up if looking back up the stack trace fails.

Reported on rpy2: https://bitbucket.org/lgautier/rpy2/issue/184
/valueerror-call-stack-is-not-deep-enough

ipython/ipython,ipython/ipython