##// END OF EJS Templates
Fix DeprecationWarning on autocompletion with jedi 0.17.0
gorogoroumaru -
Show More
@@ -110,26 +110,23 b' current development version to get better completions.'
110 110 # Copyright (C) 2001 Python Software Foundation, www.python.org
111 111
112 112
113 import __main__
114 113 import builtins as builtin_mod
115 114 import glob
116 import time
117 115 import inspect
118 116 import itertools
119 117 import keyword
120 118 import os
121 119 import re
120 import string
122 121 import sys
122 import time
123 123 import unicodedata
124 import string
125 124 import warnings
126
127 125 from contextlib import contextmanager
128 126 from importlib import import_module
129 from typing import Iterator, List, Tuple, Iterable
130 127 from types import SimpleNamespace
128 from typing import Iterable, Iterator, List, Tuple
131 129
132 from traitlets.config.configurable import Configurable
133 130 from IPython.core.error import TryNext
134 131 from IPython.core.inputtransformer2 import ESC_MAGIC
135 132 from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
@@ -137,7 +134,10 b' from IPython.core.oinspect import InspectColors'
137 134 from IPython.utils import generics
138 135 from IPython.utils.dir2 import dir2, get_real_method
139 136 from IPython.utils.process import arg_split
140 from traitlets import Bool, Enum, observe, Int
137 from traitlets import Bool, Enum, Int, observe
138 from traitlets.config.configurable import Configurable
139
140 import __main__
141 141
142 142 # skip module docstests
143 143 skip_doctest = True
@@ -1380,8 +1380,7 b' class IPCompleter(Completer):'
1380 1380 else:
1381 1381 raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names))
1382 1382
1383 interpreter = jedi.Interpreter(
1384 text[:offset], namespaces, column=cursor_column, line=cursor_line + 1)
1383 interpreter = jedi.Interpreter(text[:offset], namespaces)
1385 1384 try_jedi = True
1386 1385
1387 1386 try:
@@ -1408,7 +1407,7 b' class IPCompleter(Completer):'
1408 1407 if not try_jedi:
1409 1408 return []
1410 1409 try:
1411 return filter(completion_filter, interpreter.complete())
1410 return filter(completion_filter, interpreter.complete(column=cursor_column, line=cursor_line + 1))
1412 1411 except Exception as e:
1413 1412 if self.debug:
1414 1413 return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))]
General Comments 0
You need to be logged in to leave comments. Login now