Remove legacy imports from IPython integration since the "py3compat" module changed in IPython 7.11. (GH-3297)