1
0
forked from VimPlug/jedi

Remove some more Python 3.5 references

This commit is contained in:
Dave Halter
2020-07-02 02:13:06 +02:00
parent 182e1e864c
commit 17343bb57c
9 changed files with 52 additions and 95 deletions
+3 -12
View File
@@ -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(' ')