[Python-checkins] cpython: #18852: Handle readline.__doc__ being None in site.py readline activation.

r.david.murray python-checkins at python.org
Fri Sep 6 19:09:15 CEST 2013


http://hg.python.org/cpython/rev/3070fdd58645
changeset:   85575:3070fdd58645
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Sep 06 13:08:08 2013 -0400
summary:
  #18852: Handle readline.__doc__ being None in site.py readline activation.

Patch by Berker Peksag.

files:
  Lib/site.py |  5 +++--
  Misc/NEWS   |  3 +++
  2 files changed, 6 insertions(+), 2 deletions(-)


diff --git a/Lib/site.py b/Lib/site.py
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -388,8 +388,9 @@
             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')
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,6 +56,9 @@
 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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list