commit:     4b3031b3b9bdb39f33bb95b628a9101cf29728e4
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 19 18:54:46 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 20 04:47:24 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b3031b3

chpathtool: migrate docstrings to a variable

Due to python optimizations, __doc__ are removed.
Reviewed by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>

---
 bin/chpathtool.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 6460662..9b26086 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -2,9 +2,11 @@
 # Copyright 2011-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-"""Helper tool for converting installed files to custom prefixes.
+doc = """Helper tool for converting installed files to custom prefixes.
 
 In other words, eprefixy $D for Gentoo/Prefix."""
+__doc__ = doc
+
 
 import io
 import os
@@ -152,7 +154,7 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-       parser = ArgumentParser(description=__doc__)
+       parser = ArgumentParser(description=doc)
        try:
                parser.add_argument('location', default=None,
                        help='root directory (e.g. $D)')
@@ -166,7 +168,7 @@ def main(argv):
        except OptionError:
                # Argument parsing compatibility for Python 2.6 using optparse.
                if sys.hexversion < 0x2070000:
-                       parser = OptionParser(description=__doc__,
+                       parser = OptionParser(description=doc,
                                usage="usage: %prog [-h] location old new\n\n" 
+ \
                                "  location: root directory (e.g. $D)\n" + \
                                "  old:      original build prefix (e.g. /)\n" 
+ \

Reply via email to