1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 14:30:43 -08:00

Eldoc integration is now compatible with python 3

This commit is contained in:
Fabián Ezequiel Gallina 2012-05-17 00:02:58 -03:00 committed by Fabián Ezequiel Gallina
parent ed0eb59464
commit 9e6629387d

View file

@ -1413,14 +1413,19 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
"def __PYDOC_get_help(obj):
try:
import pydoc
obj = eval(obj, globals())
return pydoc.getdoc(obj)
if hasattr(obj, 'startswith'):
obj = eval(obj, globals())
doc = pydoc.getdoc(obj)
except:
return ''"
doc = ''
try:
exec('print doc')
except SyntaxError:
print(doc)"
"Python code to setup documentation retrieval.")
(defvar python-eldoc-string-code
"print __PYDOC_get_help('''%s''')\n"
"__PYDOC_get_help('''%s''')\n"
"Python code used to get a string with the documentation of an object.")
(defun python-eldoc-setup ()