mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
compatibility
This commit is contained in:
@@ -4,7 +4,11 @@ from _compatibility import is_py3k
|
|||||||
import builtin
|
import builtin
|
||||||
|
|
||||||
import pydoc
|
import pydoc
|
||||||
import pydoc_data.topics
|
try:
|
||||||
|
from pydoc_data import topics as pydoc_topics
|
||||||
|
except ImportError:
|
||||||
|
# Python 2.5/2.6
|
||||||
|
import pydoc_topics
|
||||||
|
|
||||||
if is_py3k():
|
if is_py3k():
|
||||||
keys = keyword.kwlist
|
keys = keyword.kwlist
|
||||||
@@ -59,4 +63,4 @@ def imitate_pydoc(string):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
return pydoc_data.topics.topics[label]
|
return pydoc_topics.topics[label]
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class ModuleWithCursor(Module):
|
|||||||
while pos > (1, 0):
|
while pos > (1, 0):
|
||||||
# remove non important white space
|
# remove non important white space
|
||||||
line = self.get_line(pos[0])
|
line = self.get_line(pos[0])
|
||||||
while pos > 0 and line[pos[1] - 1].isspace():
|
while pos[1] > 0 and line[pos[1] - 1].isspace():
|
||||||
pos = pos[0], pos[1] - 1
|
pos = pos[0], pos[1] - 1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user