[Python-checkins] python/dist/src/Lib formatter.py,1.20,1.21 ftplib.py,1.69,1.70 gettext.py,1.13,1.14 hmac.py,1.5,1.6

Andrew MacIntyre andymac@bullseye.apana.org.au
Sun, 2 Jun 2002 16:18:25 +1100 (edt)


On Fri, 31 May 2002 rhettinger@users.sourceforge.net wrote:

> Update of /cvsroot/python/python/dist/src/Lib
> In directory usw-pr-cvs1:/tmp/cvs-serv7374
>
> Modified Files:
> 	formatter.py ftplib.py gettext.py hmac.py
> Log Message:
> Replace boolean test with is None
>
> Index: formatter.py
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Lib/formatter.py,v
> retrieving revision 1.20
> retrieving revision 1.21
> diff -C2 -d -r1.20 -r1.21
> *** formatter.py	29 May 2002 16:18:42 -0000	1.20
> --- formatter.py	1 Jun 2002 01:29:16 -0000	1.21

{...}

> ***************
> *** 434,438 ****
>       w = DumbWriter()
>       f = AbstractFormatter(w)
> !     if file:
>           fp = open(file)
>       elif sys.argv[1:]:
> --- 434,438 ----
>       w = DumbWriter()
>       f = AbstractFormatter(w)
> !     if file is not None:
>           fp = open(file)
>       elif sys.argv[1:]:
>

You have in fact changed the semantics of this test with your change.

In the case where file = '', the original would fall through to the
elif, whereas with your change it won't.

It concerns me that your extensive changes have introduced some unexpected
traps which won't be sprung until 2.3 is released.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac@bullseye.apana.org.au  | Snail: PO Box 370
        andymac@pcug.org.au            |        Belconnen  ACT  2616
Web:    http://www.andymac.org/        |        Australia