From 9f9bd6af7805d1df5152318663a55f0087b51eac Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 29 Jun 2001 14:59:01 +0000 Subject: [PATCH] Simplify an example based on comment from Thomas Holenstein : Do not use an extra flag variable to test only once in one subsequent if statement. --- Doc/lib/libcgi.tex | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Doc/lib/libcgi.tex b/Doc/lib/libcgi.tex index 285c08f66e4..8ab562d8b21 100644 --- a/Doc/lib/libcgi.tex +++ b/Doc/lib/libcgi.tex @@ -89,10 +89,7 @@ non-empty string: \begin{verbatim} form = cgi.FieldStorage() -form_ok = 0 -if form.has_key("name") and form.has_key("addr"): - form_ok = 1 -if not form_ok: +if not (form.has_key("name") and form.has_key("addr")): print "

Error

" print "Please fill in the name and addr fields." return