##// END OF EJS Templates
add ShimWarning for shimmed imports...
add ShimWarning for shimmed imports makes it easier to catch/suppress warnings about shim imports still shown by default (not a DeprecationWarning)

File last commit:

r21515:2c9013e4
r21515:2c9013e4
Show More
nbconvert.py
19 lines | 641 B | text/x-python | PythonLexer
"""
Shim to maintain backwards compatibility with old IPython.nbconvert imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
from IPython.utils.shimmodule import ShimModule, ShimWarning
warn("The `IPython.nbconvert` package has been deprecated. "
"You should import from ipython_nbconvert instead.", ShimWarning)
# Unconditionally insert the shim into sys.modules so that further import calls
# trigger the custom attribute access above
sys.modules['IPython.nbconvert'] = ShimModule(
src='IPython.nbconvert', mirror='nbconvert')