##// 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 # Copyright (C) 2001 Python Software Foundation, www.python.org
110 # Copyright (C) 2001 Python Software Foundation, www.python.org
111
111
112
112
113 import __main__
114 import builtins as builtin_mod
113 import builtins as builtin_mod
115 import glob
114 import glob
116 import time
117 import inspect
115 import inspect
118 import itertools
116 import itertools
119 import keyword
117 import keyword
120 import os
118 import os
121 import re
119 import re
120 import string
122 import sys
121 import sys
122 import time
123 import unicodedata
123 import unicodedata
124 import string
125 import warnings
124 import warnings
126
127 from contextlib import contextmanager
125 from contextlib import contextmanager
128 from importlib import import_module
126 from importlib import import_module
129 from typing import Iterator, List, Tuple, Iterable
130 from types import SimpleNamespace
127 from types import SimpleNamespace
128 from typing import Iterable, Iterator, List, Tuple
131
129
132 from traitlets.config.configurable import Configurable
133 from IPython.core.error import TryNext
130 from IPython.core.error import TryNext
134 from IPython.core.inputtransformer2 import ESC_MAGIC
131 from IPython.core.inputtransformer2 import ESC_MAGIC
135 from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
132 from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
@@ -137,7 +134,10 b' from IPython.core.oinspect import InspectColors'
137 from IPython.utils import generics
134 from IPython.utils import generics
138 from IPython.utils.dir2 import dir2, get_real_method
135 from IPython.utils.dir2 import dir2, get_real_method
139 from IPython.utils.process import arg_split
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 # skip module docstests
142 # skip module docstests
143 skip_doctest = True
143 skip_doctest = True
@@ -1380,8 +1380,7 b' class IPCompleter(Completer):'
1380 else:
1380 else:
1381 raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names))
1381 raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names))
1382
1382
1383 interpreter = jedi.Interpreter(
1383 interpreter = jedi.Interpreter(text[:offset], namespaces)
1384 text[:offset], namespaces, column=cursor_column, line=cursor_line + 1)
1385 try_jedi = True
1384 try_jedi = True
1386
1385
1387 try:
1386 try:
@@ -1408,7 +1407,7 b' class IPCompleter(Completer):'
1408 if not try_jedi:
1407 if not try_jedi:
1409 return []
1408 return []
1410 try:
1409 try:
1411 return filter(completion_filter, interpreter.complete())
1410 return filter(completion_filter, interpreter.complete(column=cursor_column, line=cursor_line + 1))
1412 except Exception as e:
1411 except Exception as e:
1413 if self.debug:
1412 if self.debug:
1414 return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))]
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