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