fix for https://github.com/ipython/ipython/issues/5293