fix for using the shell with IPython >= 1.0
Merge pull request #242 from rhr/master

fix for using the shell with IPython >= 1.0