From 2c1125bc49ade78ab9d0791c50d1762bab03ce13 2021-12-02 00:07:03 From: Matthias Bussonnier Date: 2021-12-02 00:07:03 Subject: [PATCH] Remove shimmodule IPython.config Deprecated since IPython 4.0 This should not be relied upon as this was deprecated Python 3.6 was not released yet. --- diff --git a/IPython/config.py b/IPython/config.py deleted file mode 100644 index 964f46f..0000000 --- a/IPython/config.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -Shim to maintain backwards compatibility with old IPython.config imports. -""" -# Copyright (c) IPython Development Team. -# Distributed under the terms of the Modified BSD License. - -import sys -from warnings import warn - -from .utils.shimmodule import ShimModule, ShimWarning - -warn("The `IPython.config` package has been deprecated since IPython 4.0. " - "You should import from traitlets.config instead.", ShimWarning) - - -# Unconditionally insert the shim into sys.modules so that further import calls -# trigger the custom attribute access above - -sys.modules['IPython.config'] = ShimModule(src='IPython.config', mirror='traitlets.config') diff --git a/IPython/utils/tests/test_shimmodule.py b/IPython/utils/tests/test_shimmodule.py deleted file mode 100644 index 30f2ffa..0000000 --- a/IPython/utils/tests/test_shimmodule.py +++ /dev/null @@ -1,14 +0,0 @@ -import pytest -import sys - -from IPython.utils.shimmodule import ShimWarning - - -def test_shim_warning(): - sys.modules.pop('IPython.config', None) - with pytest.warns(ShimWarning): - import IPython.config - - import traitlets.config - - assert IPython.config.Config is traitlets.config.Config