Skip to content

Commit

Permalink
Merge pull request #12227 from gorogoroumaru/issue12206
Browse files Browse the repository at this point in the history
Fix DeprecationWarning on autocompletion with jedi 0.17.0
  • Loading branch information
Carreau committed Apr 23, 2020
2 parents 198edd7 + dcd9dc9 commit 0bb76dd
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions IPython/core/completer.py
Expand Up @@ -110,34 +110,34 @@
# Copyright (C) 2001 Python Software Foundation, www.python.org


import __main__
import builtins as builtin_mod
import glob
import time
import inspect
import itertools
import keyword
import os
import re
import string
import sys
import time
import unicodedata
import string
import warnings

from contextlib import contextmanager
from importlib import import_module
from typing import Iterator, List, Tuple, Iterable
from types import SimpleNamespace
from typing import Iterable, Iterator, List, Tuple

from traitlets.config.configurable import Configurable
from IPython.core.error import TryNext
from IPython.core.inputtransformer2 import ESC_MAGIC
from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
from IPython.core.oinspect import InspectColors
from IPython.utils import generics
from IPython.utils.dir2 import dir2, get_real_method
from IPython.utils.process import arg_split
from traitlets import Bool, Enum, observe, Int
from traitlets import Bool, Enum, Int, observe
from traitlets.config.configurable import Configurable

import __main__

# skip module docstests
skip_doctest = True
Expand Down Expand Up @@ -1380,8 +1380,7 @@ def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str):
else:
raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names))

interpreter = jedi.Interpreter(
text[:offset], namespaces, column=cursor_column, line=cursor_line + 1)
interpreter = jedi.Interpreter(text[:offset], namespaces)
try_jedi = True

try:
Expand All @@ -1408,7 +1407,7 @@ def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str):
if not try_jedi:
return []
try:
return filter(completion_filter, interpreter.complete())
return filter(completion_filter, interpreter.complete(column=cursor_column, line=cursor_line + 1))
except Exception as e:
if self.debug:
return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))]
Expand Down

0 comments on commit 0bb76dd

Please sign in to comment.