]> granicus.if.org Git - python/commitdiff
#18852: Handle readline.__doc__ being None in site.py readline activation.
authorR David Murray <rdmurray@bitdance.com>
Fri, 6 Sep 2013 17:08:08 +0000 (13:08 -0400)
committerR David Murray <rdmurray@bitdance.com>
Fri, 6 Sep 2013 17:08:08 +0000 (13:08 -0400)
Patch by Berker Peksag.

Lib/site.py
Misc/NEWS

index 77d198a55b2e58a606b0067400bf680d9bb5c795..c4ea6f6adb9732afc31f6df749ffd3ba502c0e39 100644 (file)
@@ -388,8 +388,9 @@ def enablerlcompleter():
             return
 
         # Reading the initialization (config) file may not be enough to set a
-        # completion key, so we set one first and then read the file
-        if 'libedit' in getattr(readline, '__doc__', ''):
+        # completion key, so we set one first and then read the file.
+        readline_doc = getattr(readline, '__doc__', '')
+        if readline_doc is not None and 'libedit' in readline_doc:
             readline.parse_and_bind('bind ^I rl_complete')
         else:
             readline.parse_and_bind('tab: complete')
index 67788c911eb2454c40b756664f748df538d02969..e235e7dfb0e210179fe690822b12c3ea91d3cb34 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,6 +56,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #18852: Handle case of ``readline.__doc__`` being ``None`` in the new
+  readline activation code in ``site.py``.
+
 - Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
   the _sre moduel.