make compatible with newer IPython