ulinecache.py 684 B

123456789101112131415161718192021
  1. """
  2. This module has been deprecated since IPython 6.0.
  3. Wrapper around linecache which decodes files to unicode according to PEP 263.
  4. """
  5. import functools
  6. import linecache
  7. from warnings import warn
  8. getline = linecache.getline
  9. # getlines has to be looked up at runtime, because doctests monkeypatch it.
  10. @functools.wraps(linecache.getlines)
  11. def getlines(filename, module_globals=None):
  12. """
  13. Deprecated since IPython 6.0
  14. """
  15. warn(("`IPython.utils.ulinecache.getlines` is deprecated since"
  16. " IPython 6.0 and will be removed in future versions."),
  17. DeprecationWarning, stacklevel=2)
  18. return linecache.getlines(filename, module_globals=module_globals)