Account for changes in behavior across versions of IPython.