summaryrefslogtreecommitdiffstats
path: root/Tools/faqwiz
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-16 17:02:34 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-16 17:02:34 (GMT)
commitbf82e374ee737992235cbe944c9ddbd58236a892 (patch)
treef8c8dccaa76d58f9cb7d8cc0abb1355be75ee369 /Tools/faqwiz
parentacbca71ea775fc488bead0876d0cdbd48670dcbc (diff)
downloadcpython-bf82e374ee737992235cbe944c9ddbd58236a892.zip
cpython-bf82e374ee737992235cbe944c9ddbd58236a892.tar.gz
cpython-bf82e374ee737992235cbe944c9ddbd58236a892.tar.bz2
More 2to3 fixes in the Tools directory. Fixes #2893.
Diffstat (limited to 'Tools/faqwiz')
-rw-r--r--Tools/faqwiz/faqwiz.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py
index 6bfe354..15342f1 100644
--- a/Tools/faqwiz/faqwiz.py
+++ b/Tools/faqwiz/faqwiz.py
@@ -120,7 +120,7 @@ def log(text):
logfile.close()
def load_cookies():
- if not os.environ.has_key('HTTP_COOKIE'):
+ if 'HTTP_COOKIE' not in os.environ:
return {}
raw = os.environ['HTTP_COOKIE']
words = [s.strip() for s in raw.split(';')]
@@ -359,7 +359,7 @@ class FaqDir:
self.open(file).show(edit=edit)
def new(self, section):
- if not SECTION_TITLES.has_key(section):
+ if section not in SECTION_TITLES:
raise NoSuchSection(section)
maxnum = 0
for file in self.list():
@@ -426,11 +426,11 @@ class FaqWizard:
query = re.escape(query)
queries = [query]
elif self.ui.querytype in ('anykeywords', 'allkeywords'):
- words = filter(None, re.split('\W+', query))
+ words = [_f for _f in re.split('\W+', query) if _f]
if not words:
self.error("No keywords specified!")
return
- words = map(lambda w: r'\b%s\b' % w, words)
+ words = [r'\b%s\b' % w for w in words]
if self.ui.querytype[:3] == 'any':
queries = ['|'.join(words)]
else:
@@ -577,7 +577,7 @@ class FaqWizard:
emit(ONE_RECENT, period=period)
else:
emit(SOME_RECENT, period=period, count=len(list))
- self.format_all(map(lambda (mtime, file): file, list), headers=0)
+ self.format_all([mtime_file[1] for mtime_file in list], headers=0)
emit(TAIL_RECENT)
def do_roulette(self):
@@ -603,8 +603,7 @@ class FaqWizard:
def do_add(self):
self.prologue(T_ADD)
emit(ADD_HEAD)
- sections = SECTION_TITLES.items()
- sections.sort()
+ sections = sorted(SECTION_TITLES.items())
for section, title in sections:
emit(ADD_SECTION, section=section, title=title)
emit(ADD_TAIL)