This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/python/yap_kernel/yap_ipython/qt.py

25 lines
798 B
Python
Raw Normal View History

2018-01-05 16:57:38 +00:00
"""
Shim to maintain backwards compatibility with old yap_ipython.qt imports.
"""
# Copyright (c) yap_ipython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
from yap_ipython.utils.shimmodule import ShimModule, ShimWarning
warn("The `yap_ipython.qt` package has been deprecated since yap_ipython 4.0. "
"You should import from qtconsole instead.", ShimWarning)
# Unconditionally insert the shim into sys.modules so that further import calls
# trigger the custom attribute access above
_console = sys.modules['yap_ipython.qt.console'] = ShimModule(
src='yap_ipython.qt.console', mirror='qtconsole')
_qt = ShimModule(src='yap_ipython.qt', mirror='qtconsole')
_qt.console = _console
sys.modules['yap_ipython.qt'] = _qt