mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
For Py3.5 embeddable, which misses pydoc_data module
This commit is contained in:
@@ -8,8 +8,13 @@ from jedi.parser.tree import Leaf
|
|||||||
try:
|
try:
|
||||||
from pydoc_data import topics as pydoc_topics
|
from pydoc_data import topics as pydoc_topics
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Python 2.6
|
# Python 2
|
||||||
import pydoc_topics
|
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
|
||||||
|
|
||||||
if is_py3:
|
if is_py3:
|
||||||
if is_py35:
|
if is_py35:
|
||||||
@@ -99,6 +104,9 @@ def imitate_pydoc(string):
|
|||||||
It's not possible to get the pydoc's without starting the annoying pager
|
It's not possible to get the pydoc's without starting the annoying pager
|
||||||
stuff.
|
stuff.
|
||||||
"""
|
"""
|
||||||
|
if pydoc_topics is None:
|
||||||
|
return ''
|
||||||
|
|
||||||
# str needed because of possible unicode stuff in py2k (pydoc doesn't work
|
# str needed because of possible unicode stuff in py2k (pydoc doesn't work
|
||||||
# with unicode strings)
|
# with unicode strings)
|
||||||
string = str(string)
|
string = str(string)
|
||||||
|
|||||||
Reference in New Issue
Block a user