emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] [emacs] 01/01: Eldoc setup code enhancements


From: Fabián Ezequiel Gallina
Subject: [Emacs-diffs] [emacs] 01/01: Eldoc setup code enhancements
Date: Sat, 15 Nov 2014 18:50:38 +0000

fgallina pushed a commit to branch master
in repository emacs.

commit 9ae5396b8f152a4ab32f1d56239f3f5e3967da0b
Author: Fabián Ezequiel Gallina <address@hidden>
Date:   Sat Nov 15 15:50:30 2014 -0300

    Eldoc setup code enhancements
    
    Fixes: debbugs:18962
    
    * lisp/progmodes/python.el (python-eldoc-setup-code): Enhance string
    type checks, simplify printing.
---
 lisp/ChangeLog           |    5 +++++
 lisp/progmodes/python.el |   11 ++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e2e5352..5c7533f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-15  Fabián Ezequiel Gallina  <address@hidden>
+
+       * progmodes/python.el (python-eldoc-setup-code): Enhance string
+       type checks, simplify printing.  (Bug#18962)
+
 2014-11-14  Ivan Andrus  <address@hidden>
 
        * progmodes/python.el (python-shell-font-lock-kill-buffer):
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 2fcbe64..961aebe 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3546,7 +3546,11 @@ See `python-check-command' for the default."
   "def __PYDOC_get_help(obj):
     try:
         import inspect
-        if hasattr(obj, 'startswith'):
+        try:
+            str_type = basestring
+        except NameError:
+            str_type = str
+        if isinstance(obj, str_type):
             obj = eval(obj, globals())
         doc = inspect.getdoc(obj)
         if not doc and callable(obj):
@@ -3569,10 +3573,7 @@ See `python-check-command' for the default."
             doc = doc.splitlines()[0]
     except:
         doc = ''
-    try:
-        exec('print doc')
-    except SyntaxError:
-        print(doc)"
+    print (doc)"
   "Python code to setup documentation retrieval."
   :type 'string
   :group 'python)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]