[PATCH 03/14] Don't overwrite function argument when parsing help texts

Martin Kolman mkolman at redhat.com
Thu Aug 21 20:10:24 UTC 2014


The lazy parsing loop was using the same variable name
as the function argument. This made the first call return
a different help text than requested because the option name
provided by the argument was replaced by the name of the last
parsed option.

(cherry picked from commit 02c664f15e5dff8c6c3c6a56bfadb5d7df12f8c9)

Related: rhbz:#1088459
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 pyanaconda/anaconda_optparse.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/anaconda_optparse.py b/pyanaconda/anaconda_optparse.py
index 97ecd28..5296987 100644
--- a/pyanaconda/anaconda_optparse.py
+++ b/pyanaconda/anaconda_optparse.py
@@ -241,8 +241,8 @@ class HelpTextParser(object):
             self._help_text = {}
             try:
                 with open(self._path) as lines:
-                    for option, text in self.read(lines):
-                        self._help_text[option] = text
+                    for parsed_option, parsed_text in self.read(lines):
+                        self._help_text[parsed_option] = parsed_text
             except StandardError:
                 log.error("error reading help text file %s", self._path)
 
-- 
1.9.3



More information about the anaconda-patches mailing list