mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-28 22:02:20 +08:00
Remove some more Python 3.5 references
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
import pydoc
|
||||
from contextlib import suppress
|
||||
|
||||
from jedi.inference.utils import ignored
|
||||
from jedi.inference.names import AbstractArbitraryName
|
||||
|
||||
try:
|
||||
from pydoc_data import topics as pydoc_topics
|
||||
except ImportError:
|
||||
# Python 2
|
||||
try:
|
||||
import pydoc_topics
|
||||
except ImportError:
|
||||
# This is for Python 3 embeddable version, which dont have
|
||||
# pydoc_data module in its file python3x.zip.
|
||||
pydoc_topics = None
|
||||
from pydoc_data import topics as pydoc_topics
|
||||
|
||||
|
||||
class KeywordName(AbstractArbitraryName):
|
||||
@@ -34,7 +25,7 @@ def imitate_pydoc(string):
|
||||
# with unicode strings)
|
||||
string = str(string)
|
||||
h = pydoc.help
|
||||
with ignored(KeyError):
|
||||
with suppress(KeyError):
|
||||
# try to access symbols
|
||||
string = h.symbols[string]
|
||||
string, _, related = string.partition(' ')
|
||||
|
||||
@@ -10,7 +10,6 @@ be used across repositories.
|
||||
import os
|
||||
import errno
|
||||
import json
|
||||
import sys
|
||||
|
||||
from jedi import debug
|
||||
from jedi.api.environment import get_cached_default_environment, create_environment
|
||||
@@ -258,10 +257,6 @@ class Project(object):
|
||||
inference_state = s._inference_state
|
||||
empty_module_context = s._get_module_context()
|
||||
|
||||
if inference_state.grammar.version_info < (3, 6) or sys.version_info < (3, 6):
|
||||
raise NotImplementedError(
|
||||
"No support for refactorings/search on Python 2/3.5"
|
||||
)
|
||||
debug.dbg('Search for string %s, complete=%s', string, complete)
|
||||
wanted_type, wanted_names = split_search_string(string)
|
||||
name = wanted_names[0]
|
||||
|
||||
Reference in New Issue
Block a user