summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-01-04 22:00:56 (GMT)
committerFred Drake <fdrake@acm.org>1999-01-04 22:00:56 (GMT)
commit3b07480a17aae499a7f5c9419207847899fca621 (patch)
tree2ee66a47e0e8a29bb401ca16e6f9f5427a9eb797 /Doc/tools
parent1e899cdeaaef273d461b52cec04b554ef8c451b9 (diff)
downloadcpython-3b07480a17aae499a7f5c9419207847899fca621.zip
cpython-3b07480a17aae499a7f5c9419207847899fca621.tar.gz
cpython-3b07480a17aae499a7f5c9419207847899fca621.tar.bz2
trim_ignored_letters(): Simplify a little.
Diffstat (limited to 'Doc/tools')
-rwxr-xr-xDoc/tools/buildindex.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/tools/buildindex.py b/Doc/tools/buildindex.py
index e282f3c..1d50825 100755
--- a/Doc/tools/buildindex.py
+++ b/Doc/tools/buildindex.py
@@ -116,14 +116,14 @@ def load(fp):
return nodes
-# ignore $ to keep environment variables with the leading letter from the name
-SKIP_LETTERS = "$"
-
def trim_ignored_letters(s):
+ # ignore $ to keep environment variables with the
+ # leading letter from the name
s = string.lower(s)
- while s[0] in SKIP_LETTERS:
- s = s[1:]
- return s
+ if s[0] == "$":
+ return s[1:]
+ else:
+ return s
def get_first_letter(s):
return string.lower(trim_ignored_letters(s)[0])