Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
72a342fd
Commit
72a342fd
authored
May 30, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect roulette against empty FAQ.
parent
00494bfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Tools/faqwiz/faqwiz.py
Tools/faqwiz/faqwiz.py
+5
-1
No files found.
Tools/faqwiz/faqwiz.py
View file @
72a342fd
...
...
@@ -328,6 +328,7 @@ class FaqDir:
def roulette(self):
self.__fill()
import whrandom
if not self.__files: return None
return whrandom.choice(self.__files)
def list(self):
...
...
@@ -576,8 +577,11 @@ class FaqWizard:
emit(TAIL_RECENT)
def do_roulette(self):
self.prologue(T_ROULETTE)
file = self.dir.roulette()
if not file:
self.error("No entries.")
return
self.prologue(T_ROULETTE)
self.dir.show(file)
def do_help(self):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment