Supersedes PR #1452.
Fix for %run -d on Python 3
this should also be applied to the 0.12.1 branch
Good point - once this is OKed, I'll do it on that branch too.
Looks clean, thanks @takluyver! I'll merge in master now, and will leave it to you to apply the patch to the 0.12.1 branch.
Fix for %run -d in Python 3. Reviewed in PR #1599
Done for 0.12.1 in commit d457204.