[Python-checkins] python/nondist/peps pep-0278.txt,1.8,1.9 (original) (raw)

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Thu May 6 00🔞01 EDT 2004


Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28747

Modified Files: pep-0278.txt Log Message: revise the test for universal newline support to work even if sys.stdout has been replaced (closes SF bug #800828)

Index: pep-0278.txt

RCS file: /cvsroot/python/python/nondist/peps/pep-0278.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0278.txt 30 Sep 2002 01:56:17 -0000 1.8 --- pep-0278.txt 6 May 2004 04:17:58 -0000 1.9


*** 170,175 **** attribute, so testing whether the current Python has it can be done with a simple ! if hasattr(sys.stdout, 'newlines'): ! print 'We have universal newline support'

--- 170,182 ---- attribute, so testing whether the current Python has it can be done with a simple ! ! if hasattr(open, 'newlines'): ! print 'We have universal newline support' ! ! Note that this test uses the open() function rather than the file ! type so that it won't fail for versions of Python where the file ! type was not available (the file type was added to the built-in ! namespace in the same release as the universal newline feature was ! added).



More information about the Python-checkins mailing list