[Python-checkins] r61111 - in python/branches/trunk-math: Demo/tkinter/guido/ShellWindow.py Doc/Makefile Doc/README.txt Doc/c-api/long.rst Doc/c-api/objbuffer.rst Doc/c-api/tuple.rst Doc/c-api/typeobj.rst Doc/conf.py Doc/distutils/builtdist.rst Doc/distutils/packageindex.rst Doc/distutils/setupscript.rst Doc/howto/advocacy.rst Doc/howto/doanddont.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/library/basehttpserver.rst Doc/library/codecs.rst Doc/library/collections.rst Doc/library/configparser.rst Doc/library/decimal.rst Doc/library/difflib.rst Doc/library/dis.rst Doc/library/inspect.rst Doc/library/itertools.rst Doc/library/logging.rst Doc/library/mailbox.rst Doc/library/modulefinder.rst Doc/library/msilib.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/pickle.rst Doc/library/platform.rst Doc/library/profile.rst Doc/library/random.rst Doc/library/re.rst Doc/library/signal.rst Doc/library/simplexmlrpcserver.rst Doc/library/socket.rst Doc/library/tokenize.rst Doc/library/trace.rst Doc/library/userdict.rst Doc/library/weakref.rst Doc/library/xml.dom.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpclib.rst Doc/reference/compound_stmts.rst Doc/reference/expressions.rst Doc/reference/index.rst Doc/tutorial/interpreter.rst Doc/tutorial/stdlib2.rst Doc/using/cmdline.rst Doc/using/unix.rst Doc/using/windows.rst Doc/whatsnew/2.6.rst Grammar/Grammar Include/Python-ast.h Include/abstract.h Include/formatter_string.h Include/formatter_unicode.h Include/graminit.h Include/longintrepr.h Include/object.h Lib/BaseHTTPServer.py Lib/ConfigParser.py Lib/SimpleHTTPServer.py Lib/UserDict.py Lib/abc.py Lib/bsddb/test/test_associate.py Lib/bsddb/test/test_basics.py Lib/bsddb/test/test_compare.py Lib/bsddb/test/test_compat.py Lib/bsddb/test/test_cursor_pget_bug.py Lib/bsddb/test/test_dbobj.py Lib/bsddb/test/test_dbshelve.py Lib/bsddb/test/test_dbtables.py Lib/bsddb/test/test_env_close.py Lib/bsddb/test/test_get_none.py Lib/bsddb/test/test_join.py Lib/bsddb/test/test_lock.py Lib/bsddb/test/test_misc.py Lib/bsddb/test/test_pickle.py Lib/bsddb/test/test_queue.py Lib/bsddb/test/test_recno.py Lib/bsddb/test/test_sequence.py Lib/bsddb/test/test_thread.py Lib/compiler/ast.py Lib/compiler/transformer.py Lib/copy_reg.py Lib/ctypes/__init__.py Lib/ctypes/macholib/dyld.py Lib/ctypes/test/__init__.py Lib/ctypes/test/test_cfuncs.py Lib/ctypes/test/test_checkretval.py Lib/ctypes/test/test_find.py Lib/ctypes/test/test_libc.py Lib/ctypes/test/test_loading.py Lib/ctypes/test/test_macholib.py Lib/ctypes/test/test_numbers.py Lib/ctypes/test/test_random_things.py Lib/curses/__init__.py Lib/curses/wrapper.py Lib/decimal.py Lib/distutils/archive_util.py Lib/distutils/bcppcompiler.py Lib/distutils/ccompiler.py Lib/distutils/command/bdist.py Lib/distutils/command/bdist_dumb.py Lib/distutils/command/bdist_msi.py Lib/distutils/command/bdist_rpm.py Lib/distutils/command/build_ext.py Lib/distutils/command/build_py.py Lib/distutils/command/build_scripts.py Lib/distutils/command/install.py Lib/distutils/command/install_headers.py Lib/distutils/command/install_lib.py Lib/distutils/command/register.py Lib/distutils/command/sdist.py Lib/distutils/command/upload.py Lib/distutils/core.py Lib/distutils/dir_util.py Lib/distutils/dist.py Lib/distutils/fancy_getopt.py Lib/distutils/filelist.py Lib/distutils/msvccompiler.py Lib/distutils/sysconfig.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_sysconfig.py Lib/distutils/text_file.py Lib/distutils/unixccompiler.py Lib/distutils/util.py Lib/email/base64mime.py Lib/email/utils.py Lib/hotshot/log.py Lib/hotshot/stones.py Lib/httplib.py Lib/idlelib/MultiCall.py Lib/idlelib/RemoteDebugger.py Lib/idlelib/TreeWidget.py Lib/idlelib/UndoDelegator.py Lib/idlelib/configDialog.py Lib/idlelib/keybindingDialog.py Lib/idlelib/run.py Lib/imaplib.py Lib/inspect.py Lib/lib-tk/tkSimpleDialog.py Lib/logging/handlers.py Lib/ntpath.py Lib/plat-mac/MiniAEFrame.py Lib/plat-mac/aepack.py Lib/plat-mac/bgenlocations.py Lib/plat-mac/macostools.py Lib/plat-riscos/rourl2path.py Lib/popen2.py Lib/pydoc.py Lib/runpy.py Lib/smtplib.py Lib/socket.py Lib/sqlite3/test/hooks.py Lib/ssl.py Lib/string.py Lib/symbol.py Lib/test/fork_wait.py Lib/test/list_tests.py Lib/test/output/test_logging Lib/test/seq_tests.py Lib/test/string_tests.py Lib/test/test_MimeWriter.py Lib/test/test_SimpleHTTPServer.py Lib/test/test___all__.py Lib/test/test_abc.py Lib/test/test_applesingle.py Lib/test/test_array.py Lib/test/test_ast.py Lib/test/test_bisect.py Lib/test/test_bsddb185.py Lib/test/test_bsddb3.py Lib/test/test_builtin.py Lib/test/test_cfgparser.py Lib/test/test_class.py Lib/test/test_cmd.py Lib/test/test_coercion.py Lib/test/test_compare.py Lib/test/test_compiler.py Lib/test/test_copy.py Lib/test/test_cpickle.py Lib/test/test_curses.py Lib/test/test_datetime.py Lib/test/test_dbm.py Lib/test/test_decorators.py Lib/test/test_deque.py Lib/test/test_descrtut.py Lib/test/test_dict.py Lib/test/test_dis.py Lib/test/test_doctest.py Lib/test/test_dummy_threading.py Lib/test/test_email.py Lib/test/test_email_renamed.py Lib/test/test_eof.py Lib/test/test_extcall.py Lib/test/test_file.py Lib/test/test_fileinput.py Lib/test/test_format.py Lib/test/test_fractions.py Lib/test/test_ftplib.py Lib/test/test_future_builtins.py Lib/test/test_getargs2.py Lib/test/test_grammar.py Lib/test/test_gzip.py Lib/test/test_heapq.py Lib/test/test_htmlparser.py Lib/test/test_httplib.py Lib/test/test_imgfile.py Lib/test/test_imp.py Lib/test/test_index.py Lib/test/test_inspect.py Lib/test/test_itertools.py Lib/test/test_linuxaudiodev.py Lib/test/test_list.py Lib/test/test_logging.py Lib/test/test_minidom.py Lib/test/test_mmap.py Lib/test/test_module.py Lib/test/test_modulefinder.py Lib/test/test_multibytecodec_support.py Lib/test/test_mutex.py Lib/test/test_operator.py Lib/test/test_optparse.py Lib/test/test_ossaudiodev.py Lib/test/test_parser.py Lib/test/test_pickle.py Lib/test/test_pkg.py Lib/test/test_plistlib.py Lib/test/test_poll.py Lib/test/test_posix.py Lib/test/test_pyclbr.py Lib/test/test_quopri.py Lib/test/test_resource.py Lib/test/test_rfc822.py Lib/test/test_scope.py Lib/test/test_scriptpackages.py Lib/test/test_sgmllib.py Lib/test/test_shlex.py Lib/test/test_signal.py Lib/test/test_site.py Lib/test/test_smtplib.py Lib/test/test_socketserver.py Lib/test/test_sqlite.py Lib/test/test_str.py Lib/test/test_strftime.py Lib/test/test_string.py Lib/test/test_sunaudiodev.py Lib/test/test_support.py Lib/test/test_threading.py Lib/test/test_tuple.py Lib/test/test_types.py Lib/test/test_unicode.py Lib/test/test_unpack.py Lib/test/test_urllib.py Lib/test/test_urllib2.py Lib/test/test_urllib2_localnet.py Lib/test/test_userdict.py Lib/test/test_userlist.py Lib/test/test_userstring.py Lib/test/test_uu.py Lib/test/test_whichdb.py Lib/test/test_xml_etree.py Lib/test/test_xml_etree_c.py Lib/test/test_xmlrpc.py Lib/test/test_xpickle.py Lib/test/test_zipfile64.py Lib/threading.py Lib/token.py Lib/trace.py Lib/xml/dom/minidom.py Lib/xmlrpclib.py Mac/Demo/PICTbrowse/ICONbrowse.py Mac/Demo/PICTbrowse/PICTbrowse.py Mac/Demo/PICTbrowse/PICTbrowse2.py Mac/Demo/PICTbrowse/cicnbrowse.py Mac/Demo/PICTbrowse/oldPICTbrowse.py Mac/Demo/example1/dnslookup-1.py Mac/Demo/example2/dnslookup-2.py Mac/Demo/imgbrowse/imgbrowse.py Mac/Demo/imgbrowse/mac_image.py Mac/Demo/sound/morse.py Mac/Modules/ae/aescan.py Mac/Modules/ah/ahscan.py Mac/Modules/app/appscan.py Mac/Modules/carbonevt/CarbonEvtscan.py Mac/Modules/cf/cfscan.py Mac/Modules/cg/cgscan.py Mac/Modules/cm/cmscan.py Mac/Modules/ctl/ctlscan.py Mac/Modules/dlg/dlgscan.py Mac/Modules/drag/dragscan.py Mac/Modules/evt/evtscan.py Mac/Modules/file/filescan.py Mac/Modules/fm/fmscan.py Mac/Modules/folder/folderscan.py Mac/Modules/help/helpscan.py Mac/Modules/ibcarbon/IBCarbonscan.py Mac/Modules/icn/icnscan.py Mac/Modules/launch/launchscan.py Mac/Modules/list/listscan.py Mac/Modules/menu/menuscan.py Mac/Modules/mlte/mltescan.py Mac/Modules/osa/osascan.py Mac/Modules/qd/qdscan.py Mac/Modules/qdoffs/qdoffsscan.py Mac/Modules/qt/qtscan.py Mac/Modules/res/resscan.py Mac/Modules/scrap/scrapscan.py Mac/Modules/snd/sndscan.py Mac/Modules/te/tescan.py Mac/Modules/win/winscan.py Makefile.pre.in Misc/ACKS Misc/BeOS-setup.py Misc/HISTORY Misc/NEWS Misc/cheatsheet Modules/_ctypes/_ctypes_test.c Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/configure.ac Modules/_ctypes/libffi/fficonfig.h.in Modules/_struct.c Modules/_testcapimodule.c Modules/cStringIO.c Modules/datetimemodule.c Modules/dbmmodule.c Modules/future_builtins.c Modules/gdbmmodule.c Modules/itertoolsmodule.c Modules/mmapmodule.c Modules/operator.c Modules/parsermodule.c Modules/signalmodule.c Modules/syslogmodule.c Objects/abstract.c Objects/cellobject.c Objects/dictobject.c Objects/fileobject.c Objects/floatobject.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Objects/stringlib/formatter.h Objects/stringlib/string_format.h Objects/stringlib/stringdefs.h Objects/stringlib/unicodedefs.h Objects/stringobject.c Objects/typeobject.c Objects/unicodeobject.c PC/VC6/pythoncore.dsp PC/VS7.1/pythoncore.vcproj PC/VS8.0/build_tkinter.py PC/VS8.0/pythoncore.vcproj PC/config.c PCbuild/build_tkinter.py PCbuild/pythoncore.vcproj Parser/Python.asdl Parser/asdl_c.py Parser/parser.h Parser/spark.py Python/Python-ast.c Python/ast.c Python/bltinmodule.c Python/compile.c Python/formatter_string.c Python/formatter_unicode.c Python/getargs.c Python/graminit.c Python/import.c Python/mystrtoul.c Python/peephole.c Python/pystrtod.c Python/pythonrun.c Python/symtable.c Tools/compiler/ast.txt Tools/compiler/astgen.py Tools/compiler/dumppyc.py Tools/faqwiz/faqw.py Tools/modulator/Tkextra.py Tools/pybench/systimes.py Tools/pynche/ChipViewer.py Tools/pynche/TypeinViewer.py Tools/scripts/logmerge.py Tools/scripts/nm2def.py Tools/scripts/pindent.py Tools/scripts/pysource.py Tools/scripts/reindent.py Tools/scripts/xxci.py Tools/ssl/get-remote-certificate.py Tools/unicode/gencodec.py Tools/webchecker/wcgui.py Tools/webchecker/wsgui.py setup.py

christian.heimes python-checkins at python.org
Thu Feb 28 21:09:33 CET 2008


Author: christian.heimes
Date: Thu Feb 28 21:09:17 2008
New Revision: 61111

Added:
   python/branches/trunk-math/Include/formatter_string.h
      - copied unchanged from r61105, python/trunk/Include/formatter_string.h
   python/branches/trunk-math/Include/formatter_unicode.h
      - copied unchanged from r61105, python/trunk/Include/formatter_unicode.h
   python/branches/trunk-math/Lib/test/test_SimpleHTTPServer.py
      - copied unchanged from r61105, python/trunk/Lib/test/test_SimpleHTTPServer.py
   python/branches/trunk-math/Lib/test/test_future_builtins.py
      - copied unchanged from r61105, python/trunk/Lib/test/test_future_builtins.py
   python/branches/trunk-math/Lib/test/test_mutex.py
      - copied unchanged from r61105, python/trunk/Lib/test/test_mutex.py
   python/branches/trunk-math/Modules/future_builtins.c
      - copied unchanged from r61105, python/trunk/Modules/future_builtins.c
   python/branches/trunk-math/Objects/stringlib/formatter.h
      - copied unchanged from r61105, python/trunk/Objects/stringlib/formatter.h
   python/branches/trunk-math/Objects/stringlib/string_format.h
      - copied unchanged from r61105, python/trunk/Objects/stringlib/string_format.h
   python/branches/trunk-math/Objects/stringlib/stringdefs.h
      - copied unchanged from r61105, python/trunk/Objects/stringlib/stringdefs.h
   python/branches/trunk-math/Objects/stringlib/unicodedefs.h
      - copied unchanged from r61105, python/trunk/Objects/stringlib/unicodedefs.h
   python/branches/trunk-math/Python/formatter_string.c
      - copied unchanged from r61105, python/trunk/Python/formatter_string.c
   python/branches/trunk-math/Python/formatter_unicode.c
      - copied unchanged from r61105, python/trunk/Python/formatter_unicode.c
Removed:
   python/branches/trunk-math/Lib/test/output/test_logging
Modified:
   python/branches/trunk-math/   (props changed)
   python/branches/trunk-math/Demo/tkinter/guido/ShellWindow.py
   python/branches/trunk-math/Doc/Makefile
   python/branches/trunk-math/Doc/README.txt
   python/branches/trunk-math/Doc/c-api/long.rst
   python/branches/trunk-math/Doc/c-api/objbuffer.rst
   python/branches/trunk-math/Doc/c-api/tuple.rst
   python/branches/trunk-math/Doc/c-api/typeobj.rst
   python/branches/trunk-math/Doc/conf.py
   python/branches/trunk-math/Doc/distutils/builtdist.rst
   python/branches/trunk-math/Doc/distutils/packageindex.rst
   python/branches/trunk-math/Doc/distutils/setupscript.rst
   python/branches/trunk-math/Doc/howto/advocacy.rst
   python/branches/trunk-math/Doc/howto/doanddont.rst
   python/branches/trunk-math/Doc/howto/functional.rst
   python/branches/trunk-math/Doc/howto/regex.rst
   python/branches/trunk-math/Doc/howto/sockets.rst
   python/branches/trunk-math/Doc/library/basehttpserver.rst
   python/branches/trunk-math/Doc/library/codecs.rst
   python/branches/trunk-math/Doc/library/collections.rst
   python/branches/trunk-math/Doc/library/configparser.rst
   python/branches/trunk-math/Doc/library/decimal.rst
   python/branches/trunk-math/Doc/library/difflib.rst
   python/branches/trunk-math/Doc/library/dis.rst
   python/branches/trunk-math/Doc/library/inspect.rst
   python/branches/trunk-math/Doc/library/itertools.rst
   python/branches/trunk-math/Doc/library/logging.rst
   python/branches/trunk-math/Doc/library/mailbox.rst
   python/branches/trunk-math/Doc/library/modulefinder.rst
   python/branches/trunk-math/Doc/library/msilib.rst
   python/branches/trunk-math/Doc/library/operator.rst
   python/branches/trunk-math/Doc/library/optparse.rst
   python/branches/trunk-math/Doc/library/pickle.rst
   python/branches/trunk-math/Doc/library/platform.rst
   python/branches/trunk-math/Doc/library/profile.rst
   python/branches/trunk-math/Doc/library/random.rst
   python/branches/trunk-math/Doc/library/re.rst
   python/branches/trunk-math/Doc/library/signal.rst
   python/branches/trunk-math/Doc/library/simplexmlrpcserver.rst
   python/branches/trunk-math/Doc/library/socket.rst
   python/branches/trunk-math/Doc/library/tokenize.rst
   python/branches/trunk-math/Doc/library/trace.rst
   python/branches/trunk-math/Doc/library/userdict.rst
   python/branches/trunk-math/Doc/library/weakref.rst
   python/branches/trunk-math/Doc/library/xml.dom.rst
   python/branches/trunk-math/Doc/library/xml.etree.elementtree.rst
   python/branches/trunk-math/Doc/library/xmlrpclib.rst
   python/branches/trunk-math/Doc/reference/compound_stmts.rst
   python/branches/trunk-math/Doc/reference/expressions.rst
   python/branches/trunk-math/Doc/reference/index.rst
   python/branches/trunk-math/Doc/tutorial/interpreter.rst
   python/branches/trunk-math/Doc/tutorial/stdlib2.rst
   python/branches/trunk-math/Doc/using/cmdline.rst
   python/branches/trunk-math/Doc/using/unix.rst
   python/branches/trunk-math/Doc/using/windows.rst
   python/branches/trunk-math/Doc/whatsnew/2.6.rst
   python/branches/trunk-math/Grammar/Grammar
   python/branches/trunk-math/Include/Python-ast.h
   python/branches/trunk-math/Include/abstract.h
   python/branches/trunk-math/Include/graminit.h
   python/branches/trunk-math/Include/longintrepr.h
   python/branches/trunk-math/Include/object.h
   python/branches/trunk-math/Lib/BaseHTTPServer.py
   python/branches/trunk-math/Lib/ConfigParser.py
   python/branches/trunk-math/Lib/SimpleHTTPServer.py
   python/branches/trunk-math/Lib/UserDict.py
   python/branches/trunk-math/Lib/abc.py
   python/branches/trunk-math/Lib/bsddb/test/test_associate.py
   python/branches/trunk-math/Lib/bsddb/test/test_basics.py
   python/branches/trunk-math/Lib/bsddb/test/test_compare.py
   python/branches/trunk-math/Lib/bsddb/test/test_compat.py
   python/branches/trunk-math/Lib/bsddb/test/test_cursor_pget_bug.py
   python/branches/trunk-math/Lib/bsddb/test/test_dbobj.py
   python/branches/trunk-math/Lib/bsddb/test/test_dbshelve.py
   python/branches/trunk-math/Lib/bsddb/test/test_dbtables.py
   python/branches/trunk-math/Lib/bsddb/test/test_env_close.py
   python/branches/trunk-math/Lib/bsddb/test/test_get_none.py
   python/branches/trunk-math/Lib/bsddb/test/test_join.py
   python/branches/trunk-math/Lib/bsddb/test/test_lock.py
   python/branches/trunk-math/Lib/bsddb/test/test_misc.py
   python/branches/trunk-math/Lib/bsddb/test/test_pickle.py
   python/branches/trunk-math/Lib/bsddb/test/test_queue.py
   python/branches/trunk-math/Lib/bsddb/test/test_recno.py
   python/branches/trunk-math/Lib/bsddb/test/test_sequence.py
   python/branches/trunk-math/Lib/bsddb/test/test_thread.py
   python/branches/trunk-math/Lib/compiler/ast.py
   python/branches/trunk-math/Lib/compiler/transformer.py
   python/branches/trunk-math/Lib/copy_reg.py
   python/branches/trunk-math/Lib/ctypes/__init__.py
   python/branches/trunk-math/Lib/ctypes/macholib/dyld.py
   python/branches/trunk-math/Lib/ctypes/test/__init__.py
   python/branches/trunk-math/Lib/ctypes/test/test_cfuncs.py
   python/branches/trunk-math/Lib/ctypes/test/test_checkretval.py
   python/branches/trunk-math/Lib/ctypes/test/test_find.py
   python/branches/trunk-math/Lib/ctypes/test/test_libc.py
   python/branches/trunk-math/Lib/ctypes/test/test_loading.py
   python/branches/trunk-math/Lib/ctypes/test/test_macholib.py
   python/branches/trunk-math/Lib/ctypes/test/test_numbers.py
   python/branches/trunk-math/Lib/ctypes/test/test_random_things.py
   python/branches/trunk-math/Lib/curses/__init__.py
   python/branches/trunk-math/Lib/curses/wrapper.py
   python/branches/trunk-math/Lib/decimal.py
   python/branches/trunk-math/Lib/distutils/archive_util.py
   python/branches/trunk-math/Lib/distutils/bcppcompiler.py
   python/branches/trunk-math/Lib/distutils/ccompiler.py
   python/branches/trunk-math/Lib/distutils/command/bdist.py
   python/branches/trunk-math/Lib/distutils/command/bdist_dumb.py
   python/branches/trunk-math/Lib/distutils/command/bdist_msi.py
   python/branches/trunk-math/Lib/distutils/command/bdist_rpm.py
   python/branches/trunk-math/Lib/distutils/command/build_ext.py
   python/branches/trunk-math/Lib/distutils/command/build_py.py
   python/branches/trunk-math/Lib/distutils/command/build_scripts.py
   python/branches/trunk-math/Lib/distutils/command/install.py
   python/branches/trunk-math/Lib/distutils/command/install_headers.py
   python/branches/trunk-math/Lib/distutils/command/install_lib.py
   python/branches/trunk-math/Lib/distutils/command/register.py
   python/branches/trunk-math/Lib/distutils/command/sdist.py
   python/branches/trunk-math/Lib/distutils/command/upload.py
   python/branches/trunk-math/Lib/distutils/core.py
   python/branches/trunk-math/Lib/distutils/dir_util.py
   python/branches/trunk-math/Lib/distutils/dist.py
   python/branches/trunk-math/Lib/distutils/fancy_getopt.py
   python/branches/trunk-math/Lib/distutils/filelist.py
   python/branches/trunk-math/Lib/distutils/msvccompiler.py
   python/branches/trunk-math/Lib/distutils/sysconfig.py
   python/branches/trunk-math/Lib/distutils/tests/test_dist.py
   python/branches/trunk-math/Lib/distutils/tests/test_sysconfig.py
   python/branches/trunk-math/Lib/distutils/text_file.py
   python/branches/trunk-math/Lib/distutils/unixccompiler.py
   python/branches/trunk-math/Lib/distutils/util.py
   python/branches/trunk-math/Lib/email/base64mime.py
   python/branches/trunk-math/Lib/email/utils.py
   python/branches/trunk-math/Lib/hotshot/log.py
   python/branches/trunk-math/Lib/hotshot/stones.py
   python/branches/trunk-math/Lib/httplib.py
   python/branches/trunk-math/Lib/idlelib/MultiCall.py
   python/branches/trunk-math/Lib/idlelib/RemoteDebugger.py
   python/branches/trunk-math/Lib/idlelib/TreeWidget.py
   python/branches/trunk-math/Lib/idlelib/UndoDelegator.py
   python/branches/trunk-math/Lib/idlelib/configDialog.py
   python/branches/trunk-math/Lib/idlelib/keybindingDialog.py
   python/branches/trunk-math/Lib/idlelib/run.py
   python/branches/trunk-math/Lib/imaplib.py
   python/branches/trunk-math/Lib/inspect.py
   python/branches/trunk-math/Lib/lib-tk/tkSimpleDialog.py
   python/branches/trunk-math/Lib/logging/handlers.py
   python/branches/trunk-math/Lib/ntpath.py
   python/branches/trunk-math/Lib/plat-mac/MiniAEFrame.py
   python/branches/trunk-math/Lib/plat-mac/aepack.py
   python/branches/trunk-math/Lib/plat-mac/bgenlocations.py
   python/branches/trunk-math/Lib/plat-mac/macostools.py
   python/branches/trunk-math/Lib/plat-riscos/rourl2path.py
   python/branches/trunk-math/Lib/popen2.py
   python/branches/trunk-math/Lib/pydoc.py
   python/branches/trunk-math/Lib/runpy.py
   python/branches/trunk-math/Lib/smtplib.py
   python/branches/trunk-math/Lib/socket.py
   python/branches/trunk-math/Lib/sqlite3/test/hooks.py
   python/branches/trunk-math/Lib/ssl.py
   python/branches/trunk-math/Lib/string.py
   python/branches/trunk-math/Lib/symbol.py
   python/branches/trunk-math/Lib/test/fork_wait.py
   python/branches/trunk-math/Lib/test/list_tests.py
   python/branches/trunk-math/Lib/test/seq_tests.py
   python/branches/trunk-math/Lib/test/string_tests.py
   python/branches/trunk-math/Lib/test/test_MimeWriter.py
   python/branches/trunk-math/Lib/test/test___all__.py
   python/branches/trunk-math/Lib/test/test_abc.py
   python/branches/trunk-math/Lib/test/test_applesingle.py
   python/branches/trunk-math/Lib/test/test_array.py
   python/branches/trunk-math/Lib/test/test_ast.py
   python/branches/trunk-math/Lib/test/test_bisect.py
   python/branches/trunk-math/Lib/test/test_bsddb185.py
   python/branches/trunk-math/Lib/test/test_bsddb3.py
   python/branches/trunk-math/Lib/test/test_builtin.py
   python/branches/trunk-math/Lib/test/test_cfgparser.py
   python/branches/trunk-math/Lib/test/test_class.py
   python/branches/trunk-math/Lib/test/test_cmd.py
   python/branches/trunk-math/Lib/test/test_coercion.py
   python/branches/trunk-math/Lib/test/test_compare.py
   python/branches/trunk-math/Lib/test/test_compiler.py
   python/branches/trunk-math/Lib/test/test_copy.py
   python/branches/trunk-math/Lib/test/test_cpickle.py
   python/branches/trunk-math/Lib/test/test_curses.py
   python/branches/trunk-math/Lib/test/test_datetime.py
   python/branches/trunk-math/Lib/test/test_dbm.py
   python/branches/trunk-math/Lib/test/test_decorators.py
   python/branches/trunk-math/Lib/test/test_deque.py
   python/branches/trunk-math/Lib/test/test_descrtut.py
   python/branches/trunk-math/Lib/test/test_dict.py
   python/branches/trunk-math/Lib/test/test_dis.py
   python/branches/trunk-math/Lib/test/test_doctest.py
   python/branches/trunk-math/Lib/test/test_dummy_threading.py
   python/branches/trunk-math/Lib/test/test_email.py
   python/branches/trunk-math/Lib/test/test_email_renamed.py
   python/branches/trunk-math/Lib/test/test_eof.py
   python/branches/trunk-math/Lib/test/test_extcall.py
   python/branches/trunk-math/Lib/test/test_file.py
   python/branches/trunk-math/Lib/test/test_fileinput.py
   python/branches/trunk-math/Lib/test/test_format.py
   python/branches/trunk-math/Lib/test/test_fractions.py
   python/branches/trunk-math/Lib/test/test_ftplib.py
   python/branches/trunk-math/Lib/test/test_getargs2.py
   python/branches/trunk-math/Lib/test/test_grammar.py
   python/branches/trunk-math/Lib/test/test_gzip.py
   python/branches/trunk-math/Lib/test/test_heapq.py
   python/branches/trunk-math/Lib/test/test_htmlparser.py
   python/branches/trunk-math/Lib/test/test_httplib.py
   python/branches/trunk-math/Lib/test/test_imgfile.py
   python/branches/trunk-math/Lib/test/test_imp.py
   python/branches/trunk-math/Lib/test/test_index.py
   python/branches/trunk-math/Lib/test/test_inspect.py
   python/branches/trunk-math/Lib/test/test_itertools.py
   python/branches/trunk-math/Lib/test/test_linuxaudiodev.py
   python/branches/trunk-math/Lib/test/test_list.py
   python/branches/trunk-math/Lib/test/test_logging.py
   python/branches/trunk-math/Lib/test/test_minidom.py
   python/branches/trunk-math/Lib/test/test_mmap.py
   python/branches/trunk-math/Lib/test/test_module.py
   python/branches/trunk-math/Lib/test/test_modulefinder.py
   python/branches/trunk-math/Lib/test/test_multibytecodec_support.py
   python/branches/trunk-math/Lib/test/test_operator.py
   python/branches/trunk-math/Lib/test/test_optparse.py
   python/branches/trunk-math/Lib/test/test_ossaudiodev.py
   python/branches/trunk-math/Lib/test/test_parser.py
   python/branches/trunk-math/Lib/test/test_pickle.py
   python/branches/trunk-math/Lib/test/test_pkg.py
   python/branches/trunk-math/Lib/test/test_plistlib.py
   python/branches/trunk-math/Lib/test/test_poll.py
   python/branches/trunk-math/Lib/test/test_posix.py
   python/branches/trunk-math/Lib/test/test_pyclbr.py
   python/branches/trunk-math/Lib/test/test_quopri.py
   python/branches/trunk-math/Lib/test/test_resource.py
   python/branches/trunk-math/Lib/test/test_rfc822.py
   python/branches/trunk-math/Lib/test/test_scope.py
   python/branches/trunk-math/Lib/test/test_scriptpackages.py
   python/branches/trunk-math/Lib/test/test_sgmllib.py
   python/branches/trunk-math/Lib/test/test_shlex.py
   python/branches/trunk-math/Lib/test/test_signal.py
   python/branches/trunk-math/Lib/test/test_site.py
   python/branches/trunk-math/Lib/test/test_smtplib.py
   python/branches/trunk-math/Lib/test/test_socketserver.py
   python/branches/trunk-math/Lib/test/test_sqlite.py
   python/branches/trunk-math/Lib/test/test_str.py
   python/branches/trunk-math/Lib/test/test_strftime.py
   python/branches/trunk-math/Lib/test/test_string.py
   python/branches/trunk-math/Lib/test/test_sunaudiodev.py
   python/branches/trunk-math/Lib/test/test_support.py
   python/branches/trunk-math/Lib/test/test_threading.py
   python/branches/trunk-math/Lib/test/test_tuple.py
   python/branches/trunk-math/Lib/test/test_types.py
   python/branches/trunk-math/Lib/test/test_unicode.py
   python/branches/trunk-math/Lib/test/test_unpack.py
   python/branches/trunk-math/Lib/test/test_urllib.py
   python/branches/trunk-math/Lib/test/test_urllib2.py
   python/branches/trunk-math/Lib/test/test_urllib2_localnet.py
   python/branches/trunk-math/Lib/test/test_userdict.py
   python/branches/trunk-math/Lib/test/test_userlist.py
   python/branches/trunk-math/Lib/test/test_userstring.py
   python/branches/trunk-math/Lib/test/test_uu.py
   python/branches/trunk-math/Lib/test/test_whichdb.py
   python/branches/trunk-math/Lib/test/test_xml_etree.py
   python/branches/trunk-math/Lib/test/test_xml_etree_c.py
   python/branches/trunk-math/Lib/test/test_xmlrpc.py
   python/branches/trunk-math/Lib/test/test_xpickle.py
   python/branches/trunk-math/Lib/test/test_zipfile64.py
   python/branches/trunk-math/Lib/threading.py
   python/branches/trunk-math/Lib/token.py
   python/branches/trunk-math/Lib/trace.py
   python/branches/trunk-math/Lib/xml/dom/minidom.py
   python/branches/trunk-math/Lib/xmlrpclib.py
   python/branches/trunk-math/Mac/Demo/PICTbrowse/ICONbrowse.py
   python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse.py
   python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse2.py
   python/branches/trunk-math/Mac/Demo/PICTbrowse/cicnbrowse.py
   python/branches/trunk-math/Mac/Demo/PICTbrowse/oldPICTbrowse.py
   python/branches/trunk-math/Mac/Demo/example1/dnslookup-1.py
   python/branches/trunk-math/Mac/Demo/example2/dnslookup-2.py
   python/branches/trunk-math/Mac/Demo/imgbrowse/imgbrowse.py
   python/branches/trunk-math/Mac/Demo/imgbrowse/mac_image.py
   python/branches/trunk-math/Mac/Demo/sound/morse.py
   python/branches/trunk-math/Mac/Modules/ae/aescan.py
   python/branches/trunk-math/Mac/Modules/ah/ahscan.py
   python/branches/trunk-math/Mac/Modules/app/appscan.py
   python/branches/trunk-math/Mac/Modules/carbonevt/CarbonEvtscan.py
   python/branches/trunk-math/Mac/Modules/cf/cfscan.py
   python/branches/trunk-math/Mac/Modules/cg/cgscan.py
   python/branches/trunk-math/Mac/Modules/cm/cmscan.py
   python/branches/trunk-math/Mac/Modules/ctl/ctlscan.py
   python/branches/trunk-math/Mac/Modules/dlg/dlgscan.py
   python/branches/trunk-math/Mac/Modules/drag/dragscan.py
   python/branches/trunk-math/Mac/Modules/evt/evtscan.py
   python/branches/trunk-math/Mac/Modules/file/filescan.py
   python/branches/trunk-math/Mac/Modules/fm/fmscan.py
   python/branches/trunk-math/Mac/Modules/folder/folderscan.py
   python/branches/trunk-math/Mac/Modules/help/helpscan.py
   python/branches/trunk-math/Mac/Modules/ibcarbon/IBCarbonscan.py
   python/branches/trunk-math/Mac/Modules/icn/icnscan.py
   python/branches/trunk-math/Mac/Modules/launch/launchscan.py
   python/branches/trunk-math/Mac/Modules/list/listscan.py
   python/branches/trunk-math/Mac/Modules/menu/menuscan.py
   python/branches/trunk-math/Mac/Modules/mlte/mltescan.py
   python/branches/trunk-math/Mac/Modules/osa/osascan.py
   python/branches/trunk-math/Mac/Modules/qd/qdscan.py
   python/branches/trunk-math/Mac/Modules/qdoffs/qdoffsscan.py
   python/branches/trunk-math/Mac/Modules/qt/qtscan.py
   python/branches/trunk-math/Mac/Modules/res/resscan.py
   python/branches/trunk-math/Mac/Modules/scrap/scrapscan.py
   python/branches/trunk-math/Mac/Modules/snd/sndscan.py
   python/branches/trunk-math/Mac/Modules/te/tescan.py
   python/branches/trunk-math/Mac/Modules/win/winscan.py
   python/branches/trunk-math/Makefile.pre.in
   python/branches/trunk-math/Misc/ACKS
   python/branches/trunk-math/Misc/BeOS-setup.py
   python/branches/trunk-math/Misc/HISTORY
   python/branches/trunk-math/Misc/NEWS
   python/branches/trunk-math/Misc/cheatsheet
   python/branches/trunk-math/Modules/_ctypes/_ctypes_test.c
   python/branches/trunk-math/Modules/_ctypes/libffi/configure
   python/branches/trunk-math/Modules/_ctypes/libffi/configure.ac
   python/branches/trunk-math/Modules/_ctypes/libffi/fficonfig.h.in
   python/branches/trunk-math/Modules/_struct.c
   python/branches/trunk-math/Modules/_testcapimodule.c
   python/branches/trunk-math/Modules/cStringIO.c
   python/branches/trunk-math/Modules/datetimemodule.c
   python/branches/trunk-math/Modules/dbmmodule.c
   python/branches/trunk-math/Modules/gdbmmodule.c
   python/branches/trunk-math/Modules/itertoolsmodule.c
   python/branches/trunk-math/Modules/mmapmodule.c
   python/branches/trunk-math/Modules/operator.c
   python/branches/trunk-math/Modules/parsermodule.c
   python/branches/trunk-math/Modules/signalmodule.c
   python/branches/trunk-math/Modules/syslogmodule.c
   python/branches/trunk-math/Objects/abstract.c
   python/branches/trunk-math/Objects/cellobject.c
   python/branches/trunk-math/Objects/dictobject.c
   python/branches/trunk-math/Objects/fileobject.c
   python/branches/trunk-math/Objects/floatobject.c
   python/branches/trunk-math/Objects/intobject.c
   python/branches/trunk-math/Objects/listobject.c
   python/branches/trunk-math/Objects/longobject.c
   python/branches/trunk-math/Objects/stringobject.c
   python/branches/trunk-math/Objects/typeobject.c
   python/branches/trunk-math/Objects/unicodeobject.c
   python/branches/trunk-math/PC/VC6/pythoncore.dsp
   python/branches/trunk-math/PC/VS7.1/pythoncore.vcproj
   python/branches/trunk-math/PC/VS8.0/build_tkinter.py
   python/branches/trunk-math/PC/VS8.0/pythoncore.vcproj
   python/branches/trunk-math/PC/config.c
   python/branches/trunk-math/PCbuild/build_tkinter.py
   python/branches/trunk-math/PCbuild/pythoncore.vcproj
   python/branches/trunk-math/Parser/Python.asdl
   python/branches/trunk-math/Parser/asdl_c.py
   python/branches/trunk-math/Parser/parser.h
   python/branches/trunk-math/Parser/spark.py
   python/branches/trunk-math/Python/Python-ast.c
   python/branches/trunk-math/Python/ast.c
   python/branches/trunk-math/Python/bltinmodule.c
   python/branches/trunk-math/Python/compile.c
   python/branches/trunk-math/Python/getargs.c
   python/branches/trunk-math/Python/graminit.c
   python/branches/trunk-math/Python/import.c
   python/branches/trunk-math/Python/mystrtoul.c
   python/branches/trunk-math/Python/peephole.c
   python/branches/trunk-math/Python/pystrtod.c
   python/branches/trunk-math/Python/pythonrun.c
   python/branches/trunk-math/Python/symtable.c
   python/branches/trunk-math/Tools/compiler/ast.txt
   python/branches/trunk-math/Tools/compiler/astgen.py
   python/branches/trunk-math/Tools/compiler/dumppyc.py
   python/branches/trunk-math/Tools/faqwiz/faqw.py
   python/branches/trunk-math/Tools/modulator/Tkextra.py
   python/branches/trunk-math/Tools/pybench/systimes.py
   python/branches/trunk-math/Tools/pynche/ChipViewer.py
   python/branches/trunk-math/Tools/pynche/TypeinViewer.py
   python/branches/trunk-math/Tools/scripts/logmerge.py
   python/branches/trunk-math/Tools/scripts/nm2def.py
   python/branches/trunk-math/Tools/scripts/pindent.py
   python/branches/trunk-math/Tools/scripts/pysource.py
   python/branches/trunk-math/Tools/scripts/reindent.py
   python/branches/trunk-math/Tools/scripts/xxci.py
   python/branches/trunk-math/Tools/ssl/get-remote-certificate.py
   python/branches/trunk-math/Tools/unicode/gencodec.py
   python/branches/trunk-math/Tools/webchecker/wcgui.py
   python/branches/trunk-math/Tools/webchecker/wsgui.py
   python/branches/trunk-math/setup.py
Log:
Merged revisions 60854-61105 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60855 | georg.brandl | 2008-02-16 10:37:32 +0100 (Sat, 16 Feb 2008) | 2 lines
  
  #2120: broken links in advocacy document.
........
  r60860 | amaury.forgeotdarc | 2008-02-16 15:34:57 +0100 (Sat, 16 Feb 2008) | 23 lines
  
  Crashers of the day: Py_CLEAR must be used when there is a chance that the
  function can be called recursively.
  This was discussed in issue1020188.
  
  In python codebase, all occurrences of Py_[X]DECREF(xxx->yyy) are suspect,
  except when they appear in tp_new or tp_dealloc functions, or when
  the member cannot be of a user-defined class.
  Note that tp_init is not safe.
  
  I do have a (crashing) example for every changed line. 
  Is it worth adding them to the test suite?
  
  Example:
  
  class SpecialStr(str):
      def __del__(self):
          s.close()
  
  import cStringIO
  s = cStringIO.StringIO(SpecialStr("text"))
  s.close() # Segfault
........
  r60871 | amaury.forgeotdarc | 2008-02-16 21:55:24 +0100 (Sat, 16 Feb 2008) | 3 lines
  
  Prevent a crash with nested scopes, again caused by calling Py_DECREF when the pointer
  is still present in the containing structure.
........
  r60872 | brett.cannon | 2008-02-17 02:59:18 +0100 (Sun, 17 Feb 2008) | 4 lines
  
  Move test_logging over to doctest.
  
  Thanks to Christopher White from GHOP.
........
  r60873 | georg.brandl | 2008-02-17 12:33:38 +0100 (Sun, 17 Feb 2008) | 2 lines
  
  #2131: note that codecs.open() always opens files in binary mode.
........
  r60876 | georg.brandl | 2008-02-17 16:14:10 +0100 (Sun, 17 Feb 2008) | 2 lines
  
  Fix function name.
........
  r60877 | facundo.batista | 2008-02-17 17:21:13 +0100 (Sun, 17 Feb 2008) | 4 lines
  
  
  Now we handle different the backup copy, because of security
  issues regarding user/group and permissions. Fixes 1050828.
........
  r60878 | facundo.batista | 2008-02-17 19:59:29 +0100 (Sun, 17 Feb 2008) | 4 lines
  
  
  Issue 2112. mmap does not raises EnvironmentError no more, but
  a subclass of it. Thanks John Lenton.
........
  r60879 | eric.smith | 2008-02-17 20:46:49 +0100 (Sun, 17 Feb 2008) | 16 lines
  
  Backport of PEP 3101, Advanced String Formatting, from py3k.
  
  Highlights:
   - Adding PyObject_Format.
   - Adding string.Format class.
   - Adding __format__ for str, unicode, int, long, float, datetime.
   - Adding builtin format.
   - Adding ''.format and u''.format.
   - str/unicode fixups for formatters.
  
  The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
  unicodedefs.h, formatter.h, string_format.h) are identical in trunk
  and py3k.  Any changes from here on should be made to trunk, and
  changes will propogate to py3k).
........
  r60882 | amaury.forgeotdarc | 2008-02-17 21:56:31 +0100 (Sun, 17 Feb 2008) | 5 lines
  
  Compilation was broken on Windows since the introduction of Advanced String Formatting.
  
  Only PCBuild (vs9) was really tested.
  Changes for older compilers were done manually.
........
  r60883 | georg.brandl | 2008-02-17 22:18:55 +0100 (Sun, 17 Feb 2008) | 2 lines
  
  #2133: fix HTML color spec.
........
  r60884 | facundo.batista | 2008-02-18 04:43:43 +0100 (Mon, 18 Feb 2008) | 5 lines
  
  
  Issue #1916. Added isgenerator() and isgeneratorfunction() to
  inspect.py.  Thanks Javi Mansilla for patch review and 
  corrections.
........
  r60885 | facundo.batista | 2008-02-18 13:48:43 +0100 (Mon, 18 Feb 2008) | 4 lines
  
  
  Issue 1224. Now we support again the double slash in the URL.
  Thanks Anthony Lenton.
........
  r60887 | eric.smith | 2008-02-18 15:25:02 +0100 (Mon, 18 Feb 2008) | 1 line
  
  Temporarily removed float tests.  See issue 1600.
........
  r60891 | kristjan.jonsson | 2008-02-18 18:40:47 +0100 (Mon, 18 Feb 2008) | 1 line
  
  Perform correct handling of stack overflow for windows: Catch the correct exception code and reset the overflow condition when handled.
........
  r60893 | eric.smith | 2008-02-18 19:02:34 +0100 (Mon, 18 Feb 2008) | 1 line
  
  Added code to correct combining str and unicode in ''.format().  Added test case.
........
  r60899 | eric.smith | 2008-02-19 13:27:59 +0100 (Tue, 19 Feb 2008) | 1 line
  
  Added dependencies for stringobject.o.  This should fix failing tests in test_unicode.py.
........
  r60901 | eric.smith | 2008-02-19 14:21:56 +0100 (Tue, 19 Feb 2008) | 1 line
  
  Added PEP 3101.
........
  r60907 | georg.brandl | 2008-02-20 20:12:36 +0100 (Wed, 20 Feb 2008) | 2 lines
  
  Fixes contributed by Ori Avtalion.
........
  r60909 | eric.smith | 2008-02-21 00:34:22 +0100 (Thu, 21 Feb 2008) | 1 line
  
  Trim leading zeros from a floating point exponent, per C99.  See issue 1600.  As far as I know, this only affects Windows.  Add float type 'n' to PyOS_ascii_formatd (see PEP 3101 for 'n' description).
........
  r60910 | eric.smith | 2008-02-21 00:39:28 +0100 (Thu, 21 Feb 2008) | 1 line
  
  Now that PyOS_ascii_formatd supports the 'n' format, simplify the float formatting code to just call it.
........
  r60918 | andrew.kuchling | 2008-02-21 15:23:38 +0100 (Thu, 21 Feb 2008) | 2 lines
  
  Close manifest file.
  This change doesn't make any difference to CPython, but is a necessary fix for Jython.
........
  r60921 | guido.van.rossum | 2008-02-21 18:46:16 +0100 (Thu, 21 Feb 2008) | 2 lines
  
  Remove news about float repr() -- issue 1580 is still in limbo.
........
  r60923 | guido.van.rossum | 2008-02-21 19:18:37 +0100 (Thu, 21 Feb 2008) | 5 lines
  
  Removed uses of dict.has_key() from distutils, and uses of
  callable() from copy_reg.py, so the interpreter now starts up
  without warnings when '-3' is given.  More work like this needs to
  be done in the rest of the stdlib.
........
  r60924 | thomas.heller | 2008-02-21 19:28:48 +0100 (Thu, 21 Feb 2008) | 4 lines
  
  configure.ac: Remove the configure check for _Bool, it is already done in the
  top-level Python configure script.
  configure, fficonfig.h.in: regenerated.
........
  r60925 | thomas.heller | 2008-02-21 19:52:20 +0100 (Thu, 21 Feb 2008) | 3 lines
  
  Replace 'has_key()' with 'in'.
  Replace 'raise Error, stuff' with 'raise Error(stuff)'.
........
  r60927 | raymond.hettinger | 2008-02-21 20:24:53 +0100 (Thu, 21 Feb 2008) | 1 line
  
  Update more instances of has_key().
........
  r60928 | guido.van.rossum | 2008-02-21 20:46:35 +0100 (Thu, 21 Feb 2008) | 3 lines
  
  Fix a few typos and layout glitches (more work is needed).
  Move 2.5 news to Misc/HISTORY.
........
  r60932 | eric.smith | 2008-02-21 21:17:08 +0100 (Thu, 21 Feb 2008) | 1 line
  
  Moved test_format into the correct TestCase.
........
  r60936 | georg.brandl | 2008-02-21 21:33:38 +0100 (Thu, 21 Feb 2008) | 2 lines
  
  #2079: typo in userdict docs.
........
  r60938 | georg.brandl | 2008-02-21 21:38:13 +0100 (Thu, 21 Feb 2008) | 2 lines
  
  Part of #2154: minimal syntax fixes in doc example snippets.
........
  r60942 | raymond.hettinger | 2008-02-22 04:16:42 +0100 (Fri, 22 Feb 2008) | 1 line
  
  First draft for itertools.product().  Docs and other updates forthcoming.
........
  r60955 | nick.coghlan | 2008-02-22 11:54:06 +0100 (Fri, 22 Feb 2008) | 1 line
  
  Try to make command line error messages from runpy easier to understand (and suppress traceback cruft from the implicitly invoked runpy machinery)
........
  r60956 | georg.brandl | 2008-02-22 13:31:45 +0100 (Fri, 22 Feb 2008) | 2 lines
  
  A lot more typo fixes by Ori Avtalion.
........
  r60957 | georg.brandl | 2008-02-22 13:56:34 +0100 (Fri, 22 Feb 2008) | 2 lines
  
  Don't reference pyshell.
........
  r60958 | georg.brandl | 2008-02-22 13:57:05 +0100 (Fri, 22 Feb 2008) | 2 lines
  
  Another fix.
........
  r60962 | eric.smith | 2008-02-22 17:30:22 +0100 (Fri, 22 Feb 2008) | 1 line
  
  Added bin() builtin.  I'm going to check in the tests in a seperate checkin, because the builtin doesn't need to be ported to py3k, but the tests are missing in py3k and need to be merged there.
........
  r60965 | eric.smith | 2008-02-22 18:43:17 +0100 (Fri, 22 Feb 2008) | 1 line
  
  Tests for bin() builtin.  These need to get merged into py3k, which has no tests for bin.
........
  r60968 | raymond.hettinger | 2008-02-22 20:50:06 +0100 (Fri, 22 Feb 2008) | 1 line
  
  Document itertools.product().
........
  r60969 | raymond.hettinger | 2008-02-23 03:20:41 +0100 (Sat, 23 Feb 2008) | 9 lines
  
  Improve the implementation of itertools.product()
  
  * Fix-up issues pointed-out by Neal Norwitz.
  * Add extensive comments.
  * The lz->result variable is now a tuple instead of a list.
  * Use fast macro getitem/setitem calls so most code is in-line.
  * Re-use the result tuple if available (modify in-place instead of copy).
........
  r60970 | eric.smith | 2008-02-23 04:09:44 +0100 (Sat, 23 Feb 2008) | 1 line
  
  Added future_builtins, which contains PEP 3127 compatible versions of hex() and oct().
........
  r60972 | raymond.hettinger | 2008-02-23 05:03:50 +0100 (Sat, 23 Feb 2008) | 1 line
  
  Add more comments
........
  r60973 | raymond.hettinger | 2008-02-23 11:04:15 +0100 (Sat, 23 Feb 2008) | 1 line
  
  Add recipe using itertools.product().
........
  r60974 | facundo.batista | 2008-02-23 13:01:13 +0100 (Sat, 23 Feb 2008) | 6 lines
  
  
  Issue 1881. Increased the stack limit from 500 to 1500. Also added
  a test for this (and because of this test you'll see in stderr a
  message that parser.c sends before raising MemoryError).
  Thanks Ralf Schmitt.
........
  r60975 | facundo.batista | 2008-02-23 13:27:17 +0100 (Sat, 23 Feb 2008) | 4 lines
  
  
  Issue 1776581. Minor corrections to smtplib, and two small tests.
  Thanks Alan McIntyre.
........
  r60976 | facundo.batista | 2008-02-23 13:46:10 +0100 (Sat, 23 Feb 2008) | 5 lines
  
  
  Issue 1781. Now ConfigParser.add_section does not let you add a
  DEFAULT section any more, because it duplicated sections with
  the rest of the machinery. Thanks Tim Lesher and Manuel Kaufmann.
........
  r60978 | christian.heimes | 2008-02-23 16:01:05 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  Patch #1759: Backport of PEP 3129 class decorators
  with some help from Georg
........
  r60980 | georg.brandl | 2008-02-23 16:02:28 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #1492: allow overriding BaseHTTPServer's content type for error messages.
........
  r60982 | georg.brandl | 2008-02-23 16:06:25 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #2165: fix test_logging failure on some machines.
........
  r60983 | facundo.batista | 2008-02-23 16:07:35 +0100 (Sat, 23 Feb 2008) | 6 lines
  
  
  Issue 1089358.  Adds the siginterrupt() function, that is just a 
  wrapper around the system call with the same name.  Also added
  test cases, doc changes and NEWS entry. Thanks Jason and Ralf
  Schmitt.
........
  r60984 | georg.brandl | 2008-02-23 16:11:18 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #2067: file.__exit__() now calls subclasses' close() method.
........
  r60985 | georg.brandl | 2008-02-23 16:19:54 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  More difflib examples. Written for GHOP by Josip Dzolonga.
........
  r60987 | andrew.kuchling | 2008-02-23 16:41:51 +0100 (Sat, 23 Feb 2008) | 1 line
  
  #2072: correct documentation for .rpc_paths
........
  r60988 | georg.brandl | 2008-02-23 16:43:48 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #2161: Fix opcode name.
........
  r60989 | andrew.kuchling | 2008-02-23 16:49:35 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #1119331: ncurses will just call exit() if the terminal name isn't found.
  Call setupterm() first so that we get a Python exception instead of just existing.
........
  r60990 | eric.smith | 2008-02-23 17:05:26 +0100 (Sat, 23 Feb 2008) | 1 line
  
  Removed duplicate Py_CHARMASK define.  It's already defined in Python.h.
........
  r60991 | andrew.kuchling | 2008-02-23 17:23:05 +0100 (Sat, 23 Feb 2008) | 4 lines
  
  #1330538: Improve comparison of xmlrpclib.DateTime and datetime instances.
  Remove automatic handling of datetime.date and datetime.time.
  This breaks backward compatibility, but python-dev discussion was strongly 
  against this automatic conversion; see the bug for a link.
........
  r60994 | andrew.kuchling | 2008-02-23 17:39:43 +0100 (Sat, 23 Feb 2008) | 1 line
  
  #835521: Add index entries for various pickle-protocol methods and attributes
........
  r60995 | andrew.kuchling | 2008-02-23 18:10:46 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #1433694: minidom's .normalize() failed to set .nextSibling for last element.
  Fix by Malte Helmert
........
  r61000 | christian.heimes | 2008-02-23 18:40:11 +0100 (Sat, 23 Feb 2008) | 1 line
  
  Patch #2167 from calvin: Remove unused imports
........
  r61001 | christian.heimes | 2008-02-23 18:42:31 +0100 (Sat, 23 Feb 2008) | 1 line
  
  Patch #1957: syslogmodule: Release GIL when calling syslog(3)
........
  r61002 | christian.heimes | 2008-02-23 18:52:07 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  Issue #2051 and patch from Alexander Belopolsky:
  Permission for pyc and pyo files are inherited from the py file.
........
  r61004 | georg.brandl | 2008-02-23 19:47:04 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  Documentation coverage builder, part 1.
........
  r61006 | andrew.kuchling | 2008-02-23 20:02:33 +0100 (Sat, 23 Feb 2008) | 1 line
  
  #1389051: IMAP module tries to read entire message in one chunk.  Patch by Fredrik Lundh.
........
  r61008 | andrew.kuchling | 2008-02-23 20:28:58 +0100 (Sat, 23 Feb 2008) | 1 line
  
  #1389051, #1092502: fix excessively large allocations when using read() on a socket
........
  r61011 | jeffrey.yasskin | 2008-02-23 20:40:54 +0100 (Sat, 23 Feb 2008) | 13 lines
  
  Prevent classes like:
      class RunSelfFunction(object):
          def __init__(self):
              self.thread = threading.Thread(target=self._run)
              self.thread.start()
          def _run(self):
              pass
  from creating a permanent cycle between the object and the thread by having the
  Thread delete its references to the object when it completes.
  
  As an example of the effect of this bug, paramiko.Transport inherits from
  Thread to avoid it.
........
  r61013 | jeffrey.yasskin | 2008-02-23 21:40:35 +0100 (Sat, 23 Feb 2008) | 3 lines
  
  Followup to r61011: Also avoid the reference cycle when the Thread's target
  raises an exception.
........
  r61017 | georg.brandl | 2008-02-23 22:59:11 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #2101: fix removeAttribute docs.
........
  r61018 | georg.brandl | 2008-02-23 23:05:38 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  Add examples to modulefinder docs. Written for GHOP by Josip Dzolonga.
........
  r61019 | georg.brandl | 2008-02-23 23:09:24 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  Use os.closerange() in popen2.
........
  r61020 | georg.brandl | 2008-02-23 23:14:02 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  Use os.closerange().
........
  r61021 | georg.brandl | 2008-02-23 23:35:33 +0100 (Sat, 23 Feb 2008) | 3 lines
  
  In test_heapq and test_bisect, test both the Python and the C implementation.
  Originally written for GHOP by Josip Dzolonga, heavily patched by me.
........
  r61024 | facundo.batista | 2008-02-23 23:54:12 +0100 (Sat, 23 Feb 2008) | 3 lines
  
  
  Added simple test case. Thanks Benjamin Peterson.
........
  r61025 | georg.brandl | 2008-02-23 23:55:18 +0100 (Sat, 23 Feb 2008) | 2 lines
  
  #1825: correctly document msilib.add_data.
........
  r61027 | georg.brandl | 2008-02-24 00:02:23 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  #1826: allow dotted attribute paths in operator.attrgetter.
........
  r61028 | georg.brandl | 2008-02-24 00:04:35 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  #1506171: added operator.methodcaller().
........
  r61029 | georg.brandl | 2008-02-24 00:25:26 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  Document import ./. threading issues. #1720705.
........
  r61032 | georg.brandl | 2008-02-24 00:43:01 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  Specify what kind of warning -3 emits.
........
  r61033 | christian.heimes | 2008-02-24 00:59:45 +0100 (Sun, 24 Feb 2008) | 1 line
  
  MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.
........
  r61034 | georg.brandl | 2008-02-24 01:03:22 +0100 (Sun, 24 Feb 2008) | 4 lines
  
  #900744: If an invalid chunked-encoding header is sent by a server,
  httplib will now raise IncompleteRead and close the connection instead
  of raising ValueError.
........
  r61035 | georg.brandl | 2008-02-24 01:14:24 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  #1627: httplib now ignores negative Content-Length headers.
........
  r61037 | neal.norwitz | 2008-02-24 03:20:25 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  map(None, ...) is not supported in 3.0.
........
  r61039 | andrew.kuchling | 2008-02-24 03:39:15 +0100 (Sun, 24 Feb 2008) | 1 line
  
  Remove stray word
........
  r61040 | neal.norwitz | 2008-02-24 03:40:58 +0100 (Sun, 24 Feb 2008) | 3 lines
  
  Add a little info to the 3k deprecation warnings about what to use instead.
  Suggested by Raymond Hettinger.
........
  r61041 | facundo.batista | 2008-02-24 04:17:21 +0100 (Sun, 24 Feb 2008) | 4 lines
  
  
  Issue 1742669. Now %d accepts very big float numbers.
  Thanks Gabriel Genellina.
........
  r61046 | neal.norwitz | 2008-02-24 08:21:56 +0100 (Sun, 24 Feb 2008) | 5 lines
  
  Get ctypes working on the Alpha (Tru64).  The problem was that there
  were two module_methods and the one used depended on the order the
  modules were loaded.  By making the test module_methods static,
  it is not exported and the correct version is picked up.
........
  r61048 | neal.norwitz | 2008-02-24 09:27:49 +0100 (Sun, 24 Feb 2008) | 1 line
  
  Fix typo of hexidecimal
........
  r61049 | christian.heimes | 2008-02-24 13:26:16 +0100 (Sun, 24 Feb 2008) | 1 line
  
  Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal.
........
  r61051 | mark.dickinson | 2008-02-24 19:12:36 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  Remove duplicate 'import re' in decimal.py
........
  r61052 | neal.norwitz | 2008-02-24 19:47:03 +0100 (Sun, 24 Feb 2008) | 11 lines
  
  Create a db_home directory with a unique name so multiple users can
  run the test simultaneously.  The simplest thing I found that worked
  on both Windows and Unix was to use the PID.  It's unique so should be
  sufficient.  This should prevent many of the spurious failures of
  the automated tests since they run as different users.
  
  Also cleanup the directory consistenly in the tearDown methods.
  
  It would be nice if someone ensured that the directories are always
  created with a consistent name.
........
  r61054 | eric.smith | 2008-02-24 22:41:49 +0100 (Sun, 24 Feb 2008) | 1 line
  
  Corrected assert to check for correct type in py3k.
........
  r61057 | christian.heimes | 2008-02-24 23:48:05 +0100 (Sun, 24 Feb 2008) | 2 lines
  
  Added dependency rules for Objects/stringlib/*.h
  stringobject, unicodeobject and the two formatters are rebuild whenever a header files changes
........
  r61058 | neal.norwitz | 2008-02-25 02:45:37 +0100 (Mon, 25 Feb 2008) | 1 line
  
  Fix indentation
........
  r61059 | brett.cannon | 2008-02-25 06:33:07 +0100 (Mon, 25 Feb 2008) | 2 lines
  
  Add minor markup for a string.
........
  r61060 | brett.cannon | 2008-02-25 06:33:33 +0100 (Mon, 25 Feb 2008) | 2 lines
  
  Fix a minor typo in a docstring.
........
  r61063 | andrew.kuchling | 2008-02-25 17:29:19 +0100 (Mon, 25 Feb 2008) | 1 line
  
  Move .setupterm() output so that we don't try to call endwin() if it fails
........
  r61064 | andrew.kuchling | 2008-02-25 17:29:58 +0100 (Mon, 25 Feb 2008) | 1 line
  
  Use file descriptor for real stdout
........
  r61065 | christian.heimes | 2008-02-25 18:32:07 +0100 (Mon, 25 Feb 2008) | 1 line
  
  Thomas Herve explained to me that PyCrypto depends on the constants. I'm adding the aliases because C code for Python 2.x should compile under 2.6 as well. The aliases aren't available in Python 3.x though.
........
  r61067 | facundo.batista | 2008-02-25 19:06:00 +0100 (Mon, 25 Feb 2008) | 4 lines
  
  
  Issue 2117.  Update compiler module to handle class decorators.
  Thanks Thomas Herve
........
  r61069 | georg.brandl | 2008-02-25 21:17:56 +0100 (Mon, 25 Feb 2008) | 2 lines
  
  Rename sphinx.addons to sphinx.ext.
........
  r61071 | georg.brandl | 2008-02-25 21:20:45 +0100 (Mon, 25 Feb 2008) | 2 lines
  
  Revert r61029.
........
  r61072 | facundo.batista | 2008-02-25 23:33:55 +0100 (Mon, 25 Feb 2008) | 4 lines
  
  
  Issue 2168. gdbm and dbm needs to be iterable; this fixes a 
  failure in the shelve module.  Thanks Thomas Herve.
........
  r61073 | raymond.hettinger | 2008-02-25 23:42:32 +0100 (Mon, 25 Feb 2008) | 1 line
  
  Make sure the itertools filter functions give the same performance for func=bool as func=None.
........
  r61074 | raymond.hettinger | 2008-02-26 00:17:41 +0100 (Tue, 26 Feb 2008) | 1 line
  
  Revert part of r60927 which made invalid assumptions about the API offered by db modules.
........
  r61075 | facundo.batista | 2008-02-26 00:46:02 +0100 (Tue, 26 Feb 2008) | 3 lines
  
  
  Coerced PyBool_Type to be able to compare it.
........
  r61076 | raymond.hettinger | 2008-02-26 03:46:54 +0100 (Tue, 26 Feb 2008) | 1 line
  
  Docs for itertools.combinations().  Implementation in forthcoming checkin.
........
  r61077 | neal.norwitz | 2008-02-26 05:50:37 +0100 (Tue, 26 Feb 2008) | 3 lines
  
  Don't use a hard coded port.  This test could hang/fail if the port is in use.
  Speed this test up by avoiding a sleep and using the event.
........
  r61078 | neal.norwitz | 2008-02-26 06:12:50 +0100 (Tue, 26 Feb 2008) | 1 line
  
  Whitespace normalization
........
  r61079 | neal.norwitz | 2008-02-26 06:23:51 +0100 (Tue, 26 Feb 2008) | 1 line
  
  Whitespace normalization
........
  r61080 | georg.brandl | 2008-02-26 07:40:10 +0100 (Tue, 26 Feb 2008) | 2 lines
  
  Banish tab.
........
  r61081 | neal.norwitz | 2008-02-26 09:04:59 +0100 (Tue, 26 Feb 2008) | 7 lines
  
  Speed up this test by about 99%.  Remove sleeps and replace with events.
  (This may fail on some slow platforms, but we can fix those cases which
  should be relatively isolated and easier to find now.)
  Move two test cases that didn't require a server to be started
  to a separate TestCase.  These tests were taking 3 seconds which
  is what the timeout was set to.
........
  r61082 | christian.heimes | 2008-02-26 09:18:11 +0100 (Tue, 26 Feb 2008) | 1 line
  
  The contains function raised a gcc warning. The new code is copied straight from py3k.
........
  r61084 | neal.norwitz | 2008-02-26 09:21:28 +0100 (Tue, 26 Feb 2008) | 3 lines
  
  Add a timing flag to Trace so you can see where slowness occurs
  like waiting for socket timeouts in test_smtplib :-).
........
  r61086 | christian.heimes | 2008-02-26 18:23:51 +0100 (Tue, 26 Feb 2008) | 3 lines
  
  Patch #1691070 from Roger Upole: Speed up PyArg_ParseTupleAndKeywords() and improve error msg
  My tests don't show the promised speed up of 10%. The code is as fast as the old code for simple cases and slightly faster for complex cases with several of args and kwargs. But the patch simplifies the code, too.
........
  r61087 | georg.brandl | 2008-02-26 20:13:45 +0100 (Tue, 26 Feb 2008) | 2 lines
  
  #2194: fix some typos.
........
  r61088 | raymond.hettinger | 2008-02-27 00:40:50 +0100 (Wed, 27 Feb 2008) | 1 line
  
  Add itertools.combinations().
........
  r61089 | raymond.hettinger | 2008-02-27 02:08:04 +0100 (Wed, 27 Feb 2008) | 1 line
  
  One too many decrefs.
........
  r61090 | raymond.hettinger | 2008-02-27 02:08:30 +0100 (Wed, 27 Feb 2008) | 1 line
  
  Larger test range
........
  r61091 | raymond.hettinger | 2008-02-27 02:44:34 +0100 (Wed, 27 Feb 2008) | 1 line
  
  Simply the sample code for combinations().
........
  r61098 | jeffrey.yasskin | 2008-02-28 05:45:36 +0100 (Thu, 28 Feb 2008) | 7 lines
  
  Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,
  which forbids constructing types that have it set. The effect is to speed
  
    ./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()'
  
  up from 2.5us to 0.201us. This fixes issue 1762.
........
  r61099 | jeffrey.yasskin | 2008-02-28 06:53:18 +0100 (Thu, 28 Feb 2008) | 3 lines
  
  Speed test_socketserver up from 28.739s to 0.226s, simplify the logic, and make
  sure all tests run even if some fail.
........
  r61100 | jeffrey.yasskin | 2008-02-28 07:09:19 +0100 (Thu, 28 Feb 2008) | 21 lines
  
  Thread.start() used sleep(0.000001) to make sure it didn't return before the
  new thread had started. At least on my MacBook Pro, that wound up sleeping for
  a full 10ms (probably 1 jiffy). By using an Event instead, we can be absolutely
  certain that the thread has started, and return more quickly (217us).
  
  Before:
  $  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
  100 loops, best of 3: 10.3 msec per loop
  $  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
  1000000 loops, best of 3: 0.47 usec per loop
  
  After:
  $  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
  1000 loops, best of 3: 217 usec per loop
  $  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
  1000000 loops, best of 3: 0.86 usec per loop
  
  To be fair, the 10ms isn't CPU time, and other threads including the spawned
  one get to run during it. There are also some slightly more complicated ways to
  get back the .4us in isAlive() if we want.
........
  r61101 | raymond.hettinger | 2008-02-28 10:23:48 +0100 (Thu, 28 Feb 2008) | 1 line
  
  Add repeat keyword argument to itertools.product().
........
  r61102 | christian.heimes | 2008-02-28 12:18:49 +0100 (Thu, 28 Feb 2008) | 1 line
  
  The empty tuple is usually a singleton with a much higher refcnt than 1
........
  r61105 | andrew.kuchling | 2008-02-28 15:03:03 +0100 (Thu, 28 Feb 2008) | 1 line
  
  #2169: make generated HTML more valid
........


Modified: python/branches/trunk-math/Demo/tkinter/guido/ShellWindow.py
==============================================================================
--- python/branches/trunk-math/Demo/tkinter/guido/ShellWindow.py	(original)
+++ python/branches/trunk-math/Demo/tkinter/guido/ShellWindow.py	Thu Feb 28 21:09:17 2008
@@ -121,11 +121,7 @@
             sys.stderr.write('popen2: bad write dup\n')
         if os.dup(c2pwrite) <> 2:
             sys.stderr.write('popen2: bad write dup\n')
-        for i in range(3, MAXFD):
-            try:
-                os.close(i)
-            except:
-                pass
+        os.closerange(3, MAXFD)
         try:
             os.execvp(prog, args)
         finally:

Modified: python/branches/trunk-math/Doc/Makefile
==============================================================================
--- python/branches/trunk-math/Doc/Makefile	(original)
+++ python/branches/trunk-math/Doc/Makefile	Thu Feb 28 21:09:17 2008
@@ -12,7 +12,7 @@
 ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
                 $(SPHINXOPTS) . build/$(BUILDER)
 
-.PHONY: help checkout update build html web htmlhelp clean
+.PHONY: help checkout update build html web htmlhelp clean coverage
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
@@ -22,6 +22,7 @@
 	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
 	@echo "  changes   to make an overview over all changed/added/deprecated items"
 	@echo "  linkcheck to check all external links for integrity"
+	@echo "  coverage  to check documentation coverage for library and C API"
 
 checkout:
 	@if [ ! -d tools/sphinx ]; then \
@@ -74,9 +75,13 @@
 
 linkcheck: BUILDER = linkcheck
 linkcheck: build
-	@echo "Link check complete; look for any errors in the above output "\
+	@echo "Link check complete; look for any errors in the above output " \
 	      "or in build/$(BUILDER)/output.txt"
 
+coverage: BUILDER = coverage
+coverage: build
+	@echo "Coverage finished; see c.txt and python.txt in build/coverage"
+
 clean:
 	-rm -rf build/*
 	-rm -rf tools/sphinx

Modified: python/branches/trunk-math/Doc/README.txt
==============================================================================
--- python/branches/trunk-math/Doc/README.txt	(original)
+++ python/branches/trunk-math/Doc/README.txt	Thu Feb 28 21:09:17 2008
@@ -59,6 +59,9 @@
    deprecated items in the current version. This is meant as a help for the
    writer of the "What's New" document.
 
+ * "coverage", which builds a coverage overview for standard library modules
+   and C API.
+
 A "make update" updates the Subversion checkouts in `tools/`.
 
 

Modified: python/branches/trunk-math/Doc/c-api/long.rst
==============================================================================
--- python/branches/trunk-math/Doc/c-api/long.rst	(original)
+++ python/branches/trunk-math/Doc/c-api/long.rst	Thu Feb 28 21:09:17 2008
@@ -174,6 +174,6 @@
    .. versionadded:: 1.5.2
 
    .. versionchanged:: 2.5
-      For values outside 0..LONG_MAX, both signed and unsigned integers are acccepted.
+      For values outside 0..LONG_MAX, both signed and unsigned integers are accepted.
 
 

Modified: python/branches/trunk-math/Doc/c-api/objbuffer.rst
==============================================================================
--- python/branches/trunk-math/Doc/c-api/objbuffer.rst	(original)
+++ python/branches/trunk-math/Doc/c-api/objbuffer.rst	Thu Feb 28 21:09:17 2008
@@ -8,7 +8,7 @@
 
 .. cfunction:: int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len)
 
-   Returns a pointer to a read-only memory location useable as character- based
+   Returns a pointer to a read-only memory location usable as character-based
    input.  The *obj* argument must support the single-segment character buffer
    interface.  On success, returns ``0``, sets *buffer* to the memory location and
    *buffer_len* to the buffer length.  Returns ``-1`` and sets a :exc:`TypeError`

Modified: python/branches/trunk-math/Doc/c-api/tuple.rst
==============================================================================
--- python/branches/trunk-math/Doc/c-api/tuple.rst	(original)
+++ python/branches/trunk-math/Doc/c-api/tuple.rst	Thu Feb 28 21:09:17 2008
@@ -117,7 +117,7 @@
       Removed unused third parameter, *last_is_sticky*.
 
 
-.. cfunction:: int PyMethod_ClearFreeList(void)
+.. cfunction:: int PyTuple_ClearFreeList(void)
 
    Clear the free list. Return the total number of freed items.
 

Modified: python/branches/trunk-math/Doc/c-api/typeobj.rst
==============================================================================
--- python/branches/trunk-math/Doc/c-api/typeobj.rst	(original)
+++ python/branches/trunk-math/Doc/c-api/typeobj.rst	Thu Feb 28 21:09:17 2008
@@ -573,7 +573,7 @@
    The :attr:`tp_traverse` pointer is used by the garbage collector to detect
    reference cycles. A typical implementation of a :attr:`tp_traverse` function
    simply calls :cfunc:`Py_VISIT` on each of the instance's members that are Python
-   objects.  For exampe, this is function :cfunc:`local_traverse` from the
+   objects.  For example, this is function :cfunc:`local_traverse` from the
    :mod:`thread` extension module::
 
       static int
@@ -1160,7 +1160,7 @@
             binaryfunc nb_and;
             binaryfunc nb_xor;
             binaryfunc nb_or;
-            coercion nb_coerce;       /* Used by the coerce() funtion */
+            coercion nb_coerce;       /* Used by the coerce() function */
             unaryfunc nb_int;
             unaryfunc nb_long;
             unaryfunc nb_float;

Modified: python/branches/trunk-math/Doc/conf.py
==============================================================================
--- python/branches/trunk-math/Doc/conf.py	(original)
+++ python/branches/trunk-math/Doc/conf.py	Thu Feb 28 21:09:17 2008
@@ -13,7 +13,7 @@
 # General configuration
 # ---------------------
 
-extensions = ['sphinx.addons.refcounting']
+extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage']
 
 # General substitutions.
 project = 'Python'
@@ -139,3 +139,39 @@
 
 # Documents to append as an appendix to all manuals.
 latex_appendices = ['glossary', 'about', 'license', 'copyright']
+
+# Options for the coverage checker
+# --------------------------------
+
+# The coverage checker will ignore all modules/functions/classes whose names
+# match any of the following regexes (using re.match).
+coverage_ignore_modules = [
+    r'[T|t][k|K]',
+    r'Tix',
+    r'distutils.*',
+]
+
+coverage_ignore_functions = [
+    'test($|_)',
+]
+
+coverage_ignore_classes = [
+]
+
+# Glob patterns for C source files for C API coverage, relative to this directory.
+coverage_c_path = [
+    '../Include/*.h',
+]
+
+# Regexes to find C items in the source files.
+coverage_c_regexes = {
+    'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
+    'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
+    'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
+}
+
+# The coverage checker will ignore all C items whose names match these regexes
+# (using re.match) -- the keys must be the same as in coverage_c_regexes.
+coverage_ignore_c_items = {
+#    'cfunction': [...]
+}

Modified: python/branches/trunk-math/Doc/distutils/builtdist.rst
==============================================================================
--- python/branches/trunk-math/Doc/distutils/builtdist.rst	(original)
+++ python/branches/trunk-math/Doc/distutils/builtdist.rst	Thu Feb 28 21:09:17 2008
@@ -195,7 +195,7 @@
 |                                          | or  --- & :option:`maintainer` and           |
 |                                          | :option:`maintainer_email`                   |
 +------------------------------------------+----------------------------------------------+
-| Copyright                                | :option:`licence`                            |
+| Copyright                                | :option:`license`                            |
 +------------------------------------------+----------------------------------------------+
 | Url                                      | :option:`url`                                |
 +------------------------------------------+----------------------------------------------+

Modified: python/branches/trunk-math/Doc/distutils/packageindex.rst
==============================================================================
--- python/branches/trunk-math/Doc/distutils/packageindex.rst	(original)
+++ python/branches/trunk-math/Doc/distutils/packageindex.rst	Thu Feb 28 21:09:17 2008
@@ -53,13 +53,13 @@
 The .pypirc file
 ================
 
-The format of the :file:`.pypirc` file is formated as follows::
+The format of the :file:`.pypirc` file is as follows::
 
    [server-login]
    repository: <repository-url>
    username: <username>
    password: <password>
 
-*repository* can be ommitted and defaults to ``http://www.python.org/pypi``.
+*repository* can be omitted and defaults to ``http://www.python.org/pypi``.
 
 

Modified: python/branches/trunk-math/Doc/distutils/setupscript.rst
==============================================================================
--- python/branches/trunk-math/Doc/distutils/setupscript.rst	(original)
+++ python/branches/trunk-math/Doc/distutils/setupscript.rst	Thu Feb 28 21:09:17 2008
@@ -185,7 +185,7 @@
 same base package), use the :option:`ext_package` keyword argument to
 :func:`setup`.  For example, ::
 
-   setup(...
+   setup(...,
          ext_package='pkg',
          ext_modules=[Extension('foo', ['foo.c']),
                       Extension('subpkg.bar', ['bar.c'])],
@@ -214,7 +214,7 @@
 This warning notwithstanding, options to SWIG can be currently passed like
 this::
 
-   setup(...
+   setup(...,
          ext_modules=[Extension('_foo', ['foo.i'], 
                                 swig_opts=['-modern', '-I../include'])],
          py_modules=['foo'],
@@ -443,7 +443,7 @@
 The :option:`scripts` option simply is a list of files to be handled in this
 way.  From the PyXML setup script::
 
-   setup(... 
+   setup(...,
          scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val']
          )
 
@@ -501,7 +501,7 @@
 :option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the
 following way::
 
-   setup(...
+   setup(...,
          data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
                      ('config', ['cfg/data.cfg']),
                      ('/etc/init.d', ['init-script'])]
@@ -613,7 +613,7 @@
 
 :option:`classifiers` are specified in a python list::
 
-   setup(...
+   setup(...,
          classifiers=[
              'Development Status :: 4 - Beta',
              'Environment :: Console',

Modified: python/branches/trunk-math/Doc/howto/advocacy.rst
==============================================================================
--- python/branches/trunk-math/Doc/howto/advocacy.rst	(original)
+++ python/branches/trunk-math/Doc/howto/advocacy.rst	Thu Feb 28 21:09:17 2008
@@ -160,7 +160,7 @@
    don't merge cleanly into the overall design scheme (thus, some fans of Classic C
    maintain that ANSI C is no longer compact).
 
-   (From http://www.catb.org/ esr/jargon/html/C/compact.html)
+   (From http://www.catb.org/~esr/jargon/html/C/compact.html)
 
 In this sense of the word, Python is quite compact, because the language has
 just a few ideas, which are used in lots of places.  Take namespaces, for
@@ -174,14 +174,14 @@
 This simplicity arises from Python's development history.  The language syntax
 derives from different sources; ABC, a relatively obscure teaching language, is
 one primary influence, and Modula-3 is another.  (For more information about ABC
-and Modula-3, consult their respective Web sites at http://www.cwi.nl/
-steven/abc/ and http://www.m3.org.)  Other features have come from C, Icon,
+and Modula-3, consult their respective Web sites at http://www.cwi.nl/~steven/abc/
+and http://www.m3.org.)  Other features have come from C, Icon,
 Algol-68, and even Perl.  Python hasn't really innovated very much, but instead
 has tried to keep the language small and easy to learn, building on ideas that
 have been tried in other languages and found useful.
 
 Simplicity is a virtue that should not be underestimated.  It lets you learn the
-language more quickly, and then rapidly write code, code that often works the
+language more quickly, and then rapidly write code -- code that often works the
 first time you run it.
 
 
@@ -266,7 +266,7 @@
 
 They're practically nonexistent.  Consult the :file:`Misc/COPYRIGHT` file in the
 source distribution, or the section :ref:`history-and-license` for the full
-language, but it boils down to three conditions.
+language, but it boils down to three conditions:
 
 * You have to leave the copyright notice on the software; if you don't include
   the source code in a product, you have to put the copyright notice in the
@@ -276,7 +276,7 @@
   product in any way.
 
 * If something goes wrong, you can't sue for damages.  Practically all software
-  licences contain this condition.
+  licenses contain this condition.
 
 Notice that you don't have to provide source code for anything that contains
 Python or is built with it.  Also, the Python interpreter and accompanying

Modified: python/branches/trunk-math/Doc/howto/doanddont.rst
==============================================================================
--- python/branches/trunk-math/Doc/howto/doanddont.rst	(original)
+++ python/branches/trunk-math/Doc/howto/doanddont.rst	Thu Feb 28 21:09:17 2008
@@ -114,7 +114,7 @@
 This is a "don't" which is much weaker then the previous "don't"s but is still
 something you should not do if you don't have good reasons to do that. The
 reason it is usually bad idea is because you suddenly have an object which lives
-in two seperate namespaces. When the binding in one namespace changes, the
+in two separate namespaces. When the binding in one namespace changes, the
 binding in the other will not, so there will be a discrepancy between them. This
 happens when, for example, one module is reloaded, or changes the definition of
 a function at runtime.

Modified: python/branches/trunk-math/Doc/howto/functional.rst
==============================================================================
--- python/branches/trunk-math/Doc/howto/functional.rst	(original)
+++ python/branches/trunk-math/Doc/howto/functional.rst	Thu Feb 28 21:09:17 2008
@@ -905,7 +905,7 @@
     itertools.izip(['a', 'b', 'c'], (1, 2, 3)) =>
       ('a', 1), ('b', 2), ('c', 3)
 
-It's similiar to the built-in :func:`zip` function, but doesn't construct an
+It's similar to the built-in :func:`zip` function, but doesn't construct an
 in-memory list and exhaust all the input iterators before returning; instead
 tuples are constructed and returned only if they're requested.  (The technical
 term for this behaviour is `lazy evaluation

Modified: python/branches/trunk-math/Doc/howto/regex.rst
==============================================================================
--- python/branches/trunk-math/Doc/howto/regex.rst	(original)
+++ python/branches/trunk-math/Doc/howto/regex.rst	Thu Feb 28 21:09:17 2008
@@ -203,7 +203,7 @@
 |      |           | ``bc``.                         |
 +------+-----------+---------------------------------+
 | 6    | ``abcb``  | Try ``b`` again.  This time     |
-|      |           | but the character at the        |
+|      |           | the character at the            |
 |      |           | current position is ``'b'``, so |
 |      |           | it succeeds.                    |
 +------+-----------+---------------------------------+

Modified: python/branches/trunk-math/Doc/howto/sockets.rst
==============================================================================
--- python/branches/trunk-math/Doc/howto/sockets.rst	(original)
+++ python/branches/trunk-math/Doc/howto/sockets.rst	Thu Feb 28 21:09:17 2008
@@ -357,7 +357,7 @@
 reason to do otherwise.
 
 In return, you will get three lists. They have the sockets that are actually
-readable, writable and in error. Each of these lists is a subset (possbily
+readable, writable and in error. Each of these lists is a subset (possibly
 empty) of the corresponding list you passed in. And if you put a socket in more
 than one input list, it will only be (at most) in one output list.
 
@@ -371,7 +371,7 @@
 If you have a "server" socket, put it in the potential_readers list. If it comes
 out in the readable list, your ``accept`` will (almost certainly) work. If you
 have created a new socket to ``connect`` to someone else, put it in the
-ptoential_writers list. If it shows up in the writable list, you have a decent
+potential_writers list. If it shows up in the writable list, you have a decent
 chance that it has connected.
 
 One very nasty problem with ``select``: if somewhere in those input lists of

Modified: python/branches/trunk-math/Doc/library/basehttpserver.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/basehttpserver.rst	(original)
+++ python/branches/trunk-math/Doc/library/basehttpserver.rst	Thu Feb 28 21:09:17 2008
@@ -122,6 +122,15 @@
    class variable.
 
 
+.. attribute:: BaseHTTPRequestHandler.error_content_type
+
+   Specifies the Content-Type HTTP header of error responses sent to the client.
+   The default value is ``'text/html'``.
+
+   .. versionadded:: 2.6
+      Previously, the content type was always ``'text/html'``.
+
+
 .. attribute:: BaseHTTPRequestHandler.protocol_version
 
    This specifies the HTTP protocol version used in responses.  If set to

Modified: python/branches/trunk-math/Doc/library/codecs.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/codecs.rst	(original)
+++ python/branches/trunk-math/Doc/library/codecs.rst	Thu Feb 28 21:09:17 2008
@@ -206,7 +206,8 @@
 .. function:: open(filename, mode[, encoding[, errors[, buffering]]])
 
    Open an encoded file using the given *mode* and return a wrapped version
-   providing transparent encoding/decoding.
+   providing transparent encoding/decoding.  The default file mode is ``'r'``
+   meaning to open the file in read mode.
 
    .. note::
 
@@ -214,6 +215,13 @@
       i.e. Unicode objects for most built-in codecs.  Output is also codec-dependent
       and will usually be Unicode as well.
 
+   .. note::
+
+      Files are always opened in binary mode, even if no binary mode was
+      specified.  This is done to avoid data loss due to encodings using 8-bit
+      values.  This means that no automatic conversion of ``'\n'`` is done
+      on reading and writing.
+
    *encoding* specifies the encoding which is to be used for the file.
 
    *errors* may be given to define the error handling. It defaults to ``'strict'``
@@ -993,7 +1001,7 @@
 +-----------------+--------------------------------+--------------------------------+
 | iso8859_3       | iso-8859-3, latin3, L3         | Esperanto, Maltese             |
 +-----------------+--------------------------------+--------------------------------+
-| iso8859_4       | iso-8859-4, latin4, L4         | Baltic languagues              |
+| iso8859_4       | iso-8859-4, latin4, L4         | Baltic languages               |
 +-----------------+--------------------------------+--------------------------------+
 | iso8859_5       | iso-8859-5, cyrillic           | Bulgarian, Byelorussian,       |
 |                 |                                | Macedonian, Russian, Serbian   |

Modified: python/branches/trunk-math/Doc/library/collections.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/collections.rst	(original)
+++ python/branches/trunk-math/Doc/library/collections.rst	Thu Feb 28 21:09:17 2008
@@ -470,7 +470,7 @@
 .. function:: namedtuple(typename, fieldnames, [verbose])
 
    Returns a new tuple subclass named *typename*.  The new subclass is used to
-   create tuple-like objects that have fields accessable by attribute lookup as
+   create tuple-like objects that have fields accessible by attribute lookup as
    well as being indexable and iterable.  Instances of the subclass also have a
    helpful docstring (with typename and fieldnames) and a helpful :meth:`__repr__`
    method which lists the tuple contents in a ``name=value`` format.
@@ -536,7 +536,7 @@
    >>> x, y = p                # unpack like a regular tuple
    >>> x, y
    (11, 22)
-   >>> p.x + p.y               # fields also accessable by name
+   >>> p.x + p.y               # fields also accessible by name
    33
    >>> p                       # readable __repr__ with a name=value style
    Point(x=11, y=22)

Modified: python/branches/trunk-math/Doc/library/configparser.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/configparser.rst	(original)
+++ python/branches/trunk-math/Doc/library/configparser.rst	Thu Feb 28 21:09:17 2008
@@ -187,8 +187,9 @@
 .. method:: RawConfigParser.add_section(section)
 
    Add a section named *section* to the instance.  If a section by the given name
-   already exists, :exc:`DuplicateSectionError` is raised.
-
+   already exists, :exc:`DuplicateSectionError` is raised. If the name
+   ``DEFAULT`` (or any of it's case-insensitive variants) is passed,
+   :exc:`ValueError` is raised.
 
 .. method:: RawConfigParser.has_section(section)
 

Modified: python/branches/trunk-math/Doc/library/decimal.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/decimal.rst	(original)
+++ python/branches/trunk-math/Doc/library/decimal.rst	Thu Feb 28 21:09:17 2008
@@ -1609,7 +1609,7 @@
 original's two-place significance.
 
 If an application does not care about tracking significance, it is easy to
-remove the exponent and trailing zeroes, losing signficance, but keeping the
+remove the exponent and trailing zeroes, losing significance, but keeping the
 value unchanged::
 
     >>> def remove_exponent(d):

Modified: python/branches/trunk-math/Doc/library/difflib.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/difflib.rst	(original)
+++ python/branches/trunk-math/Doc/library/difflib.rst	Thu Feb 28 21:09:17 2008
@@ -148,7 +148,27 @@
    expressed in the format returned by :func:`time.ctime`.  If not specified, the
    strings default to blanks.
 
-   :file:`Tools/scripts/diff.py` is a command-line front-end for this function.
+   ::
+
+      >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
+      >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
+      >>> for line in context_diff(s1, s2, fromfile='before.py', tofile='after.py'):
+      ...     sys.stdout.write(line)
+      *** before.py
+      --- after.py
+      ***************
+      *** 1,4 ****
+      ! bacon
+      ! eggs
+      ! ham
+        guido
+      --- 1,4 ----
+      ! python
+      ! eggy
+      ! hamster
+        guido
+
+   See :ref:`difflib-interface` for a more detailed example.
 
    .. versionadded:: 2.3
 
@@ -265,7 +285,25 @@
    expressed in the format returned by :func:`time.ctime`.  If not specified, the
    strings default to blanks.
 
-   :file:`Tools/scripts/diff.py` is a command-line front-end for this function.
+   ::
+
+
+      >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
+      >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
+      >>> for line in unified_diff(s1, s2, fromfile='before.py', tofile='after.py'):
+      ...     sys.stdout.write(line)
+      --- before.py
+      +++ after.py
+      @@ -1,4 +1,4 @@
+      -bacon
+      -eggs
+      -ham
+      +python
+      +eggy
+      +hamster
+       guido
+
+   See :ref:`difflib-interface` for a more detailed example.
 
    .. versionadded:: 2.3
 
@@ -649,3 +687,75 @@
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.
 
+
+.. _difflib-interface:
+
+A command-line interface to difflib
+-----------------------------------
+
+This example shows how to use difflib to create a ``diff``-like utility.
+It is also contained in the Python source distribution, as
+:file:`Tools/scripts/diff.py`.
+
+::
+
+   """ Command line interface to difflib.py providing diffs in four formats:
+
+   * ndiff:    lists every line and highlights interline changes.
+   * context:  highlights clusters of changes in a before/after format.
+   * unified:  highlights clusters of changes in an inline format.
+   * html:     generates side by side comparison with change highlights.
+
+   """
+
+   import sys, os, time, difflib, optparse
+
+   def main():
+        # Configure the option parser
+       usage = "usage: %prog [options] fromfile tofile"
+       parser = optparse.OptionParser(usage)
+       parser.add_option("-c", action="store_true", default=False,
+                         help='Produce a context format diff (default)')
+       parser.add_option("-u", action="store_true", default=False,
+                         help='Produce a unified format diff')
+       hlp = 'Produce HTML side by side diff (can use -c and -l in conjunction)'
+       parser.add_option("-m", action="store_true", default=False, help=hlp)
+       parser.add_option("-n", action="store_true", default=False,
+                         help='Produce a ndiff format diff')
+       parser.add_option("-l", "--lines", type="int", default=3,
+                         help='Set number of context lines (default 3)')
+       (options, args) = parser.parse_args()
+
+       if len(args) == 0:
+           parser.print_help()
+           sys.exit(1)
+       if len(args) != 2:
+           parser.error("need to specify both a fromfile and tofile")
+
+       n = options.lines
+       fromfile, tofile = args # as specified in the usage string
+
+       # we're passing these as arguments to the diff function
+       fromdate = time.ctime(os.stat(fromfile).st_mtime)
+       todate = time.ctime(os.stat(tofile).st_mtime)
+       fromlines = open(fromfile, 'U').readlines()
+       tolines = open(tofile, 'U').readlines()
+
+       if options.u:
+           diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile,
+                                       fromdate, todate, n=n)
+       elif options.n:
+           diff = difflib.ndiff(fromlines, tolines)
+       elif options.m:
+           diff = difflib.HtmlDiff().make_file(fromlines, tolines, fromfile,
+                                               tofile, context=options.c,
+                                               numlines=n)
+       else:
+           diff = difflib.context_diff(fromlines, tolines, fromfile, tofile,
+                                       fromdate, todate, n=n)
+
+       # we're using writelines because diff is a generator
+       sys.stdout.writelines(diff)
+
+   if __name__ == '__main__':
+       main()

Modified: python/branches/trunk-math/Doc/library/dis.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/dis.rst	(original)
+++ python/branches/trunk-math/Doc/library/dis.rst	Thu Feb 28 21:09:17 2008
@@ -544,7 +544,7 @@
 .. opcode:: STORE_NAME (namei)
 
    Implements ``name = TOS``. *namei* is the index of *name* in the attribute
-   :attr:`co_names` of the code object. The compiler tries to use ``STORE_LOCAL``
+   :attr:`co_names` of the code object. The compiler tries to use ``STORE_FAST``
    or ``STORE_GLOBAL`` if possible.
 
 

Modified: python/branches/trunk-math/Doc/library/inspect.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/inspect.rst	(original)
+++ python/branches/trunk-math/Doc/library/inspect.rst	Thu Feb 28 21:09:17 2008
@@ -28,7 +28,7 @@
 -----------------
 
 The :func:`getmembers` function retrieves the members of an object such as a
-class or module. The eleven functions whose names begin with "is" are mainly
+class or module. The fifteen functions whose names begin with "is" are mainly
 provided as convenient choices for the second argument to :func:`getmembers`.
 They also help you determine when you can expect to find the following special
 attributes:
@@ -81,6 +81,35 @@
 +-----------+-----------------+---------------------------+-------+
 |           | func_name       | (same as __name__)        |       |
 +-----------+-----------------+---------------------------+-------+
+| generator | __iter__        | defined to support        |       |
+|           |                 | iteration over container  |       |
++-----------+-----------------+---------------------------+-------+
+|           | close           | raises new GeneratorExit  |       |
+|           |                 | exception inside the      |       |
+|           |                 | generator to terminate    |       |
+|           |                 | the iteration             |       |
++-----------+-----------------+---------------------------+-------+
+|           | gi_code         | code object               |       |
++-----------+-----------------+---------------------------+-------+
+|           | gi_frame        | frame object or possibly  |       |
+|           |                 | None once the generator   |       |
+|           |                 | has been exhausted        |       |
++-----------+-----------------+---------------------------+-------+
+|           | gi_running      | set to 1 when generator   |       |
+|           |                 | is executing, 0 otherwise |       |
++-----------+-----------------+---------------------------+-------+
+|           | next            | return the next item from |       |
+|           |                 | the container             |       |
++-----------+-----------------+---------------------------+-------+
+|           | send            | resumes the generator and |       |
+|           |                 | "sends" a value that      |       |
+|           |                 | becomes the result of the |       |
+|           |                 | current yield-expression  |       |
++-----------+-----------------+---------------------------+-------+
+|           | throw           | used to raise an          |       |
+|           |                 | exception inside the      |       |
+|           |                 | generator                 |       |
++-----------+-----------------+---------------------------+-------+
 | traceback | tb_frame        | frame object at this      |       |
 |           |                 | level                     |       |
 +-----------+-----------------+---------------------------+-------+
@@ -246,6 +275,13 @@
 
    Return true if the object is a Python function or unnamed (:term:`lambda`) function.
 
+.. function:: isgeneratorfunction(object)
+
+   Return true if the object is a Python generator function.
+
+.. function:: isgenerator(object)
+
+   Return true if the object is a generator.
 
 .. function:: istraceback(object)
 

Modified: python/branches/trunk-math/Doc/library/itertools.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/itertools.rst	(original)
+++ python/branches/trunk-math/Doc/library/itertools.rst	Thu Feb 28 21:09:17 2008
@@ -76,6 +76,44 @@
                   yield element
 
 
+.. function:: combinations(iterable, r)
+
+   Return successive *r* length combinations of elements in the *iterable*.
+
+   Combinations are emitted in a lexicographic sort order.  So, if the 
+   input *iterable* is sorted, the combination tuples will be produced
+   in sorted order.  
+
+   Elements are treated as unique based on their position, not on their
+   value.  So if the input elements are unique, there will be no repeat
+   values within a single combination.
+
+   Each result tuple is ordered to match the input order.  So, every
+   combination is a subsequence of the input *iterable*.
+
+   Example:  ``combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)``
+
+   Equivalent to::
+
+        def combinations(iterable, r):
+            pool = tuple(iterable)
+            n = len(pool)
+            assert 0 <= r <= n
+            vec = range(r)
+            yield tuple(pool[i] for i in vec)
+            while 1:
+                for i in reversed(range(r)):
+                    if vec[i] != i + n - r:
+                        break
+                else:
+                    return
+                vec[i] += 1
+                for j in range(i+1, r):
+                    vec[j] = vec[j-1] + 1
+                yield tuple(pool[i] for i in vec)
+
+   .. versionadded:: 2.6
+
 .. function:: count([n])
 
    Make an iterator that returns consecutive integers starting with *n*. If not
@@ -302,6 +340,36 @@
 
    .. versionadded:: 2.6
 
+.. function:: product(*iterables[, repeat])
+
+   Cartesian product of input iterables.
+
+   Equivalent to nested for-loops in a generator expression. For example,
+   ``product(A, B)`` returns the same as ``((x,y) for x in A for y in B)``.
+
+   The leftmost iterators are in the outermost for-loop, so the output tuples
+   cycle in a manner similar to an odometer (with the rightmost element
+   changing on every iteration).  This results in a lexicographic ordering
+   so that if the inputs iterables are sorted, the product tuples are emitted
+   in sorted order.
+
+   To compute the product of an iterable with itself, specify the number of
+   repetitions with the optional *repeat* keyword argument.  For example,
+   ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``.
+
+   Equivalent to the following except that the actual implementation does not
+   build-up intermediate results in memory::
+
+       def product(*args, **kwds):
+           pools = map(tuple, args) * kwds.get('repeat', 1)
+           if pools:            
+               result = [[]]
+               for pool in pools:
+                   result = [x+[y] for x in result for y in pool]
+               for prod in result:
+                   yield tuple(prod)
+
+   .. versionadded:: 2.6
 
 .. function:: repeat(object[, times])
 
@@ -536,3 +604,9 @@
                pending -= 1
                nexts = cycle(islice(nexts, pending))
 
+   def powerset(iterable):
+       "powerset('ab') --> set([]), set(['b']), set(['a']), set(['a', 'b'])"
+       skip = object()
+       for t in product(*izip(repeat(skip), iterable)):
+           yield set(e for e in t if e is not skip)
+

Modified: python/branches/trunk-math/Doc/library/logging.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/logging.rst	(original)
+++ python/branches/trunk-math/Doc/library/logging.rst	Thu Feb 28 21:09:17 2008
@@ -43,7 +43,7 @@
 It is, of course, possible to log messages with different verbosity levels or to
 different destinations.  Support for writing log messages to files, HTTP
 GET/POST locations, email via SMTP, generic sockets, or OS-specific logging
-mechnisms are all supported by the standard module.  You can also create your
+mechanisms are all supported by the standard module.  You can also create your
 own log destination class if you have special requirements not met by any of the
 built-in classes.
 
@@ -245,8 +245,8 @@
   little more verbose for logging messages than using the log level convenience
   methods listed above, but this is how to log at custom log levels.
 
-:func:`getLogger` returns a reference to a logger instance with a name of name
-if a name is provided, or root if not.  The names are period-separated
+:func:`getLogger` returns a reference to a logger instance with the specified
+if it it is provided, or ``root`` if not.  The names are period-separated
 hierarchical structures.  Multiple calls to :func:`getLogger` with the same name
 will return a reference to the same logger object.  Loggers that are further
 down in the hierarchical list are children of loggers higher up in the list.
@@ -267,7 +267,7 @@
 with an :func:`addHandler` method.  As an example scenario, an application may
 want to send all log messages to a log file, all log messages of error or higher
 to stdout, and all messages of critical to an email address.  This scenario
-requires three individual handlers where each hander is responsible for sending
+requires three individual handlers where each handler is responsible for sending
 messages of a specific severity to a specific location.
 
 The standard library includes quite a few handler types; this tutorial uses only
@@ -298,7 +298,7 @@
 ^^^^^^^^^^
 
 Formatter objects configure the final order, structure, and contents of the log
-message.  Unlike the base logging.Handler class, application code may
+message.  Unlike the base :class:`logging.Handler` class, application code may
 instantiate formatter classes, although you could likely subclass the formatter
 if your application needs special behavior.  The constructor takes two optional
 arguments: a message format string and a date format string.  If there is no

Modified: python/branches/trunk-math/Doc/library/mailbox.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/mailbox.rst	(original)
+++ python/branches/trunk-math/Doc/library/mailbox.rst	Thu Feb 28 21:09:17 2008
@@ -433,7 +433,7 @@
 original format, which is sometimes referred to as :dfn:`mboxo`. This means that
 the :mailheader:`Content-Length` header, if present, is ignored and that any
 occurrences of "From " at the beginning of a line in a message body are
-transformed to ">From " when storing the message, although occurences of ">From
+transformed to ">From " when storing the message, although occurrences of ">From
 " are not transformed to "From " when reading the message.
 
 Some :class:`Mailbox` methods implemented by :class:`mbox` deserve special
@@ -581,7 +581,7 @@
 
 .. method:: MH.close()
 
-   :class:`MH` instances do not keep any open files, so this method is equivelant
+   :class:`MH` instances do not keep any open files, so this method is equivalent
    to :meth:`unlock`.
 
 

Modified: python/branches/trunk-math/Doc/library/modulefinder.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/modulefinder.rst	(original)
+++ python/branches/trunk-math/Doc/library/modulefinder.rst	Thu Feb 28 21:09:17 2008
@@ -50,3 +50,65 @@
 
    Analyze the contents of the *pathname* file, which must contain  Python code.
 
+.. attribute:: ModuleFinder.modules
+
+   A dictionary mapping module names to modules. See :ref:`modulefinder-example`
+
+
+.. _modulefinder-example:
+
+Example usage of :class:`ModuleFinder`
+--------------------------------------
+
+The script that is going to get analyzed later on (bacon.py)::
+
+   import re, itertools
+
+   try:
+       import baconhameggs
+   except ImportError:
+       pass
+
+   try:
+       import guido.python.ham
+   except ImportError:
+       pass
+
+
+The script that will output the report of bacon.py::
+
+   from modulefinder import ModuleFinder
+
+   finder = ModuleFinder()
+   finder.run_script('bacon.py')
+
+   print 'Loaded modules:'
+   for name, mod in finder.modules.iteritems():
+       print '%s: ' % name,
+       print ','.join(mod.globalnames.keys()[:3])
+
+   print '-'*50
+   print 'Modules not imported:'
+   print '\n'.join(finder.badmodules.iterkeys())
+
+Sample output (may vary depending on the architecture)::
+
+    Loaded modules:
+    _types:
+    copy_reg:  _inverted_registry,_slotnames,__all__
+    sre_compile:  isstring,_sre,_optimize_unicode
+    _sre:
+    sre_constants:  REPEAT_ONE,makedict,AT_END_LINE
+    sys:
+    re:  __module__,finditer,_expand
+    itertools:
+    __main__:  re,itertools,baconhameggs
+    sre_parse:  __getslice__,_PATTERNENDERS,SRE_FLAG_UNICODE
+    array:
+    types:  __module__,IntType,TypeType
+    ---------------------------------------------------
+    Modules not imported:
+    guido.python.ham
+    baconhameggs
+
+

Modified: python/branches/trunk-math/Doc/library/msilib.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/msilib.rst	(original)
+++ python/branches/trunk-math/Doc/library/msilib.rst	Thu Feb 28 21:09:17 2008
@@ -67,7 +67,7 @@
 
 .. function:: init_database(name, schema, ProductName, ProductCode, ProductVersion, Manufacturer)
 
-   Create and return a new database *name*, initialize it  with *schema*,  and set
+   Create and return a new database *name*, initialize it with *schema*, and set
    the properties *ProductName*, *ProductCode*, *ProductVersion*, and
    *Manufacturer*.
 
@@ -79,11 +79,17 @@
    function returns.
 
 
-.. function:: add_data(database, records)
+.. function:: add_data(database, table, records)
 
-   Add all *records* to *database*.  *records* should be a list of tuples, each one
-   containing all fields of a record according to the schema of the table.  For
-   optional fields, ``None`` can be passed.
+   Add all *records* to the table named *table* in *database*.
+
+   The *table* argument must be one of the predefined tables in the MSI schema,
+   e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, ``'Control'``,
+   etc.
+
+   *records* should be a list of tuples, each one containing all fields of a
+   record according to the schema of the table.  For optional fields,
+   ``None`` can be passed.
 
    Field values can be int or long numbers, strings, or instances of the Binary
    class.

Modified: python/branches/trunk-math/Doc/library/operator.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/operator.rst	(original)
+++ python/branches/trunk-math/Doc/library/operator.rst	Thu Feb 28 21:09:17 2008
@@ -499,15 +499,21 @@
 
    Return a callable object that fetches *attr* from its operand. If more than one
    attribute is requested, returns a tuple of attributes. After,
-   ``f=attrgetter('name')``, the call ``f(b)`` returns ``b.name``.  After,
-   ``f=attrgetter('name', 'date')``, the call ``f(b)`` returns ``(b.name,
+   ``f = attrgetter('name')``, the call ``f(b)`` returns ``b.name``.  After,
+   ``f = attrgetter('name', 'date')``, the call ``f(b)`` returns ``(b.name,
    b.date)``.
 
+   The attribute names can also contain dots; after ``f = attrgetter('date.month')``,
+   the call ``f(b)`` returns ``b.date.month``.
+
    .. versionadded:: 2.4
 
    .. versionchanged:: 2.5
       Added support for multiple attributes.
 
+   .. versionchanged:: 2.6
+      Added support for dotted attributes.
+
 
 .. function:: itemgetter(item[, args...])
 
@@ -532,6 +538,17 @@
    [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
 
 
+.. function:: methodcaller(name[, args...])
+
+   Return a callable object that calls the method *name* on its operand.  If
+   additional arguments and/or keyword arguments are given, they will be given
+   to the method as well.  After ``f = methodcaller('name')``, the call ``f(b)``
+   returns ``b.name()``.  After ``f = methodcaller('name', 'foo', bar=1)``, the
+   call ``f(b)`` returns ``b.name('foo', bar=1)``.
+
+   .. versionadded:: 2.6
+
+
 .. _operator-map:
 
 Mapping Operators to Functions

Modified: python/branches/trunk-math/Doc/library/optparse.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/optparse.rst	(original)
+++ python/branches/trunk-math/Doc/library/optparse.rst	Thu Feb 28 21:09:17 2008
@@ -1633,7 +1633,7 @@
                value.append(arg)
                del rargs[0]
 
-        setattr(parser.values, option.dest, value)
+       setattr(parser.values, option.dest, value)
 
    [...]
    parser.add_option("-c", "--callback",

Modified: python/branches/trunk-math/Doc/library/pickle.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/pickle.rst	(original)
+++ python/branches/trunk-math/Doc/library/pickle.rst	Thu Feb 28 21:09:17 2008
@@ -463,6 +463,11 @@
 Pickling and unpickling extension types
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+.. index::
+   single: __reduce__() (pickle protocol)
+   single: __reduce_ex__() (pickle protocol)
+   single: __safe_for_unpickling__ (pickle protocol)
+
 When the :class:`Pickler` encounters an object of a type it knows nothing about
 --- such as an extension type --- it looks in two places for a hint of how to
 pickle it.  One alternative is for the object to implement a :meth:`__reduce__`
@@ -541,6 +546,10 @@
 Pickling and unpickling external objects
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+.. index::
+   single: persistent_id (pickle protocol)
+   single: persistent_load (pickle protocol)
+
 For the benefit of object persistence, the :mod:`pickle` module supports the
 notion of a reference to an object outside the pickled data stream.  Such
 objects are referenced by a "persistent id", which is just an arbitrary string
@@ -630,6 +639,10 @@
 Subclassing Unpicklers
 ----------------------
 
+.. index::
+   single: load_global() (pickle protocol)
+   single: find_global() (pickle protocol)
+
 By default, unpickling will import any class that it finds in the pickle data.
 You can control exactly what gets unpickled and what gets called by customizing
 your unpickler.  Unfortunately, exactly how you do this is different depending

Modified: python/branches/trunk-math/Doc/library/platform.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/platform.rst	(original)
+++ python/branches/trunk-math/Doc/library/platform.rst	Thu Feb 28 21:09:17 2008
@@ -245,7 +245,7 @@
    version)`` which default to the given parameters in case the lookup fails.
 
    Note that this function has intimate knowledge of how different libc versions
-   add symbols to the executable is probably only useable for executables compiled
+   add symbols to the executable is probably only usable for executables compiled
    using :program:`gcc`.
 
    The file is read and scanned in chunks of *chunksize* bytes.

Modified: python/branches/trunk-math/Doc/library/profile.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/profile.rst	(original)
+++ python/branches/trunk-math/Doc/library/profile.rst	Thu Feb 28 21:09:17 2008
@@ -531,7 +531,7 @@
      non-parenthesized number repeats the cumulative time spent in the function
      at the right.
 
-   * With :mod:`cProfile`, each caller is preceeded by three numbers: the number of
+   * With :mod:`cProfile`, each caller is preceded by three numbers: the number of
      times this specific call was made, and the total and cumulative times spent in
      the current function while it was invoked by this specific caller.
 

Modified: python/branches/trunk-math/Doc/library/random.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/random.rst	(original)
+++ python/branches/trunk-math/Doc/library/random.rst	Thu Feb 28 21:09:17 2008
@@ -98,7 +98,7 @@
    Change the internal state to one different from and likely far away from the
    current state.  *n* is a non-negative integer which is used to scramble the
    current state vector.  This is most useful in multi-threaded programs, in
-   conjuction with multiple instances of the :class:`Random` class:
+   conjunction with multiple instances of the :class:`Random` class:
    :meth:`setstate` or :meth:`seed` can be used to force all instances into the
    same internal state, and then :meth:`jumpahead` can be used to force the
    instances' states far apart.

Modified: python/branches/trunk-math/Doc/library/re.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/re.rst	(original)
+++ python/branches/trunk-math/Doc/library/re.rst	Thu Feb 28 21:09:17 2008
@@ -1102,7 +1102,7 @@
    'Heather Albrecht 548.326.4584 919 Park Place']
 
 Finally, split each entry into a list with first name, last name, telephone
-number, and address.  We use the ``maxsplit`` paramater of :func:`split`
+number, and address.  We use the ``maxsplit`` parameter of :func:`split`
 because the address has spaces, our splitting pattern, in it::
 
    >>> [re.split(":? ", entry, 3) for entry in entries]
@@ -1112,7 +1112,7 @@
    ['Heather', 'Albrecht', '548.326.4584', '919 Park Place']]
 
 The ``:?`` pattern matches the colon after the last name, so that it does not
-occur in the result list.  With a ``maxsplit`` of ``4``, we could seperate the
+occur in the result list.  With a ``maxsplit`` of ``4``, we could separate the
 house number from the street name::
 
    >>> [re.split(":? ", entry, 4) for entry in entries]
@@ -1144,7 +1144,7 @@
 Finding all Adverbs
 ^^^^^^^^^^^^^^^^^^^
 
-:func:`findall` matches *all* occurences of a pattern, not just the first
+:func:`findall` matches *all* occurrences of a pattern, not just the first
 one as :func:`search` does.  For example, if one was a writer and wanted to
 find all of the adverbs in some text, he or she might use :func:`findall` in
 the following manner::

Modified: python/branches/trunk-math/Doc/library/signal.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/signal.rst	(original)
+++ python/branches/trunk-math/Doc/library/signal.rst	Thu Feb 28 21:09:17 2008
@@ -124,6 +124,21 @@
    exception to be raised.
 
 
+
+.. function:: siginterrupt(signalnum, flag)
+
+   Change system call restart behaviour: if *flag* is :const:`False`, system calls
+   will be restarted when interrupted by signal *signalnum*, else system calls will
+   be interrupted. Returns nothing. Availability: Unix, Mac (see the man page
+   :manpage:`siginterrupt(3)` for further information).
+   
+   Note that installing a signal handler with :func:`signal` will reset the restart
+   behaviour to interruptible by implicitly calling siginterrupt with a true *flag*
+   value for the given signal.
+
+   .. versionadded:: 2.6
+
+
 .. function:: signal(signalnum, handler)
 
    Set the handler for signal *signalnum* to the function *handler*.  *handler* can

Modified: python/branches/trunk-math/Doc/library/simplexmlrpcserver.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/simplexmlrpcserver.rst	(original)
+++ python/branches/trunk-math/Doc/library/simplexmlrpcserver.rst	Thu Feb 28 21:09:17 2008
@@ -120,7 +120,7 @@
    Registers the XML-RPC multicall function system.multicall.
 
 
-.. attribute:: SimpleXMLRPCServer.rpc_paths
+.. attribute:: SimpleXMLRPCRequestHandler.rpc_paths
 
    An attribute value that must be a tuple listing valid path portions of the URL
    for receiving XML-RPC requests.  Requests posted to other paths will result in a
@@ -136,9 +136,15 @@
 Server code::
 
    from SimpleXMLRPCServer import SimpleXMLRPCServer
+   from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
+
+   # Restrict to a particular path.
+   class RequestHandler(SimpleXMLRPCRequestHandler):
+       rpc_paths = ('/RPC2',)
 
    # Create server
-   server = SimpleXMLRPCServer(("localhost", 8000))
+   server = SimpleXMLRPCServer(("localhost", 8000),
+                               requestHandler=RequestHandler)
    server.register_introspection_functions()
 
    # Register pow() function; this will use the value of 

Modified: python/branches/trunk-math/Doc/library/socket.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/socket.rst	(original)
+++ python/branches/trunk-math/Doc/library/socket.rst	Thu Feb 28 21:09:17 2008
@@ -929,5 +929,5 @@
    # receive a package
    print s.recvfrom(65565)
    
-   # disabled promiscous mode
+   # disabled promiscuous mode
    s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)

Modified: python/branches/trunk-math/Doc/library/tokenize.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/tokenize.rst	(original)
+++ python/branches/trunk-math/Doc/library/tokenize.rst	Thu Feb 28 21:09:17 2008
@@ -18,7 +18,7 @@
 
 .. function:: generate_tokens(readline)
 
-   The :func:`generate_tokens` generator requires one argment, *readline*, which
+   The :func:`generate_tokens` generator requires one argument, *readline*, which
    must be a callable object which provides the same interface as the
    :meth:`readline` method of built-in file objects (see section
    :ref:`bltin-file-objects`).  Each call to the function should return one line of

Modified: python/branches/trunk-math/Doc/library/trace.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/trace.rst	(original)
+++ python/branches/trunk-math/Doc/library/trace.rst	Thu Feb 28 21:09:17 2008
@@ -80,7 +80,7 @@
 ---------------------
 
 
-.. class:: Trace([count=1[, trace=1[, countfuncs=0[, countcallers=0[, ignoremods=()[, ignoredirs=()[, infile=None[, outfile=None]]]]]]]])
+.. class:: Trace([count=1[, trace=1[, countfuncs=0[, countcallers=0[, ignoremods=()[, ignoredirs=()[, infile=None[, outfile=None[, timing=False]]]]]]]]])
 
    Create an object to trace execution of a single statement or expression. All
    parameters are optional.  *count* enables counting of line numbers. *trace*
@@ -89,7 +89,8 @@
    *ignoremods* is a list of modules or packages to ignore.  *ignoredirs* is a list
    of directories whose modules or packages should be ignored.  *infile* is the
    file from which to read stored count information.  *outfile* is a file in which
-   to write updated count information.
+   to write updated count information. *timing* enables a timestamp relative
+   to when tracing was started to be displayed.
 
 
 .. method:: Trace.run(cmd)

Modified: python/branches/trunk-math/Doc/library/userdict.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/userdict.rst	(original)
+++ python/branches/trunk-math/Doc/library/userdict.rst	Thu Feb 28 21:09:17 2008
@@ -11,7 +11,7 @@
 simplifies writing classes that need to be substitutable for dictionaries (such
 as the shelve module).
 
-This also module defines a class, :class:`UserDict`, that acts as a wrapper
+This module also defines a class, :class:`UserDict`, that acts as a wrapper
 around dictionary objects.  The need for this class has been largely supplanted
 by the ability to subclass directly from :class:`dict` (a feature that became
 available starting with Python version 2.2).  Prior to the introduction of

Modified: python/branches/trunk-math/Doc/library/weakref.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/weakref.rst	(original)
+++ python/branches/trunk-math/Doc/library/weakref.rst	Thu Feb 28 21:09:17 2008
@@ -63,7 +63,7 @@
    class Dict(dict):
        pass
 
-   obj = Dict(red=1, green=2, blue=3)   # this object is weak referencable
+   obj = Dict(red=1, green=2, blue=3)   # this object is weak referenceable
 
 Extension types can easily be made to support weak references; see
 :ref:`weakref-support`.

Modified: python/branches/trunk-math/Doc/library/xml.dom.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/xml.dom.rst	(original)
+++ python/branches/trunk-math/Doc/library/xml.dom.rst	Thu Feb 28 21:09:17 2008
@@ -652,8 +652,8 @@
 
 .. method:: Element.removeAttribute(name)
 
-   Remove an attribute by name.  No exception is raised if there is no matching
-   attribute.
+   Remove an attribute by name.  If there is no matching attribute, a
+   :exc:`NotFoundErr` is raised.
 
 
 .. method:: Element.removeAttributeNode(oldAttr)

Modified: python/branches/trunk-math/Doc/library/xml.etree.elementtree.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/xml.etree.elementtree.rst	(original)
+++ python/branches/trunk-math/Doc/library/xml.etree.elementtree.rst	Thu Feb 28 21:09:17 2008
@@ -421,7 +421,7 @@
 
 .. method:: TreeBuilder.close()
 
-   Flushes the parser buffers, and returns the toplevel documen element. Returns an
+   Flushes the parser buffers, and returns the toplevel document element. Returns an
    Element instance.
 
 

Modified: python/branches/trunk-math/Doc/library/xmlrpclib.rst
==============================================================================
--- python/branches/trunk-math/Doc/library/xmlrpclib.rst	(original)
+++ python/branches/trunk-math/Doc/library/xmlrpclib.rst	Thu Feb 28 21:09:17 2008
@@ -34,10 +34,7 @@
    all clients and servers; see http://ontosys.com/xml-rpc/extensions.php for a
    description.  The *use_datetime* flag can be used to cause date/time values to
    be presented as :class:`datetime.datetime` objects; this is false by default.
-   :class:`datetime.datetime`, :class:`datetime.date` and :class:`datetime.time`
-   objects may be passed to calls.  :class:`datetime.date` objects are converted
-   with a time of "00:00:00". :class:`datetime.time` objects are converted using
-   today's date.
+   :class:`datetime.datetime` objects may be passed to calls.
 
    Both the HTTP and HTTPS transports support the URL syntax extension for HTTP
    Basic Authentication: ``http://user:pass@host:port/path``.  The  ``user:pass``
@@ -81,9 +78,7 @@
    +---------------------------------+---------------------------------------------+
    | :const:`dates`                  | in seconds since the epoch (pass in an      |
    |                                 | instance of the :class:`DateTime` class) or |
-   |                                 | a :class:`datetime.datetime`,               |
-   |                                 | :class:`datetime.date` or                   |
-   |                                 | :class:`datetime.time` instance             |
+   |                                 | a :class:`datetime.datetime` instance.      |
    +---------------------------------+---------------------------------------------+
    | :const:`binary data`            | pass in an instance of the :class:`Binary`  |
    |                                 | wrapper class                               |
@@ -221,10 +216,10 @@
 DateTime Objects
 ----------------
 
-This class may be initialized with seconds since the epoch, a time tuple, an ISO
-8601 time/date string, or a :class:`datetime.datetime`, :class:`datetime.date`
-or :class:`datetime.time` instance.  It has the following methods, supported
-mainly for internal use by the marshalling/unmarshalling code:
+This class may be initialized with seconds since the epoch, a time
+tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime`
+instance.  It has the following methods, supported mainly for internal
+use by the marshalling/unmarshalling code:
 
 
 .. method:: DateTime.decode(string)
@@ -507,10 +502,7 @@
    ``None`` if no method name is present in the packet. If the XML-RPC packet
    represents a fault condition, this function will raise a :exc:`Fault` exception.
    The *use_datetime* flag can be used to cause date/time values to be presented as
-   :class:`datetime.datetime` objects; this is false by default. Note that even if
-   you call an XML-RPC method with :class:`datetime.date` or :class:`datetime.time`
-   objects, they are converted to :class:`DateTime` objects internally, so only
-   :class:`datetime.datetime` objects will be returned.
+   :class:`datetime.datetime` objects; this is false by default.
 
    .. versionchanged:: 2.5
       The *use_datetime* flag was added.

Modified: python/branches/trunk-math/Doc/reference/compound_stmts.rst
==============================================================================
--- python/branches/trunk-math/Doc/reference/compound_stmts.rst	(original)
+++ python/branches/trunk-math/Doc/reference/compound_stmts.rst	Thu Feb 28 21:09:17 2008
@@ -531,7 +531,7 @@
 
 .. rubric:: Footnotes
 
-.. [#] The exception is propogated to the invocation stack only if there is no
+.. [#] The exception is propagated to the invocation stack only if there is no
    :keyword:`finally` clause that negates the exception.
 
 .. [#] Currently, control "flows off the end" except in the case of an exception or the

Modified: python/branches/trunk-math/Doc/reference/expressions.rst
==============================================================================
--- python/branches/trunk-math/Doc/reference/expressions.rst	(original)
+++ python/branches/trunk-math/Doc/reference/expressions.rst	Thu Feb 28 21:09:17 2008
@@ -395,7 +395,7 @@
    generator, or raises :exc:`StopIteration` if the generator exits without
    yielding another value. When :meth:`send` is called to start the generator, it
    must be called with :const:`None` as the argument, because there is no
-   :keyword:`yield` expression that could receieve the value.
+   :keyword:`yield` expression that could receive the value.
 
 
 .. method:: generator.throw(type[, value[, traceback]])
@@ -677,7 +677,7 @@
 
 If the syntax ``*expression`` appears in the function call, ``expression`` must
 evaluate to a sequence.  Elements from this sequence are treated as if they were
-additional positional arguments; if there are postional arguments *x1*,...,*xN*
+additional positional arguments; if there are positional arguments *x1*,...,*xN*
 , and ``expression`` evaluates to a sequence *y1*,...,*yM*, this is equivalent
 to a call with M+N positional arguments *x1*,...,*xN*,*y1*,...,*yM*.
 

Modified: python/branches/trunk-math/Doc/reference/index.rst
==============================================================================
--- python/branches/trunk-math/Doc/reference/index.rst	(original)
+++ python/branches/trunk-math/Doc/reference/index.rst	Thu Feb 28 21:09:17 2008
@@ -17,7 +17,7 @@
 interfaces available to C/C++ programmers in detail.
 
 .. toctree::
-   :maxdepth: 3
+   :maxdepth: 2
 
    introduction.rst
    lexical_analysis.rst

Modified: python/branches/trunk-math/Doc/tutorial/interpreter.rst
==============================================================================
--- python/branches/trunk-math/Doc/tutorial/interpreter.rst	(original)
+++ python/branches/trunk-math/Doc/tutorial/interpreter.rst	Thu Feb 28 21:09:17 2008
@@ -22,7 +22,7 @@
 alternative location.)
 
 On Windows machines, the Python installation is usually placed in
-:file:`C:\Python26`, though you can change this when you're running the
+:file:`C:\\Python26`, though you can change this when you're running the
 installer.  To add this directory to your path,  you can type the following
 command into the command prompt in a DOS box::
 

Modified: python/branches/trunk-math/Doc/tutorial/stdlib2.rst
==============================================================================
--- python/branches/trunk-math/Doc/tutorial/stdlib2.rst	(original)
+++ python/branches/trunk-math/Doc/tutorial/stdlib2.rst	Thu Feb 28 21:09:17 2008
@@ -269,7 +269,7 @@
    0
    >>> d['primary']                # entry was automatically removed
    Traceback (most recent call last):
-     File "<pyshell#108>", line 1, in -toplevel-
+     File "<stdin>", line 1, in <module>
        d['primary']                # entry was automatically removed
      File "C:/python26/lib/weakref.py", line 46, in __getitem__
        o = self.data[key]()

Modified: python/branches/trunk-math/Doc/using/cmdline.rst
==============================================================================
--- python/branches/trunk-math/Doc/using/cmdline.rst	(original)
+++ python/branches/trunk-math/Doc/using/cmdline.rst	Thu Feb 28 21:09:17 2008
@@ -326,6 +326,8 @@
    * :func:`reduce`
    * :func:`reload`
 
+   Using these will emit a :exc:`DeprecationWarning`.
+
    .. versionadded:: 2.6
 
 

Modified: python/branches/trunk-math/Doc/using/unix.rst
==============================================================================
--- python/branches/trunk-math/Doc/using/unix.rst	(original)
+++ python/branches/trunk-math/Doc/using/unix.rst	Thu Feb 28 21:09:17 2008
@@ -20,7 +20,7 @@
 that are not available on your distro's package.  You can easily compile the
 latest version of Python from source.
 	
-In the event Python doesn't come preinstalled and isn't in the repositories as
+In the event that Python doesn't come preinstalled and isn't in the repositories as
 well, you can easily make packages for your own distro.  Have a look at the
 following links:
 

Modified: python/branches/trunk-math/Doc/using/windows.rst
==============================================================================
--- python/branches/trunk-math/Doc/using/windows.rst	(original)
+++ python/branches/trunk-math/Doc/using/windows.rst	Thu Feb 28 21:09:17 2008
@@ -21,7 +21,7 @@
 <http://www.python.org/download/releases/>`_ for many years.
 
 With ongoing development of Python, some platforms that used to be supported
-earlier are not longer supported (due to the lack of users or developers).
+earlier are no longer supported (due to the lack of users or developers).
 Check :pep:`11` for details on all unsupported platforms.
 
 * DOS and Windows 3.x are deprecated since Python 2.0 and code specific to these

Modified: python/branches/trunk-math/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/trunk-math/Doc/whatsnew/2.6.rst	(original)
+++ python/branches/trunk-math/Doc/whatsnew/2.6.rst	Thu Feb 28 21:09:17 2008
@@ -560,7 +560,7 @@
 Numbers are further divided into :class:`Exact` and :class:`Inexact`.
 Exact numbers can represent values precisely and operations never
 round off the results or introduce tiny errors that may break the
-communtativity and associativity properties; inexact numbers may
+commutativity and associativity properties; inexact numbers may
 perform such rounding or introduce small errors.  Integers, long
 integers, and rational numbers are exact, while floating-point 
 and complex numbers are inexact.
@@ -707,8 +707,10 @@
 
   Other functions in the :mod:`math` module, :func:`isinf` and
   :func:`isnan`, return true if their floating-point argument is
-  infinite or Not A Number.  
+  infinite or Not A Number.
+
   .. Patch 1640
+
   The ``math.copysign(x, y)`` function
   copies the sign bit of an IEEE 754 number, returning the absolute
   value of *x* combined with the sign bit of *y*.  For example,
@@ -1078,7 +1080,7 @@
 
 * Integrating signal handling with GUI handling event loops 
   like those used by Tkinter or GTk+ has long been a problem; most
-  software ends up polling, waking up every fraction of a second.  Thi
+  software ends up polling, waking up every fraction of a second.
   The :mod:`signal` module can now make this more efficient.
   Calling ``signal.set_wakeup_fd(fd)`` sets a file descriptor
   to be used; when a signal is received, a byte is written to that 
@@ -1293,7 +1295,8 @@
     z.extractall()
 
   (Contributed by Alan McIntyre.)
-  .. % Patch 467924
+
+  .. Patch 467924
 
 .. ======================================================================
 .. whole new modules get described in subsections here
@@ -1392,7 +1395,7 @@
   .. Issue 1534
 
 * Python's C API now includes two functions for case-insensitive string
-  comparisions, ``PyOS_stricmp(char*, char*)``
+  comparisons, ``PyOS_stricmp(char*, char*)``
   and ``PyOS_strnicmp(char*, char*, Py_ssize_t)``.
   (Contributed by Christian Heimes.)
 
@@ -1508,6 +1511,15 @@
 
   .. Issue 1706815
 
+* The :mod:`xmlrpclib` module no longer automatically converts
+  :class:`datetime.date` and :class:`datetime.time` to the 
+  :class:`xmlrpclib.DateTime` type; the conversion semantics were
+  not necessarily correct for all applications.  Code using
+  :mod:`xmlrpclib` should convert :class:`date` and :class:`time` 
+  instances.
+
+  .. Issue 1330538
+
 .. ======================================================================
 
 

Modified: python/branches/trunk-math/Grammar/Grammar
==============================================================================
--- python/branches/trunk-math/Grammar/Grammar	(original)
+++ python/branches/trunk-math/Grammar/Grammar	Thu Feb 28 21:09:17 2008
@@ -33,7 +33,8 @@
 
 decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
 decorators: decorator+
-funcdef: [decorators] 'def' NAME parameters ':' suite
+decorated: decorators (classdef | funcdef)
+funcdef: 'def' NAME parameters ':' suite
 parameters: '(' [varargslist] ')'
 varargslist: ((fpdef ['=' test] ',')*
               ('*' NAME [',' '**' NAME] | '**' NAME) |
@@ -73,7 +74,7 @@
 exec_stmt: 'exec' expr ['in' test [',' test]]
 assert_stmt: 'assert' test [',' test]
 
-compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef
+compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated
 if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
 while_stmt: 'while' test ':' suite ['else' ':' suite]
 for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]

Modified: python/branches/trunk-math/Include/Python-ast.h
==============================================================================
--- python/branches/trunk-math/Include/Python-ast.h	(original)
+++ python/branches/trunk-math/Include/Python-ast.h	Thu Feb 28 21:09:17 2008
@@ -73,13 +73,14 @@
                         identifier name;
                         arguments_ty args;
                         asdl_seq *body;
-                        asdl_seq *decorators;
+                        asdl_seq *decorator_list;
                 } FunctionDef;
                 
                 struct {
                         identifier name;
                         asdl_seq *bases;
                         asdl_seq *body;
+                        asdl_seq *decorator_list;
                 } ClassDef;
                 
                 struct {
@@ -359,11 +360,12 @@
 mod_ty _Py_Suite(asdl_seq * body, PyArena *arena);
 #define FunctionDef(a0, a1, a2, a3, a4, a5, a6) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6)
 stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
-                        asdl_seq * decorators, int lineno, int col_offset,
+                        asdl_seq * decorator_list, int lineno, int col_offset,
                         PyArena *arena);
-#define ClassDef(a0, a1, a2, a3, a4, a5) _Py_ClassDef(a0, a1, a2, a3, a4, a5)
-stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int
-                     lineno, int col_offset, PyArena *arena);
+#define ClassDef(a0, a1, a2, a3, a4, a5, a6) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6)
+stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * body,
+                     asdl_seq * decorator_list, int lineno, int col_offset,
+                     PyArena *arena);
 #define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3)
 stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena);
 #define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3)

Modified: python/branches/trunk-math/Include/abstract.h
==============================================================================
--- python/branches/trunk-math/Include/abstract.h	(original)
+++ python/branches/trunk-math/Include/abstract.h	Thu Feb 28 21:09:17 2008
@@ -529,6 +529,13 @@
 
        */
 
+     PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj,
+					    PyObject *format_spec);
+       /*
+	 Takes an arbitrary object and returns the result of
+	 calling obj.__format__(format_spec).
+       */
+
 /* Iterators */
 
      PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);

Modified: python/branches/trunk-math/Include/graminit.h
==============================================================================
--- python/branches/trunk-math/Include/graminit.h	(original)
+++ python/branches/trunk-math/Include/graminit.h	Thu Feb 28 21:09:17 2008
@@ -3,82 +3,83 @@
 #define eval_input 258
 #define decorator 259
 #define decorators 260
-#define funcdef 261
-#define parameters 262
-#define varargslist 263
-#define fpdef 264
-#define fplist 265
-#define stmt 266
-#define simple_stmt 267
-#define small_stmt 268
-#define expr_stmt 269
-#define augassign 270
-#define print_stmt 271
-#define del_stmt 272
-#define pass_stmt 273
-#define flow_stmt 274
-#define break_stmt 275
-#define continue_stmt 276
-#define return_stmt 277
-#define yield_stmt 278
-#define raise_stmt 279
-#define import_stmt 280
-#define import_name 281
-#define import_from 282
-#define import_as_name 283
-#define dotted_as_name 284
-#define import_as_names 285
-#define dotted_as_names 286
-#define dotted_name 287
-#define global_stmt 288
-#define exec_stmt 289
-#define assert_stmt 290
-#define compound_stmt 291
-#define if_stmt 292
-#define while_stmt 293
-#define for_stmt 294
-#define try_stmt 295
-#define with_stmt 296
-#define with_var 297
-#define except_clause 298
-#define suite 299
-#define testlist_safe 300
-#define old_test 301
-#define old_lambdef 302
-#define test 303
-#define or_test 304
-#define and_test 305
-#define not_test 306
-#define comparison 307
-#define comp_op 308
-#define expr 309
-#define xor_expr 310
-#define and_expr 311
-#define shift_expr 312
-#define arith_expr 313
-#define term 314
-#define factor 315
-#define power 316
-#define atom 317
-#define listmaker 318
-#define testlist_gexp 319
-#define lambdef 320
-#define trailer 321
-#define subscriptlist 322
-#define subscript 323
-#define sliceop 324
-#define exprlist 325
-#define testlist 326
-#define dictmaker 327
-#define classdef 328
-#define arglist 329
-#define argument 330
-#define list_iter 331
-#define list_for 332
-#define list_if 333
-#define gen_iter 334
-#define gen_for 335
-#define gen_if 336
-#define testlist1 337
-#define encoding_decl 338
-#define yield_expr 339
+#define decorated 261
+#define funcdef 262
+#define parameters 263
+#define varargslist 264
+#define fpdef 265
+#define fplist 266
+#define stmt 267
+#define simple_stmt 268
+#define small_stmt 269
+#define expr_stmt 270
+#define augassign 271
+#define print_stmt 272
+#define del_stmt 273
+#define pass_stmt 274
+#define flow_stmt 275
+#define break_stmt 276
+#define continue_stmt 277
+#define return_stmt 278
+#define yield_stmt 279
+#define raise_stmt 280
+#define import_stmt 281
+#define import_name 282
+#define import_from 283
+#define import_as_name 284
+#define dotted_as_name 285
+#define import_as_names 286
+#define dotted_as_names 287
+#define dotted_name 288
+#define global_stmt 289
+#define exec_stmt 290
+#define assert_stmt 291
+#define compound_stmt 292
+#define if_stmt 293
+#define while_stmt 294
+#define for_stmt 295
+#define try_stmt 296
+#define with_stmt 297
+#define with_var 298
+#define except_clause 299
+#define suite 300
+#define testlist_safe 301
+#define old_test 302
+#define old_lambdef 303
+#define test 304
+#define or_test 305
+#define and_test 306
+#define not_test 307
+#define comparison 308
+#define comp_op 309
+#define expr 310
+#define xor_expr 311
+#define and_expr 312
+#define shift_expr 313
+#define arith_expr 314
+#define term 315
+#define factor 316
+#define power 317
+#define atom 318
+#define listmaker 319
+#define testlist_gexp 320
+#define lambdef 321
+#define trailer 322
+#define subscriptlist 323
+#define subscript 324
+#define sliceop 325
+#define exprlist 326
+#define testlist 327
+#define dictmaker 328
+#define classdef 329
+#define arglist 330
+#define argument 331
+#define list_iter 332
+#define list_for 333
+#define list_if 334
+#define gen_iter 335
+#define gen_for 336
+#define gen_if 337
+#define testlist1 338
+#define encoding_decl 339
+#define yield_expr 340

Modified: python/branches/trunk-math/Include/longintrepr.h
==============================================================================
--- python/branches/trunk-math/Include/longintrepr.h	(original)
+++ python/branches/trunk-math/Include/longintrepr.h	Thu Feb 28 21:09:17 2008
@@ -28,8 +28,13 @@
 #define PyLong_BASE     ((digit)1 << PyLong_SHIFT)
 #define PyLong_MASK     ((int)(PyLong_BASE - 1))
 
+/* b/w compatibility with Python 2.5 */
+#define SHIFT	PyLong_SHIFT
+#define BASE	PyLong_BASE
+#define MASK	PyLong_MASK
+
 #if PyLong_SHIFT % 5 != 0
-#error "longobject.c requires that SHIFT be divisible by 5"
+#error "longobject.c requires that PyLong_SHIFT be divisible by 5"
 #endif
 
 /* Long integer representation.

Modified: python/branches/trunk-math/Include/object.h
==============================================================================
--- python/branches/trunk-math/Include/object.h	(original)
+++ python/branches/trunk-math/Include/object.h	Thu Feb 28 21:09:17 2008
@@ -537,6 +537,9 @@
 #define Py_TPFLAGS_HAVE_VERSION_TAG   (1L<<18)
 #define Py_TPFLAGS_VALID_VERSION_TAG  (1L<<19)
 
+/* Type is abstract and cannot be instantiated */
+#define Py_TPFLAGS_IS_ABSTRACT (1L<<20)
+
 /* These flags are used to determine if a type is a subclass. */
 #define Py_TPFLAGS_INT_SUBCLASS		(1L<<23)
 #define Py_TPFLAGS_LONG_SUBCLASS	(1L<<24)

Modified: python/branches/trunk-math/Lib/BaseHTTPServer.py
==============================================================================
--- python/branches/trunk-math/Lib/BaseHTTPServer.py	(original)
+++ python/branches/trunk-math/Lib/BaseHTTPServer.py	Thu Feb 28 21:09:17 2008
@@ -76,7 +76,7 @@
 import mimetools
 import SocketServer
 
-# Default error message
+# Default error message template
 DEFAULT_ERROR_MESSAGE = """\
 <head>
 <title>Error response</title>
@@ -89,6 +89,8 @@
 </body>
 """
 
+DEFAULT_ERROR_CONTENT_TYPE = "text/html"
+
 def _quote_html(html):
     return html.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
 
@@ -342,13 +344,14 @@
         content = (self.error_message_format %
                    {'code': code, 'message': _quote_html(message), 'explain': explain})
         self.send_response(code, message)
-        self.send_header("Content-Type", "text/html")
+        self.send_header("Content-Type", self.error_content_type)
         self.send_header('Connection', 'close')
         self.end_headers()
         if self.command != 'HEAD' and code >= 200 and code not in (204, 304):
             self.wfile.write(content)
 
     error_message_format = DEFAULT_ERROR_MESSAGE
+    error_content_type = DEFAULT_ERROR_CONTENT_TYPE
 
     def send_response(self, code, message=None):
         """Send the response header and log the response code.

Modified: python/branches/trunk-math/Lib/ConfigParser.py
==============================================================================
--- python/branches/trunk-math/Lib/ConfigParser.py	(original)
+++ python/branches/trunk-math/Lib/ConfigParser.py	Thu Feb 28 21:09:17 2008
@@ -235,8 +235,12 @@
         """Create a new section in the configuration.
 
         Raise DuplicateSectionError if a section by the specified name
-        already exists.
+        already exists. Raise ValueError if name is DEFAULT or any of it's
+        case-insensitive variants.
         """
+        if section.lower() == "default":
+            raise ValueError, 'Invalid section name: %s' % section
+
         if section in self._sections:
             raise DuplicateSectionError(section)
         self._sections[section] = self._dict()

Modified: python/branches/trunk-math/Lib/SimpleHTTPServer.py
==============================================================================
--- python/branches/trunk-math/Lib/SimpleHTTPServer.py	(original)
+++ python/branches/trunk-math/Lib/SimpleHTTPServer.py	Thu Feb 28 21:09:17 2008
@@ -14,7 +14,6 @@
 import posixpath
 import BaseHTTPServer
 import urllib
-import urlparse
 import cgi
 import shutil
 import mimetypes
@@ -113,8 +112,9 @@
         list.sort(key=lambda a: a.lower())
         f = StringIO()
         displaypath = cgi.escape(urllib.unquote(self.path))
-        f.write("<title>Directory listing for %s</title>\n" % displaypath)
-        f.write("<h2>Directory listing for %s</h2>\n" % displaypath)
+        f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">')
+        f.write("<html>\n<title>Directory listing for %s</title>\n" % displaypath)
+        f.write("<body>\n<h2>Directory listing for %s</h2>\n" % displaypath)
         f.write("<hr>\n<ul>\n")
         for name in list:
             fullname = os.path.join(path, name)
@@ -128,7 +128,7 @@
                 # Note: a link to a directory displays with @ and links with /
             f.write('<li><a href="%s">%s</a>\n'
                     % (urllib.quote(linkname), cgi.escape(displayname)))
-        f.write("</ul>\n<hr>\n")
+        f.write("</ul>\n<hr>\n</body>\n</html>\n")
         length = f.tell()
         f.seek(0)
         self.send_response(200)
@@ -146,7 +146,8 @@
 
         """
         # abandon query parameters
-        path = urlparse.urlparse(path)[2]
+        path = path.split('?',1)[0]
+        path = path.split('#',1)[0]
         path = posixpath.normpath(urllib.unquote(path))
         words = path.split('/')
         words = filter(None, words)

Modified: python/branches/trunk-math/Lib/UserDict.py
==============================================================================
--- python/branches/trunk-math/Lib/UserDict.py	(original)
+++ python/branches/trunk-math/Lib/UserDict.py	Thu Feb 28 21:09:17 2008
@@ -41,7 +41,7 @@
     def iterkeys(self): return self.data.iterkeys()
     def itervalues(self): return self.data.itervalues()
     def values(self): return self.data.values()
-    def has_key(self, key): return self.data.has_key(key)
+    def has_key(self, key): return key in self.data
     def update(self, dict=None, **kwargs):
         if dict is None:
             pass
@@ -55,11 +55,11 @@
         if len(kwargs):
             self.data.update(kwargs)
     def get(self, key, failobj=None):
-        if not self.has_key(key):
+        if key not in self:
             return failobj
         return self[key]
     def setdefault(self, key, failobj=None):
-        if not self.has_key(key):
+        if key not in self:
             self[key] = failobj
         return self[key]
     def pop(self, key, *args):

Modified: python/branches/trunk-math/Lib/abc.py
==============================================================================
--- python/branches/trunk-math/Lib/abc.py	(original)
+++ python/branches/trunk-math/Lib/abc.py	Thu Feb 28 21:09:17 2008
@@ -51,52 +51,6 @@
     __isabstractmethod__ = True
 
 
-class _Abstract(object):
-
-    """Helper class inserted into the bases by ABCMeta (using _fix_bases()).
-
-    You should never need to explicitly subclass this class.
-
-    There should never be a base class between _Abstract and object.
-    """
-
-    def __new__(cls, *args, **kwds):
-        am = cls.__dict__.get("__abstractmethods__")
-        if am:
-            raise TypeError("Can't instantiate abstract class %s "
-                            "with abstract methods %s" %
-                            (cls.__name__, ", ".join(sorted(am))))
-        if (args or kwds) and cls.__init__ is object.__init__:
-            raise TypeError("Can't pass arguments to __new__ "
-                            "without overriding __init__")
-        return super(_Abstract, cls).__new__(cls)
-
-    @classmethod
-    def __subclasshook__(cls, subclass):
-        """Abstract classes can override this to customize issubclass().
-
-        This is invoked early on by __subclasscheck__() below.  It
-        should return True, False or NotImplemented.  If it returns
-        NotImplemented, the normal algorithm is used.  Otherwise, it
-        overrides the normal algorithm (and the outcome is cached).
-        """
-        return NotImplemented
-
-
-def _fix_bases(bases):
-    """Helper method that inserts _Abstract in the bases if needed."""
-    for base in bases:
-        if issubclass(base, _Abstract):
-            # _Abstract is already a base (maybe indirectly)
-            return bases
-    if object in bases:
-        # Replace object with _Abstract
-        return tuple([_Abstract if base is object else base
-                      for base in bases])
-    # Append _Abstract to the end
-    return bases + (_Abstract,)
-
-
 class ABCMeta(type):
 
     """Metaclass for defining Abstract Base Classes (ABCs).
@@ -119,7 +73,6 @@
     _abc_invalidation_counter = 0
 
     def __new__(mcls, name, bases, namespace):
-        bases = _fix_bases(bases)
         cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace)
         # Compute set of abstract method names
         abstracts = set(name
@@ -130,7 +83,7 @@
                 value = getattr(cls, name, None)
                 if getattr(value, "__isabstractmethod__", False):
                     abstracts.add(name)
-        cls.__abstractmethods__ = abstracts
+        cls.__abstractmethods__ = frozenset(abstracts)
         # Set up inheritance registry
         cls._abc_registry = set()
         cls._abc_cache = set()

Modified: python/branches/trunk-math/Lib/bsddb/test/test_associate.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_associate.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_associate.py	Thu Feb 28 21:09:17 2008
@@ -91,7 +91,7 @@
 class AssociateErrorTestCase(unittest.TestCase):
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)
@@ -106,11 +106,8 @@
     def tearDown(self):
         self.env.close()
         self.env = None
-        import glob
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
-
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def test00_associateDBError(self):
         if verbose:
@@ -151,7 +148,7 @@
 
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)

Modified: python/branches/trunk-math/Lib/bsddb/test/test_basics.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_basics.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_basics.py	Thu Feb 28 21:09:17 2008
@@ -4,12 +4,11 @@
 """
 
 import os
-import sys
 import errno
-import shutil
 import string
 import tempfile
 from pprint import pprint
+from test import test_support
 import unittest
 import time
 
@@ -54,13 +53,9 @@
 
     def setUp(self):
         if self.useEnv:
-            homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+            homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
             self.homeDir = homeDir
-            try:
-                shutil.rmtree(homeDir)
-            except OSError, e:
-                # unix returns ENOENT, windows returns ESRCH
-                if e.errno not in (errno.ENOENT, errno.ESRCH): raise
+            test_support.rmtree(homeDir)
             os.mkdir(homeDir)
             try:
                 self.env = db.DBEnv()
@@ -74,7 +69,7 @@
                 tempfile.tempdir = None
             # Yes, a bare except is intended, since we're re-raising the exc.
             except:
-                shutil.rmtree(homeDir)
+                test_support.rmtree(homeDir)
                 raise
         else:
             self.env = None
@@ -98,8 +93,8 @@
     def tearDown(self):
         self.d.close()
         if self.env is not None:
+            test_support.rmtree(self.homeDir)
             self.env.close()
-            shutil.rmtree(self.homeDir)
             ## Make a new DBEnv to remove the env files from the home dir.
             ## (It can't be done while the env is open, nor after it has been
             ## closed, so we make a new one to do it.)

Modified: python/branches/trunk-math/Lib/bsddb/test/test_compare.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_compare.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_compare.py	Thu Feb 28 21:09:17 2008
@@ -52,7 +52,7 @@
 
     def setUp (self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join (tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join (tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try:
             os.mkdir (homeDir)
@@ -70,8 +70,8 @@
         if self.env is not None:
             self.env.close ()
             self.env = None
-        import glob
-        map (os.remove, glob.glob (os.path.join (self.homeDir, '*')))
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def addDataToDB (self, data):
         i = 0

Modified: python/branches/trunk-math/Lib/bsddb/test/test_compat.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_compat.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_compat.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,7 @@
 regression test suite.
 """
 
-import sys, os, string
+import os, string
 import unittest
 import tempfile
 

Modified: python/branches/trunk-math/Lib/bsddb/test/test_cursor_pget_bug.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_cursor_pget_bug.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_cursor_pget_bug.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,6 @@
 import unittest
 import tempfile
-import sys, os, glob
+import os, glob
 
 try:
     # For Pythons w/distutils pybsddb
@@ -17,7 +17,7 @@
     db_name = 'test-cursor_pget.db'
 
     def setUp(self):
-        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         try:
             os.mkdir(self.homeDir)
         except os.error:
@@ -42,9 +42,8 @@
         del self.secondary_db
         del self.primary_db
         del self.env
-        for file in glob.glob(os.path.join(self.homeDir, '*')):
-            os.remove(file)
-        os.removedirs(self.homeDir)
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def test_pget(self):
         cursor = self.secondary_db.cursor()

Modified: python/branches/trunk-math/Lib/bsddb/test/test_dbobj.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_dbobj.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_dbobj.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 
-import sys, os, string
+import os, string
 import unittest
-import glob
 import tempfile
 
 try:
@@ -20,7 +19,7 @@
     db_name = 'test-dbobj.db'
 
     def setUp(self):
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass
@@ -30,9 +29,8 @@
             del self.db
         if hasattr(self, 'env'):
             del self.env
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def test01_both(self):
         class TestDBEnv(dbobj.DBEnv): pass

Modified: python/branches/trunk-math/Lib/bsddb/test/test_dbshelve.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_dbshelve.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_dbshelve.py	Thu Feb 28 21:09:17 2008
@@ -2,9 +2,8 @@
 TestCases for checking dbShelve objects.
 """
 
-import sys, os, string
+import os, string
 import tempfile, random
-from pprint import pprint
 from types import *
 import unittest
 
@@ -246,7 +245,7 @@
 class BasicEnvShelveTestCase(DBShelveTestCase):
     def do_open(self):
         self.homeDir = homeDir = os.path.join(
-            tempfile.gettempdir(), 'db_home')
+            tempfile.gettempdir(), 'db_home%d'%os.getpid())
         try: os.mkdir(homeDir)
         except os.error: pass
         self.env = db.DBEnv()
@@ -263,12 +262,9 @@
 
 
     def tearDown(self):
+        from test import test_support
+        test_support.rmtree(self.homeDir)
         self.do_close()
-        import glob
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
-
 
 
 class EnvBTreeShelveTestCase(BasicEnvShelveTestCase):

Modified: python/branches/trunk-math/Lib/bsddb/test/test_dbtables.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_dbtables.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_dbtables.py	Thu Feb 28 21:09:17 2008
@@ -20,9 +20,8 @@
 #
 # $Id$
 
-import sys, os, re
+import os, re
 import tempfile
-import shutil
 try:
     import cPickle
     pickle = cPickle
@@ -58,7 +57,8 @@
 
     def tearDown(self):
         self.tdb.close()
-        shutil.rmtree(self.testHomeDir)
+        from test import test_support
+        test_support.rmtree(self.testHomeDir)
 
     def test01(self):
         tabname = "test01"

Modified: python/branches/trunk-math/Lib/bsddb/test/test_env_close.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_env_close.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_env_close.py	Thu Feb 28 21:09:17 2008
@@ -3,9 +3,7 @@
 """
 
 import os
-import sys
 import tempfile
-import glob
 import unittest
 
 try:
@@ -33,7 +31,7 @@
 
 class DBEnvClosedEarlyCrash(unittest.TestCase):
     def setUp(self):
-        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         try: os.mkdir(self.homeDir)
         except os.error: pass
         tempfile.tempdir = self.homeDir
@@ -41,10 +39,8 @@
         tempfile.tempdir = None
 
     def tearDown(self):
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
-
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def test01_close_dbenv_before_db(self):
         dbenv = db.DBEnv()

Modified: python/branches/trunk-math/Lib/bsddb/test/test_get_none.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_get_none.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_get_none.py	Thu Feb 28 21:09:17 2008
@@ -2,9 +2,8 @@
 TestCases for checking set_get_returns_none.
 """
 
-import sys, os, string
+import os, string
 import tempfile
-from pprint import pprint
 import unittest
 
 try:

Modified: python/branches/trunk-math/Lib/bsddb/test/test_join.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_join.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_join.py	Thu Feb 28 21:09:17 2008
@@ -1,10 +1,8 @@
 """TestCases for using the DB.join and DBCursor.join_item methods.
 """
 
-import sys, os, string
+import os
 import tempfile
-import time
-from pprint import pprint
 
 try:
     from threading import Thread, currentThread
@@ -49,7 +47,7 @@
 
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass
@@ -58,10 +56,8 @@
 
     def tearDown(self):
         self.env.close()
-        import glob
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def test01_join(self):
         if verbose:

Modified: python/branches/trunk-math/Lib/bsddb/test/test_lock.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_lock.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_lock.py	Thu Feb 28 21:09:17 2008
@@ -2,10 +2,6 @@
 TestCases for testing the locking sub-system.
 """
 
-import os
-from pprint import pprint
-import shutil
-import sys
 import tempfile
 import time
 
@@ -40,7 +36,8 @@
 
     def tearDown(self):
         self.env.close()
-        shutil.rmtree(self.homeDir)
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
 
     def test01_simple(self):

Modified: python/branches/trunk-math/Lib/bsddb/test/test_misc.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_misc.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_misc.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 """
 
 import os
-import sys
 import unittest
 import tempfile
 
@@ -18,7 +17,7 @@
 class MiscTestCase(unittest.TestCase):
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)
@@ -26,12 +25,9 @@
             pass
 
     def tearDown(self):
-        try:
-            os.remove(self.filename)
-        except OSError:
-            pass
-        import shutil
-        shutil.rmtree(self.homeDir)
+        from test import test_support
+        test_support.unlink(self.filename)
+        test_support.rmtree(self.homeDir)
 
     def test01_badpointer(self):
         dbs = dbshelve.open(self.filename)

Modified: python/branches/trunk-math/Lib/bsddb/test/test_pickle.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_pickle.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_pickle.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,5 @@
 
-import sys, os, string
+import os
 import pickle
 try:
     import cPickle
@@ -7,7 +7,6 @@
     cPickle = None
 import unittest
 import tempfile
-import glob
 
 try:
     # For Pythons w/distutils pybsddb
@@ -25,7 +24,7 @@
     db_name = 'test-dbobj.db'
 
     def setUp(self):
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass
@@ -35,9 +34,8 @@
             del self.db
         if hasattr(self, 'env'):
             del self.env
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def _base_test_pickle_DBError(self, pickle):
         self.env = db.DBEnv()

Modified: python/branches/trunk-math/Lib/bsddb/test/test_queue.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_queue.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_queue.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,7 @@
 TestCases for exercising a Queue DB.
 """
 
-import sys, os, string
+import os, string
 import tempfile
 from pprint import pprint
 import unittest

Modified: python/branches/trunk-math/Lib/bsddb/test/test_recno.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_recno.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_recno.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 """
 
 import os
-import sys
 import errno
 import tempfile
 from pprint import pprint
@@ -25,12 +24,13 @@
 class SimpleRecnoTestCase(unittest.TestCase):
     def setUp(self):
         self.filename = tempfile.mktemp()
+        self.homeDir = None
 
     def tearDown(self):
-        try:
-            os.remove(self.filename)
-        except OSError, e:
-            if e.errno <> errno.EEXIST: raise
+        from test import test_support
+        test_support.unlink(self.filename)
+        if self.homeDir:
+            test_support.rmtree(self.homeDir)
 
     def test01_basic(self):
         d = db.DB()
@@ -203,7 +203,8 @@
         just a line in the file, but you can set a different record delimiter
         if needed.
         """
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
+        self.homeDir = homeDir
         source = os.path.join(homeDir, 'test_recno.txt')
         if not os.path.isdir(homeDir):
             os.mkdir(homeDir)

Modified: python/branches/trunk-math/Lib/bsddb/test/test_sequence.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_sequence.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_sequence.py	Thu Feb 28 21:09:17 2008
@@ -1,8 +1,6 @@
 import unittest
 import os
-import sys
 import tempfile
-import glob
 
 try:
     # For Pythons w/distutils pybsddb
@@ -10,13 +8,11 @@
 except ImportError:
     from bsddb import db
 
-from test_all import verbose
-
 
 class DBSequenceTest(unittest.TestCase):
     def setUp(self):
         self.int_32_max = 0x100000000
-        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         try:
             os.mkdir(self.homeDir)
         except os.error:
@@ -41,9 +37,8 @@
             self.dbenv.close()
             del self.dbenv
 
-        files = glob.glob(os.path.join(self.homeDir, '*'))
-        for file in files:
-            os.remove(file)
+        from test import test_support
+        test_support.rmtree(self.homeDir)
 
     def test_get(self):
         self.seq = db.DBSequence(self.d, flags=0)

Modified: python/branches/trunk-math/Lib/bsddb/test/test_thread.py
==============================================================================
--- python/branches/trunk-math/Lib/bsddb/test/test_thread.py	(original)
+++ python/branches/trunk-math/Lib/bsddb/test/test_thread.py	Thu Feb 28 21:09:17 2008
@@ -5,9 +5,7 @@
 import sys
 import time
 import errno
-import shutil
 import tempfile
-from pprint import pprint
 from random import random
 
 try:
@@ -53,7 +51,7 @@
         if verbose:
             dbutils._deadlock_VerboseFile = sys.stdout
 
-        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)
@@ -70,12 +68,10 @@
         self.d.open(self.filename, self.dbtype, self.dbopenflags|db.DB_CREATE)
 
     def tearDown(self):
+        from test import test_support
+        test_support.rmtree(self.homeDir)
         self.d.close()
         self.env.close()
-        try:
-            shutil.rmtree(self.homeDir)
-        except OSError, e:
-            if e.errno != errno.EEXIST: raise
 
     def setEnvOpts(self):
         pass

Modified: python/branches/trunk-math/Lib/compiler/ast.py
==============================================================================
--- python/branches/trunk-math/Lib/compiler/ast.py	(original)
+++ python/branches/trunk-math/Lib/compiler/ast.py	Thu Feb 28 21:09:17 2008
@@ -308,11 +308,12 @@
         return "CallFunc(%s, %s, %s, %s)" % (repr(self.node), repr(self.args), repr(self.star_args), repr(self.dstar_args))
 
 class Class(Node):
-    def __init__(self, name, bases, doc, code, lineno=None):
+    def __init__(self, name, bases, doc, code, decorators = None, lineno=None):
         self.name = name
         self.bases = bases
         self.doc = doc
         self.code = code
+        self.decorators = decorators
         self.lineno = lineno
 
     def getChildren(self):
@@ -321,16 +322,19 @@
         children.extend(flatten(self.bases))
         children.append(self.doc)
         children.append(self.code)
+        children.append(self.decorators)
         return tuple(children)
 
     def getChildNodes(self):
         nodelist = []
         nodelist.extend(flatten_nodes(self.bases))
         nodelist.append(self.code)
+        if self.decorators is not None:
+            nodelist.append(self.decorators)
         return tuple(nodelist)
 
     def __repr__(self):
-        return "Class(%s, %s, %s, %s)" % (repr(self.name), repr(self.bases), repr(self.doc), repr(self.code))
+        return "Class(%s, %s, %s, %s, %s)" % (repr(self.name), repr(self.bases), repr(self.doc), repr(self.code), repr(self.decorators))
 
 class Compare(Node):
     def __init__(self, expr, ops, lineno=None):

Modified: python/branches/trunk-math/Lib/compiler/transformer.py
==============================================================================
--- python/branches/trunk-math/Lib/compiler/transformer.py	(original)
+++ python/branches/trunk-math/Lib/compiler/transformer.py	Thu Feb 28 21:09:17 2008
@@ -29,7 +29,6 @@
 import parser
 import symbol
 import token
-import sys
 
 class WalkerError(StandardError):
     pass
@@ -233,6 +232,18 @@
             items.append(self.decorator(dec_nodelist[1:]))
         return Decorators(items)
 
+    def decorated(self, nodelist):
+        assert nodelist[0][0] == symbol.decorators
+        if nodelist[1][0] == symbol.funcdef:
+            n = [nodelist[0]] + list(nodelist[1][1:])
+            return self.funcdef(n)
+        elif nodelist[1][0] == symbol.classdef:
+            decorators = self.decorators(nodelist[0][1:])
+            cls = self.classdef(nodelist[1][1:])
+            cls.decorators = decorators
+            return cls
+        raise WalkerError()
+
     def funcdef(self, nodelist):
         #                    -6   -5    -4         -3  -2    -1
         # funcdef: [decorators] 'def' NAME parameters ':' suite

Modified: python/branches/trunk-math/Lib/copy_reg.py
==============================================================================
--- python/branches/trunk-math/Lib/copy_reg.py	(original)
+++ python/branches/trunk-math/Lib/copy_reg.py	Thu Feb 28 21:09:17 2008
@@ -15,7 +15,7 @@
     if type(ob_type) is _ClassType:
         raise TypeError("copy_reg is not intended for use with classes")
 
-    if not callable(pickle_function):
+    if not hasattr(pickle_function, '__call__'):
         raise TypeError("reduction functions must be callable")
     dispatch_table[ob_type] = pickle_function
 
@@ -25,7 +25,7 @@
         constructor(constructor_ob)
 
 def constructor(object):
-    if not callable(object):
+    if not hasattr(object, '__call__'):
         raise TypeError("constructors must be callable")
 
 # Example: provide pickling support for complex numbers.

Modified: python/branches/trunk-math/Lib/ctypes/__init__.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/__init__.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/__init__.py	Thu Feb 28 21:09:17 2008
@@ -17,7 +17,7 @@
 from struct import calcsize as _calcsize
 
 if __version__ != _ctypes_version:
-    raise Exception, ("Version number mismatch", __version__, _ctypes_version)
+    raise Exception("Version number mismatch", __version__, _ctypes_version)
 
 if _os.name in ("nt", "ce"):
     from _ctypes import FormatError
@@ -63,7 +63,7 @@
         buftype = c_char * init
         buf = buftype()
         return buf
-    raise TypeError, init
+    raise TypeError(init)
 
 def c_buffer(init, size=None):
 ##    "deprecated, use create_string_buffer instead"
@@ -298,18 +298,16 @@
             buftype = c_wchar * init
             buf = buftype()
             return buf
-        raise TypeError, init
+        raise TypeError(init)
 
 POINTER(c_char).from_param = c_char_p.from_param #_SimpleCData.c_char_p_from_param
 
 # XXX Deprecated
 def SetPointerType(pointer, cls):
     if _pointer_type_cache.get(cls, None) is not None:
-        raise RuntimeError, \
-              "This type already exists in the cache"
-    if not _pointer_type_cache.has_key(id(pointer)):
-        raise RuntimeError, \
-              "What's this???"
+        raise RuntimeError("This type already exists in the cache")
+    if id(pointer) not in _pointer_type_cache:
+        raise RuntimeError("What's this???")
     pointer.set_type(cls)
     _pointer_type_cache[cls] = pointer
     del _pointer_type_cache[id(pointer)]
@@ -358,7 +356,7 @@
 
     def __getattr__(self, name):
         if name.startswith('__') and name.endswith('__'):
-            raise AttributeError, name
+            raise AttributeError(name)
         func = self.__getitem__(name)
         setattr(self, name, func)
         return func

Modified: python/branches/trunk-math/Lib/ctypes/macholib/dyld.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/macholib/dyld.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/macholib/dyld.py	Thu Feb 28 21:09:17 2008
@@ -135,7 +135,7 @@
             ), env):
         if os.path.isfile(path):
             return path
-    raise ValueError, "dylib %s could not be found" % (name,)
+    raise ValueError("dylib %s could not be found" % (name,))
 
 def framework_find(fn, executable_path=None, env=None):
     """

Modified: python/branches/trunk-math/Lib/ctypes/test/__init__.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/__init__.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/__init__.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,4 @@
-import glob, os, sys, unittest, getopt, time
+import os, sys, unittest, getopt, time
 
 use_resources = []
 

Modified: python/branches/trunk-math/Lib/ctypes/test/test_cfuncs.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_cfuncs.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_cfuncs.py	Thu Feb 28 21:09:17 2008
@@ -198,7 +198,7 @@
     class stdcall_dll(WinDLL):
         def __getattr__(self, name):
             if name[:2] == '__' and name[-2:] == '__':
-                raise AttributeError, name
+                raise AttributeError(name)
             func = self._FuncPtr(("s_" + name, self))
             setattr(self, name, func)
             return func

Modified: python/branches/trunk-math/Lib/ctypes/test/test_checkretval.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_checkretval.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_checkretval.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import unittest
-import sys
 
 from ctypes import *
 

Modified: python/branches/trunk-math/Lib/ctypes/test/test_find.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_find.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_find.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,5 @@
 import unittest
-import os, sys
+import sys
 from ctypes import *
 from ctypes.util import find_library
 from ctypes.test import is_resource_enabled

Modified: python/branches/trunk-math/Lib/ctypes/test/test_libc.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_libc.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_libc.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,3 @@
-import sys, os
 import unittest
 
 from ctypes import *

Modified: python/branches/trunk-math/Lib/ctypes/test/test_loading.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_loading.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_loading.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,6 @@
 from ctypes import *
 import sys, unittest
-import os, StringIO
+import os
 from ctypes.util import find_library
 from ctypes.test import is_resource_enabled
 

Modified: python/branches/trunk-math/Lib/ctypes/test/test_macholib.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_macholib.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_macholib.py	Thu Feb 28 21:09:17 2008
@@ -42,7 +42,7 @@
             return os.path.realpath(dyld_find(dylib))
         except ValueError:
             pass
-    raise ValueError, "%s not found" % (name,)
+    raise ValueError("%s not found" % (name,))
 
 class MachOTest(unittest.TestCase):
     if sys.platform == "darwin":

Modified: python/branches/trunk-math/Lib/ctypes/test/test_numbers.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_numbers.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_numbers.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,6 @@
 from ctypes import *
 import unittest
-import sys, struct
+import struct
 
 def valid_ranges(*types):
     # given a sequence of numeric types, collect their _type_

Modified: python/branches/trunk-math/Lib/ctypes/test/test_random_things.py
==============================================================================
--- python/branches/trunk-math/Lib/ctypes/test/test_random_things.py	(original)
+++ python/branches/trunk-math/Lib/ctypes/test/test_random_things.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,7 @@
 
 def callback_func(arg):
     42 / arg
-    raise ValueError, arg
+    raise ValueError(arg)
 
 if sys.platform == "win32":
 

Modified: python/branches/trunk-math/Lib/curses/__init__.py
==============================================================================
--- python/branches/trunk-math/Lib/curses/__init__.py	(original)
+++ python/branches/trunk-math/Lib/curses/__init__.py	Thu Feb 28 21:09:17 2008
@@ -14,6 +14,8 @@
 
 from _curses import *
 from curses.wrapper import wrapper
+import os as _os
+import sys as _sys
 
 # Some constants, most notably the ACS_* ones, are only added to the C
 # _curses module's dictionary after initscr() is called.  (Some
@@ -25,6 +27,10 @@
 
 def initscr():
     import _curses, curses
+    # we call setupterm() here because it raises an error
+    # instead of calling exit() in error cases.
+    setupterm(term=_os.environ.get("TERM", "unknown"),
+              fd=_sys.__stdout__.fileno())
     stdscr = _curses.initscr()
     for key, value in _curses.__dict__.items():
         if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):

Modified: python/branches/trunk-math/Lib/curses/wrapper.py
==============================================================================
--- python/branches/trunk-math/Lib/curses/wrapper.py	(original)
+++ python/branches/trunk-math/Lib/curses/wrapper.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,7 @@
 
 """
 
-import sys, curses
+import curses
 
 def wrapper(func, *args, **kwds):
     """Wrapper function that initializes curses and calls another function,

Modified: python/branches/trunk-math/Lib/decimal.py
==============================================================================
--- python/branches/trunk-math/Lib/decimal.py	(original)
+++ python/branches/trunk-math/Lib/decimal.py	Thu Feb 28 21:09:17 2008
@@ -5212,8 +5212,7 @@
 
 
 ##### crud for parsing strings #############################################
-import re
-
+#
 # Regular expression used for parsing numeric strings.  Additional
 # comments:
 #

Modified: python/branches/trunk-math/Lib/distutils/archive_util.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/archive_util.py	(original)
+++ python/branches/trunk-math/Lib/distutils/archive_util.py	Thu Feb 28 21:09:17 2008
@@ -124,7 +124,7 @@
 
 def check_archive_formats (formats):
     for format in formats:
-        if not ARCHIVE_FORMATS.has_key(format):
+        if format not in ARCHIVE_FORMATS:
             return format
     else:
         return None

Modified: python/branches/trunk-math/Lib/distutils/bcppcompiler.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/bcppcompiler.py	(original)
+++ python/branches/trunk-math/Lib/distutils/bcppcompiler.py	Thu Feb 28 21:09:17 2008
@@ -16,7 +16,7 @@
 __revision__ = "$Id$"
 
 
-import sys, os
+import os
 from distutils.errors import \
      DistutilsExecError, DistutilsPlatformError, \
      CompileError, LibError, LinkError, UnknownFileError

Modified: python/branches/trunk-math/Lib/distutils/ccompiler.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/ccompiler.py	(original)
+++ python/branches/trunk-math/Lib/distutils/ccompiler.py	Thu Feb 28 21:09:17 2008
@@ -159,7 +159,7 @@
         # basically the same things with Unix C compilers.
 
         for key in args.keys():
-            if not self.executables.has_key(key):
+            if key not in self.executables:
                 raise ValueError, \
                       "unknown executable '%s' for class %s" % \
                       (key, self.__class__.__name__)

Modified: python/branches/trunk-math/Lib/distutils/command/bdist.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/bdist.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/bdist.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,7 @@
 
 __revision__ = "$Id$"
 
-import os, string
+import os
 from types import *
 from distutils.core import Command
 from distutils.errors import *

Modified: python/branches/trunk-math/Lib/distutils/command/bdist_dumb.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/bdist_dumb.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/bdist_dumb.py	Thu Feb 28 21:09:17 2008
@@ -11,7 +11,7 @@
 import os
 from distutils.core import Command
 from distutils.util import get_platform
-from distutils.dir_util import create_tree, remove_tree, ensure_relative
+from distutils.dir_util import remove_tree, ensure_relative
 from distutils.errors import *
 from distutils.sysconfig import get_python_version
 from distutils import log

Modified: python/branches/trunk-math/Lib/distutils/command/bdist_msi.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/bdist_msi.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/bdist_msi.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,7 @@
 Implements the bdist_msi command.
 """
 
-import sys, os, string
+import sys, os
 from distutils.core import Command
 from distutils.util import get_platform
 from distutils.dir_util import remove_tree

Modified: python/branches/trunk-math/Lib/distutils/command/bdist_rpm.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/bdist_rpm.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/bdist_rpm.py	Thu Feb 28 21:09:17 2008
@@ -8,7 +8,6 @@
 __revision__ = "$Id$"
 
 import sys, os, string
-import glob
 from types import *
 from distutils.core import Command
 from distutils.debug import DEBUG

Modified: python/branches/trunk-math/Lib/distutils/command/build_ext.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/build_ext.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/build_ext.py	Thu Feb 28 21:09:17 2008
@@ -362,7 +362,7 @@
 
             # Medium-easy stuff: same syntax/semantics, different names.
             ext.runtime_library_dirs = build_info.get('rpath')
-            if build_info.has_key('def_file'):
+            if 'def_file' in build_info:
                 log.warn("'def_file' element of build info dict "
                          "no longer supported")
 

Modified: python/branches/trunk-math/Lib/distutils/command/build_py.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/build_py.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/build_py.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 
 __revision__ = "$Id$"
 
-import sys, string, os
+import string, os
 from types import *
 from glob import glob
 

Modified: python/branches/trunk-math/Lib/distutils/command/build_scripts.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/build_scripts.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/build_scripts.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 
 __revision__ = "$Id$"
 
-import sys, os, re
+import os, re
 from stat import ST_MODE
 from distutils import sysconfig
 from distutils.core import Command

Modified: python/branches/trunk-math/Lib/distutils/command/install.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/install.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/install.py	Thu Feb 28 21:09:17 2008
@@ -17,7 +17,6 @@
 from distutils.file_util import write_file
 from distutils.util import convert_path, subst_vars, change_root
 from distutils.errors import DistutilsOptionError
-from glob import glob
 
 if sys.version < "2.2":
     WINDOWS_SCHEME = {
@@ -352,7 +351,7 @@
                 opt_name = opt[0]
                 if opt_name[-1] == "=":
                     opt_name = opt_name[0:-1]
-                if self.negative_opt.has_key(opt_name):
+                if opt_name in self.negative_opt:
                     opt_name = string.translate(self.negative_opt[opt_name],
                                                 longopt_xlate)
                     val = not getattr(self, opt_name)

Modified: python/branches/trunk-math/Lib/distutils/command/install_headers.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/install_headers.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/install_headers.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,6 @@
 
 __revision__ = "$Id$"
 
-import os
 from distutils.core import Command
 
 

Modified: python/branches/trunk-math/Lib/distutils/command/install_lib.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/install_lib.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/install_lib.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,7 @@
 
 __revision__ = "$Id$"
 
-import sys, os, string
+import os
 from types import IntType
 from distutils.core import Command
 from distutils.errors import DistutilsOptionError

Modified: python/branches/trunk-math/Lib/distutils/command/register.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/register.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/register.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,7 @@
 
 __revision__ = "$Id$"
 
-import sys, os, string, urllib2, getpass, urlparse
+import os, string, urllib2, getpass, urlparse
 import StringIO, ConfigParser
 
 from distutils.core import Command
@@ -120,7 +120,7 @@
         # see if we can short-cut and get the username/password from the
         # config
         config = None
-        if os.environ.has_key('HOME'):
+        if 'HOME' in os.environ:
             rc = os.path.join(os.environ['HOME'], '.pypirc')
             if os.path.exists(rc):
                 print 'Using PyPI login from %s'%rc
@@ -163,7 +163,7 @@
             print 'Server response (%s): %s'%(code, result)
 
             # possibly save the login
-            if os.environ.has_key('HOME') and config is None and code == 200:
+            if 'HOME' in os.environ and config is None and code == 200:
                 rc = os.path.join(os.environ['HOME'], '.pypirc')
                 print 'I can store your PyPI login so future submissions will be faster.'
                 print '(the login will be stored in %s)'%rc

Modified: python/branches/trunk-math/Lib/distutils/command/sdist.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/sdist.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/sdist.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 
 __revision__ = "$Id$"
 
-import sys, os, string
+import os, string
 from types import *
 from glob import glob
 from distutils.core import Command
@@ -383,6 +383,7 @@
             if line[-1] == '\n':
                 line = line[0:-1]
             self.filelist.append(line)
+        manifest.close()
 
     # read_manifest ()
 

Modified: python/branches/trunk-math/Lib/distutils/command/upload.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/command/upload.py	(original)
+++ python/branches/trunk-math/Lib/distutils/command/upload.py	Thu Feb 28 21:09:17 2008
@@ -46,7 +46,7 @@
             raise DistutilsOptionError(
                 "Must use --sign for --identity to have meaning"
             )
-        if os.environ.has_key('HOME'):
+        if 'HOME' in os.environ:
             rc = os.path.join(os.environ['HOME'], '.pypirc')
             if os.path.exists(rc):
                 self.announce('Using PyPI login from %s' % rc)

Modified: python/branches/trunk-math/Lib/distutils/core.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/core.py	(original)
+++ python/branches/trunk-math/Lib/distutils/core.py	Thu Feb 28 21:09:17 2008
@@ -101,9 +101,9 @@
     else:
         klass = Distribution
 
-    if not attrs.has_key('script_name'):
+    if 'script_name' not in attrs:
         attrs['script_name'] = os.path.basename(sys.argv[0])
-    if not attrs.has_key('script_args'):
+    if 'script_args' not in attrs:
         attrs['script_args'] = sys.argv[1:]
 
     # Create the Distribution instance, using the remaining arguments
@@ -111,7 +111,7 @@
     try:
         _setup_distribution = dist = klass(attrs)
     except DistutilsSetupError, msg:
-        if attrs.has_key('name'):
+        if 'name' in attrs:
             raise SystemExit, "error in %s setup command: %s" % \
                   (attrs['name'], msg)
         else:

Modified: python/branches/trunk-math/Lib/distutils/dir_util.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/dir_util.py	(original)
+++ python/branches/trunk-math/Lib/distutils/dir_util.py	Thu Feb 28 21:09:17 2008
@@ -207,7 +207,7 @@
             apply(cmd[0], (cmd[1],))
             # remove dir from cache if it's already there
             abspath = os.path.abspath(cmd[1])
-            if _path_created.has_key(abspath):
+            if abspath in _path_created:
                 del _path_created[abspath]
         except (IOError, OSError), exc:
             log.warn(grok_environment_error(

Modified: python/branches/trunk-math/Lib/distutils/dist.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/dist.py	(original)
+++ python/branches/trunk-math/Lib/distutils/dist.py	Thu Feb 28 21:09:17 2008
@@ -239,7 +239,7 @@
                     for (opt, val) in cmd_options.items():
                         opt_dict[opt] = ("setup script", val)
 
-            if attrs.has_key('licence'):
+            if 'licence' in attrs:
                 attrs['license'] = attrs['licence']
                 del attrs['licence']
                 msg = "'licence' distribution option is deprecated; use 'license'"
@@ -343,7 +343,7 @@
             user_filename = "pydistutils.cfg"
 
         # And look for the user config file
-        if os.environ.has_key('HOME'):
+        if 'HOME' in os.environ:
             user_file = os.path.join(os.environ.get('HOME'), user_filename)
             if os.path.isfile(user_file):
                 files.append(user_file)
@@ -388,7 +388,7 @@
         # If there was a "global" section in the config file, use it
         # to set Distribution options.
 
-        if self.command_options.has_key('global'):
+        if 'global' in self.command_options:
             for (opt, (src, val)) in self.command_options['global'].items():
                 alias = self.negative_opt.get(opt)
                 try:
@@ -907,7 +907,7 @@
 
             try:
                 is_string = type(value) is StringType
-                if neg_opt.has_key(option) and is_string:
+                if option in neg_opt and is_string:
                     setattr(command_obj, neg_opt[option], not strtobool(value))
                 elif option in bool_opts and is_string:
                     setattr(command_obj, option, strtobool(value))

Modified: python/branches/trunk-math/Lib/distutils/fancy_getopt.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/fancy_getopt.py	(original)
+++ python/branches/trunk-math/Lib/distutils/fancy_getopt.py	Thu Feb 28 21:09:17 2008
@@ -97,7 +97,7 @@
         self._build_index()
 
     def add_option (self, long_option, short_option=None, help_string=None):
-        if self.option_index.has_key(long_option):
+        if long_option in self.option_index:
             raise DistutilsGetoptError, \
                   "option conflict: already an option '%s'" % long_option
         else:
@@ -109,7 +109,7 @@
     def has_option (self, long_option):
         """Return true if the option table for this parser has an
         option with long name 'long_option'."""
-        return self.option_index.has_key(long_option)
+        return long_option in self.option_index
 
     def get_attr_name (self, long_option):
         """Translate long option name 'long_option' to the form it
@@ -121,11 +121,11 @@
     def _check_alias_dict (self, aliases, what):
         assert type(aliases) is DictionaryType
         for (alias, opt) in aliases.items():
-            if not self.option_index.has_key(alias):
+            if alias not in self.option_index:
                 raise DistutilsGetoptError, \
                       ("invalid %s '%s': "
                        "option '%s' not defined") % (what, alias, alias)
-            if not self.option_index.has_key(opt):
+            if opt not in self.option_index:
                 raise DistutilsGetoptError, \
                       ("invalid %s '%s': "
                        "aliased option '%s' not defined") % (what, alias, opt)

Modified: python/branches/trunk-math/Lib/distutils/filelist.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/filelist.py	(original)
+++ python/branches/trunk-math/Lib/distutils/filelist.py	Thu Feb 28 21:09:17 2008
@@ -11,7 +11,6 @@
 import os, string, re
 import fnmatch
 from types import *
-from glob import glob
 from distutils.util import convert_path
 from distutils.errors import DistutilsTemplateError, DistutilsInternalError
 from distutils import log

Modified: python/branches/trunk-math/Lib/distutils/msvccompiler.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/msvccompiler.py	(original)
+++ python/branches/trunk-math/Lib/distutils/msvccompiler.py	Thu Feb 28 21:09:17 2008
@@ -252,7 +252,7 @@
 
     def initialize(self):
         self.__paths = []
-        if os.environ.has_key("DISTUTILS_USE_SDK") and os.environ.has_key("MSSdk") and self.find_exe("cl.exe"):
+        if "DISTUTILS_USE_SDK" in os.environ and "MSSdk" in os.environ and self.find_exe("cl.exe"):
             # Assume that the SDK set up everything alright; don't try to be
             # smarter
             self.cc = "cl.exe"

Modified: python/branches/trunk-math/Lib/distutils/sysconfig.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/sysconfig.py	(original)
+++ python/branches/trunk-math/Lib/distutils/sysconfig.py	Thu Feb 28 21:09:17 2008
@@ -161,22 +161,22 @@
             get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
                             'CCSHARED', 'LDSHARED', 'SO')
 
-        if os.environ.has_key('CC'):
+        if 'CC' in os.environ:
             cc = os.environ['CC']
-        if os.environ.has_key('CXX'):
+        if 'CXX' in os.environ:
             cxx = os.environ['CXX']
-        if os.environ.has_key('LDSHARED'):
+        if 'LDSHARED' in os.environ:
             ldshared = os.environ['LDSHARED']
-        if os.environ.has_key('CPP'):
+        if 'CPP' in os.environ:
             cpp = os.environ['CPP']
         else:
             cpp = cc + " -E"           # not always
-        if os.environ.has_key('LDFLAGS'):
+        if 'LDFLAGS' in os.environ:
             ldshared = ldshared + ' ' + os.environ['LDFLAGS']
-        if os.environ.has_key('CFLAGS'):
+        if 'CFLAGS' in os.environ:
             cflags = opt + ' ' + os.environ['CFLAGS']
             ldshared = ldshared + ' ' + os.environ['CFLAGS']
-        if os.environ.has_key('CPPFLAGS'):
+        if 'CPPFLAGS' in os.environ:
             cpp = cpp + ' ' + os.environ['CPPFLAGS']
             cflags = cflags + ' ' + os.environ['CPPFLAGS']
             ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
@@ -291,12 +291,12 @@
             if m:
                 n = m.group(1)
                 found = True
-                if done.has_key(n):
+                if n in done:
                     item = str(done[n])
-                elif notdone.has_key(n):
+                elif n in notdone:
                     # get it on a subsequent round
                     found = False
-                elif os.environ.has_key(n):
+                elif n in os.environ:
                     # do it like make: fall back to environment
                     item = os.environ[n]
                 else:
@@ -380,7 +380,7 @@
     # MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
     # it needs to be compatible.
     # If it isn't set we set it to the configure-time value
-    if sys.platform == 'darwin' and g.has_key('MACOSX_DEPLOYMENT_TARGET'):
+    if sys.platform == 'darwin' and 'MACOSX_DEPLOYMENT_TARGET' in g:
         cfg_target = g['MACOSX_DEPLOYMENT_TARGET']
         cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
         if cur_target == '':

Modified: python/branches/trunk-math/Lib/distutils/tests/test_dist.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/tests/test_dist.py	(original)
+++ python/branches/trunk-math/Lib/distutils/tests/test_dist.py	Thu Feb 28 21:09:17 2008
@@ -3,10 +3,8 @@
 import distutils.cmd
 import distutils.dist
 import os
-import shutil
 import StringIO
 import sys
-import tempfile
 import unittest
 
 from test.test_support import TESTFN

Modified: python/branches/trunk-math/Lib/distutils/tests/test_sysconfig.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/tests/test_sysconfig.py	(original)
+++ python/branches/trunk-math/Lib/distutils/tests/test_sysconfig.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 
 from distutils import sysconfig
 import os
-import sys
 import unittest
 
 from test.test_support import TESTFN

Modified: python/branches/trunk-math/Lib/distutils/text_file.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/text_file.py	(original)
+++ python/branches/trunk-math/Lib/distutils/text_file.py	Thu Feb 28 21:09:17 2008
@@ -89,7 +89,7 @@
         # set values for all options -- either from client option hash
         # or fallback to default_options
         for opt in self.default_options.keys():
-            if options.has_key (opt):
+            if opt in options:
                 setattr (self, opt, options[opt])
 
             else:
@@ -97,7 +97,7 @@
 
         # sanity check client option hash
         for opt in options.keys():
-            if not self.default_options.has_key (opt):
+            if opt not in self.default_options:
                 raise KeyError, "invalid TextFile option '%s'" % opt
 
         if file is None:

Modified: python/branches/trunk-math/Lib/distutils/unixccompiler.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/unixccompiler.py	(original)
+++ python/branches/trunk-math/Lib/distutils/unixccompiler.py	Thu Feb 28 21:09:17 2008
@@ -17,7 +17,6 @@
 
 import os, sys
 from types import StringType, NoneType
-from copy import copy
 
 from distutils import sysconfig
 from distutils.dep_util import newer

Modified: python/branches/trunk-math/Lib/distutils/util.py
==============================================================================
--- python/branches/trunk-math/Lib/distutils/util.py	(original)
+++ python/branches/trunk-math/Lib/distutils/util.py	Thu Feb 28 21:09:17 2008
@@ -219,11 +219,11 @@
     if _environ_checked:
         return
 
-    if os.name == 'posix' and not os.environ.has_key('HOME'):
+    if os.name == 'posix' and 'HOME' not in os.environ:
         import pwd
         os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
 
-    if not os.environ.has_key('PLAT'):
+    if 'PLAT' not in os.environ:
         os.environ['PLAT'] = get_platform()
 
     _environ_checked = 1
@@ -241,7 +241,7 @@
     check_environ()
     def _subst (match, local_vars=local_vars):
         var_name = match.group(1)
-        if local_vars.has_key(var_name):
+        if var_name in local_vars:
             return str(local_vars[var_name])
         else:
             return os.environ[var_name]

Modified: python/branches/trunk-math/Lib/email/base64mime.py
==============================================================================
--- python/branches/trunk-math/Lib/email/base64mime.py	(original)
+++ python/branches/trunk-math/Lib/email/base64mime.py	Thu Feb 28 21:09:17 2008
@@ -35,7 +35,6 @@
     'header_encode',
     ]
 
-import re
 
 from binascii import b2a_base64, a2b_base64
 from email.utils import fix_eols

Modified: python/branches/trunk-math/Lib/email/utils.py
==============================================================================
--- python/branches/trunk-math/Lib/email/utils.py	(original)
+++ python/branches/trunk-math/Lib/email/utils.py	Thu Feb 28 21:09:17 2008
@@ -27,7 +27,6 @@
 import socket
 import urllib
 import warnings
-from cStringIO import StringIO
 
 from email._parseaddr import quote
 from email._parseaddr import AddressList as _AddressList

Modified: python/branches/trunk-math/Lib/hotshot/log.py
==============================================================================
--- python/branches/trunk-math/Lib/hotshot/log.py	(original)
+++ python/branches/trunk-math/Lib/hotshot/log.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 import os.path
 import parser
 import symbol
-import sys
 
 from _hotshot import \
      WHAT_ENTER, \

Modified: python/branches/trunk-math/Lib/hotshot/stones.py
==============================================================================
--- python/branches/trunk-math/Lib/hotshot/stones.py	(original)
+++ python/branches/trunk-math/Lib/hotshot/stones.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 import errno
 import hotshot
 import hotshot.stats
-import os
 import sys
 import test.pystone
 

Modified: python/branches/trunk-math/Lib/httplib.py
==============================================================================
--- python/branches/trunk-math/Lib/httplib.py	(original)
+++ python/branches/trunk-math/Lib/httplib.py	Thu Feb 28 21:09:17 2008
@@ -66,7 +66,6 @@
 Req-sent-unread-response       _CS_REQ_SENT       <response_class>
 """
 
-import errno
 import mimetools
 import socket
 from urlparse import urlsplit
@@ -439,6 +438,9 @@
                 self.length = int(length)
             except ValueError:
                 self.length = None
+            else:
+                if self.length < 0:  # ignore nonsensical negative lengths
+                    self.length = None
         else:
             self.length = None
 
@@ -547,7 +549,13 @@
                 i = line.find(';')
                 if i >= 0:
                     line = line[:i] # strip chunk-extensions
-                chunk_left = int(line, 16)
+                try:
+                    chunk_left = int(line, 16)
+                except ValueError:
+                    # close the connection as protocol synchronisation is
+                    # probably lost
+                    self.close()
+                    raise IncompleteRead(value)
                 if chunk_left == 0:
                     break
             if amt is None:

Modified: python/branches/trunk-math/Lib/idlelib/MultiCall.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/MultiCall.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/MultiCall.py	Thu Feb 28 21:09:17 2008
@@ -30,7 +30,6 @@
 """
 
 import sys
-import os
 import string
 import re
 import Tkinter

Modified: python/branches/trunk-math/Lib/idlelib/RemoteDebugger.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/RemoteDebugger.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/RemoteDebugger.py	Thu Feb 28 21:09:17 2008
@@ -20,7 +20,6 @@
 
 """
 
-import sys
 import types
 import rpc
 import Debugger

Modified: python/branches/trunk-math/Lib/idlelib/TreeWidget.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/TreeWidget.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/TreeWidget.py	Thu Feb 28 21:09:17 2008
@@ -15,7 +15,6 @@
 # - optimize tree redraw after expand of subnode
 
 import os
-import sys
 from Tkinter import *
 import imp
 

Modified: python/branches/trunk-math/Lib/idlelib/UndoDelegator.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/UndoDelegator.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/UndoDelegator.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,3 @@
-import sys
 import string
 from Tkinter import *
 from Delegator import Delegator

Modified: python/branches/trunk-math/Lib/idlelib/configDialog.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/configDialog.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/configDialog.py	Thu Feb 28 21:09:17 2008
@@ -11,7 +11,7 @@
 """
 from Tkinter import *
 import tkMessageBox, tkColorChooser, tkFont
-import string, copy
+import string
 
 from configHandler import idleConf
 from dynOptionMenuWidget import DynOptionMenu

Modified: python/branches/trunk-math/Lib/idlelib/keybindingDialog.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/keybindingDialog.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/keybindingDialog.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,7 @@
 """
 from Tkinter import *
 import tkMessageBox
-import string, os
+import string
 
 class GetKeysDialog(Toplevel):
     def __init__(self,parent,title,action,currentKeySequences):

Modified: python/branches/trunk-math/Lib/idlelib/run.py
==============================================================================
--- python/branches/trunk-math/Lib/idlelib/run.py	(original)
+++ python/branches/trunk-math/Lib/idlelib/run.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import sys
-import os
 import linecache
 import time
 import socket

Modified: python/branches/trunk-math/Lib/imaplib.py
==============================================================================
--- python/branches/trunk-math/Lib/imaplib.py	(original)
+++ python/branches/trunk-math/Lib/imaplib.py	Thu Feb 28 21:09:17 2008
@@ -1156,7 +1156,7 @@
             chunks = []
             read = 0
             while read < size:
-                data = self.sslobj.read(size-read)
+                data = self.sslobj.read(min(size-read, 16384))
                 read += len(data)
                 chunks.append(data)
 

Modified: python/branches/trunk-math/Lib/inspect.py
==============================================================================
--- python/branches/trunk-math/Lib/inspect.py	(original)
+++ python/branches/trunk-math/Lib/inspect.py	Thu Feb 28 21:09:17 2008
@@ -7,8 +7,9 @@
 
 Here are some of the useful functions provided by this module:
 
-    ismodule(), isclass(), ismethod(), isfunction(), istraceback(),
-        isframe(), iscode(), isbuiltin(), isroutine() - check object types
+    ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
+        isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
+        isroutine() - check object types
     getmembers() - get members of an object that satisfy a given condition
 
     getfile(), getsourcefile(), getsource() - find an object's source code
@@ -28,9 +29,19 @@
 __author__ = 'Ka-Ping Yee <ping at lfw.org>'
 __date__ = '1 Jan 2001'
 
-import sys, os, types, string, re, dis, imp, tokenize, linecache
+import sys
+import os
+import types
+import string
+import re
+import dis
+import imp
+import tokenize
+import linecache
 from operator import attrgetter
 from collections import namedtuple
+from compiler.consts import (CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS,
+    CO_VARKEYWORDS, CO_GENERATOR)
 
 # ----------------------------------------------------------- type-checking
 def ismodule(object):
@@ -137,6 +148,33 @@
         func_name       (same as __name__)"""
     return isinstance(object, types.FunctionType)
 
+def isgeneratorfunction(object):
+    """Return true if the object is a user-defined generator function.
+
+    Generator function objects provides same attributes as functions.
+
+    See isfunction.__doc__ for attributes listing."""
+    if (isfunction(object) or ismethod(object)) and \
+        object.func_code.co_flags & CO_GENERATOR:
+        return True
+
+def isgenerator(object):
+    """Return true if the object is a generator.
+
+    Generator objects provide these attributes:
+        __iter__        defined to support interation over container
+        close           raises a new GeneratorExit exception inside the
+                        generator to terminate the iteration
+        gi_code         code object
+        gi_frame        frame object or possibly None once the generator has
+                        been exhausted
+        gi_running      set to 1 when generator is executing, 0 otherwise
+        next            return the next item from the container
+        send            resumes the generator and "sends" a value that becomes
+                        the result of the current yield-expression
+        throw           used to raise an exception inside the generator"""
+    return isinstance(object, types.GeneratorType)
+
 def istraceback(object):
     """Return true if the object is a traceback.
 
@@ -199,6 +237,10 @@
             or ismethod(object)
             or ismethoddescriptor(object))
 
+def isgenerator(object):
+    """Return true if the object is a generator object."""
+    return isinstance(object, types.GeneratorType)
+
 def getmembers(object, predicate=None):
     """Return all members of an object as (name, value) pairs sorted by name.
     Optionally, only return members that satisfy a given predicate."""
@@ -671,9 +713,6 @@
     return walktree(roots, children, None)
 
 # ------------------------------------------------ argument list extraction
-# These constants are from Python's compile.h.
-CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS = 1, 2, 4, 8
-
 Arguments = namedtuple('Arguments', 'args varargs keywords')
 
 def getargs(co):

Modified: python/branches/trunk-math/Lib/lib-tk/tkSimpleDialog.py
==============================================================================
--- python/branches/trunk-math/Lib/lib-tk/tkSimpleDialog.py	(original)
+++ python/branches/trunk-math/Lib/lib-tk/tkSimpleDialog.py	Thu Feb 28 21:09:17 2008
@@ -26,7 +26,6 @@
 '''
 
 from Tkinter import *
-import os
 
 class Dialog(Toplevel):
 

Modified: python/branches/trunk-math/Lib/logging/handlers.py
==============================================================================
--- python/branches/trunk-math/Lib/logging/handlers.py	(original)
+++ python/branches/trunk-math/Lib/logging/handlers.py	Thu Feb 28 21:09:17 2008
@@ -27,7 +27,7 @@
 To use, simply 'import logging' and log away!
 """
 
-import sys, logging, socket, types, os, string, cPickle, struct, time, glob
+import logging, socket, types, os, string, cPickle, struct, time, glob
 from stat import ST_DEV, ST_INO
 
 try:

Modified: python/branches/trunk-math/Lib/ntpath.py
==============================================================================
--- python/branches/trunk-math/Lib/ntpath.py	(original)
+++ python/branches/trunk-math/Lib/ntpath.py	Thu Feb 28 21:09:17 2008
@@ -6,8 +6,8 @@
 """
 
 import os
-import stat
 import sys
+import stat
 import genericpath
 from genericpath import *
 

Modified: python/branches/trunk-math/Lib/plat-mac/MiniAEFrame.py
==============================================================================
--- python/branches/trunk-math/Lib/plat-mac/MiniAEFrame.py	(original)
+++ python/branches/trunk-math/Lib/plat-mac/MiniAEFrame.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,6 @@
         only suitable for the simplest of AppleEvent servers.
 """
 
-import sys
 import traceback
 import MacOS
 from Carbon import AE

Modified: python/branches/trunk-math/Lib/plat-mac/aepack.py
==============================================================================
--- python/branches/trunk-math/Lib/plat-mac/aepack.py	(original)
+++ python/branches/trunk-math/Lib/plat-mac/aepack.py	Thu Feb 28 21:09:17 2008
@@ -13,18 +13,14 @@
 #
 
 import struct
-import string
 import types
-from string import strip
 from types import *
 from Carbon import AE
 from Carbon.AppleEvents import *
 import MacOS
 import Carbon.File
-import StringIO
 import aetypes
 from aetypes import mkenum, ObjectSpecifier
-import os
 
 # These ones seem to be missing from AppleEvents
 # (they're in AERegistry.h)

Modified: python/branches/trunk-math/Lib/plat-mac/bgenlocations.py
==============================================================================
--- python/branches/trunk-math/Lib/plat-mac/bgenlocations.py	(original)
+++ python/branches/trunk-math/Lib/plat-mac/bgenlocations.py	Thu Feb 28 21:09:17 2008
@@ -5,7 +5,7 @@
 # but mac-style for MacPython, whether running on OS9 or OSX.
 #
 
-import sys, os
+import os
 
 Error = "bgenlocations.Error"
 #

Modified: python/branches/trunk-math/Lib/plat-mac/macostools.py
==============================================================================
--- python/branches/trunk-math/Lib/plat-mac/macostools.py	(original)
+++ python/branches/trunk-math/Lib/plat-mac/macostools.py	Thu Feb 28 21:09:17 2008
@@ -7,9 +7,7 @@
 from Carbon import Res
 from Carbon import File, Files
 import os
-import sys
 import MacOS
-import time
 try:
     openrf = MacOS.openrf
 except AttributeError:

Modified: python/branches/trunk-math/Lib/plat-riscos/rourl2path.py
==============================================================================
--- python/branches/trunk-math/Lib/plat-riscos/rourl2path.py	(original)
+++ python/branches/trunk-math/Lib/plat-riscos/rourl2path.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,6 @@
 
 import string
 import urllib
-import os
 
 __all__ = ["url2pathname","pathname2url"]
 

Modified: python/branches/trunk-math/Lib/popen2.py
==============================================================================
--- python/branches/trunk-math/Lib/popen2.py	(original)
+++ python/branches/trunk-math/Lib/popen2.py	Thu Feb 28 21:09:17 2008
@@ -82,11 +82,7 @@
     def _run_child(self, cmd):
         if isinstance(cmd, basestring):
             cmd = ['/bin/sh', '-c', cmd]
-        for i in xrange(3, MAXFD):
-            try:
-                os.close(i)
-            except OSError:
-                pass
+        os.closerange(3, MAXFD)
         try:
             os.execvp(cmd[0], cmd)
         finally:

Modified: python/branches/trunk-math/Lib/pydoc.py
==============================================================================
--- python/branches/trunk-math/Lib/pydoc.py	(original)
+++ python/branches/trunk-math/Lib/pydoc.py	Thu Feb 28 21:09:17 2008
@@ -664,7 +664,7 @@
             contents = self.multicolumn(
                 modules, lambda (key, value), s=self: s.modulelink(value))
             result = result + self.bigsection(
-                'Modules', '#fffff', '#aa55cc', contents)
+                'Modules', '#ffffff', '#aa55cc', contents)
 
         if classes:
             classlist = map(lambda (key, value): value, classes)

Modified: python/branches/trunk-math/Lib/runpy.py
==============================================================================
--- python/branches/trunk-math/Lib/runpy.py	(original)
+++ python/branches/trunk-math/Lib/runpy.py	Thu Feb 28 21:09:17 2008
@@ -89,6 +89,9 @@
 
 
 # XXX ncoghlan: Should this be documented and made public?
+# (Current thoughts: don't repeat the mistake that lead to its
+# creation when run_module() no longer met the needs of
+# mainmodule.c, but couldn't be changed because it was public)
 def _run_module_as_main(mod_name, set_argv0=True):
     """Runs the designated module in the __main__ namespace
 
@@ -96,7 +99,20 @@
            __file__
            __loader__
     """
-    loader, code, fname = _get_module_details(mod_name)
+    try:
+        loader, code, fname = _get_module_details(mod_name)
+    except ImportError as exc:
+        # Try to provide a good error message
+        # for directories, zip files and the -m switch
+        if set_argv0:
+            # For -m switch, just disply the exception
+            info = str(exc)
+        else:
+            # For directories/zipfiles, let the user
+            # know what the code was looking for
+            info = "can't find '__main__.py' in %r" % sys.argv[0]
+        msg = "%s: %s" % (sys.executable, info)
+        sys.exit(msg)
     pkg_name = mod_name.rpartition('.')[0]
     main_globals = sys.modules["__main__"].__dict__
     if set_argv0:

Modified: python/branches/trunk-math/Lib/smtplib.py
==============================================================================
--- python/branches/trunk-math/Lib/smtplib.py	(original)
+++ python/branches/trunk-math/Lib/smtplib.py	Thu Feb 28 21:09:17 2008
@@ -298,7 +298,7 @@
     def send(self, str):
         """Send `str' to the server."""
         if self.debuglevel > 0: print>>stderr, 'send:', repr(str)
-        if self.sock:
+        if hasattr(self, 'sock') and self.sock:
             try:
                 self.sock.sendall(str)
             except socket.error:
@@ -486,7 +486,7 @@
     vrfy=verify
 
     def expn(self, address):
-        """SMTP 'verify' command -- checks for address validity."""
+        """SMTP 'expn' command -- expands a mailing list."""
         self.putcmd("expn", quoteaddr(address))
         return self.getreply()
 

Modified: python/branches/trunk-math/Lib/socket.py
==============================================================================
--- python/branches/trunk-math/Lib/socket.py	(original)
+++ python/branches/trunk-math/Lib/socket.py	Thu Feb 28 21:09:17 2008
@@ -328,7 +328,7 @@
             self._rbuf = ""
             while True:
                 left = size - buf_len
-                recv_size = max(self._rbufsize, left)
+                recv_size = min(self._rbufsize, left)
                 data = self._sock.recv(recv_size)
                 if not data:
                     break

Modified: python/branches/trunk-math/Lib/sqlite3/test/hooks.py
==============================================================================
--- python/branches/trunk-math/Lib/sqlite3/test/hooks.py	(original)
+++ python/branches/trunk-math/Lib/sqlite3/test/hooks.py	Thu Feb 28 21:09:17 2008
@@ -21,7 +21,7 @@
 #    misrepresented as being the original software.
 # 3. This notice may not be removed or altered from any source distribution.
 
-import os, unittest
+import unittest
 import sqlite3 as sqlite
 
 class CollationTests(unittest.TestCase):

Modified: python/branches/trunk-math/Lib/ssl.py
==============================================================================
--- python/branches/trunk-math/Lib/ssl.py	(original)
+++ python/branches/trunk-math/Lib/ssl.py	Thu Feb 28 21:09:17 2008
@@ -55,7 +55,7 @@
 PROTOCOL_TLSv1
 """
 
-import os, sys, textwrap
+import textwrap
 
 import _ssl             # if we can't import it, let the error propagate
 

Modified: python/branches/trunk-math/Lib/string.py
==============================================================================
--- python/branches/trunk-math/Lib/string.py	(original)
+++ python/branches/trunk-math/Lib/string.py	Thu Feb 28 21:09:17 2008
@@ -527,3 +527,115 @@
     letters = lowercase + uppercase
 except ImportError:
     pass                                          # Use the original versions
+
+########################################################################
+# the Formatter class
+# see PEP 3101 for details and purpose of this class
+
+# The hard parts are reused from the C implementation.  They're
+# exposed here via the sys module.  sys was chosen because it's always
+# available and doesn't have to be dynamically loaded.
+
+# The overall parser is implemented in str._formatter_parser.
+# The field name parser is implemented in str._formatter_field_name_split
+
+class Formatter(object):
+    def format(self, format_string, *args, **kwargs):
+        return self.vformat(format_string, args, kwargs)
+
+    def vformat(self, format_string, args, kwargs):
+        used_args = set()
+        result = self._vformat(format_string, args, kwargs, used_args, 2)
+        self.check_unused_args(used_args, args, kwargs)
+        return result
+
+    def _vformat(self, format_string, args, kwargs, used_args, recursion_depth):
+        if recursion_depth < 0:
+            raise ValueError('Max string recursion exceeded')
+        result = []
+        for literal_text, field_name, format_spec, conversion in \
+                self.parse(format_string):
+
+            # output the literal text
+            if literal_text:
+                result.append(literal_text)
+
+            # if there's a field, output it
+            if field_name is not None:
+                # this is some markup, find the object and do
+                #  the formatting
+
+                # given the field_name, find the object it references
+                #  and the argument it came from
+                obj, arg_used = self.get_field(field_name, args, kwargs)
+                used_args.add(arg_used)
+
+                # do any conversion on the resulting object
+                obj = self.convert_field(obj, conversion)
+
+                # expand the format spec, if needed
+                format_spec = self._vformat(format_spec, args, kwargs,
+                                            used_args, recursion_depth-1)
+
+                # format the object and append to the result
+                result.append(self.format_field(obj, format_spec))
+
+        return ''.join(result)
+
+
+    def get_value(self, key, args, kwargs):
+        if isinstance(key, (int, long)):
+            return args[key]
+        else:
+            return kwargs[key]
+
+
+    def check_unused_args(self, used_args, args, kwargs):
+        pass
+
+
+    def format_field(self, value, format_spec):
+        return format(value, format_spec)
+
+
+    def convert_field(self, value, conversion):
+        # do any conversion on the resulting object
+        if conversion == 'r':
+            return repr(value)
+        elif conversion == 's':
+            return str(value)
+        elif conversion is None:
+            return value
+        raise ValueError("Unknown converion specifier {0!s}".format(conversion))
+
+
+    # returns an iterable that contains tuples of the form:
+    # (literal_text, field_name, format_spec, conversion)
+    # literal_text can be zero length
+    # field_name can be None, in which case there's no
+    #  object to format and output
+    # if field_name is not None, it is looked up, formatted
+    #  with format_spec and conversion and then used
+    def parse(self, format_string):
+        return format_string._formatter_parser()
+
+
+    # given a field_name, find the object it references.
+    #  field_name:   the field being looked up, e.g. "0.name"
+    #                 or "lookup[3]"
+    #  used_args:    a set of which args have been used
+    #  args, kwargs: as passed in to vformat
+    def get_field(self, field_name, args, kwargs):
+        first, rest = field_name._formatter_field_name_split()
+
+        obj = self.get_value(first, args, kwargs)
+
+        # loop through the rest of the field_name, doing
+        #  getattr or getitem as needed
+        for is_attr, i in rest:
+            if is_attr:
+                obj = getattr(obj, i)
+            else:
+                obj = obj[i]
+
+        return obj, first

Modified: python/branches/trunk-math/Lib/symbol.py
==============================================================================
--- python/branches/trunk-math/Lib/symbol.py	(original)
+++ python/branches/trunk-math/Lib/symbol.py	Thu Feb 28 21:09:17 2008
@@ -15,85 +15,86 @@
 eval_input = 258
 decorator = 259
 decorators = 260
-funcdef = 261
-parameters = 262
-varargslist = 263
-fpdef = 264
-fplist = 265
-stmt = 266
-simple_stmt = 267
-small_stmt = 268
-expr_stmt = 269
-augassign = 270
-print_stmt = 271
-del_stmt = 272
-pass_stmt = 273
-flow_stmt = 274
-break_stmt = 275
-continue_stmt = 276
-return_stmt = 277
-yield_stmt = 278
-raise_stmt = 279
-import_stmt = 280
-import_name = 281
-import_from = 282
-import_as_name = 283
-dotted_as_name = 284
-import_as_names = 285
-dotted_as_names = 286
-dotted_name = 287
-global_stmt = 288
-exec_stmt = 289
-assert_stmt = 290
-compound_stmt = 291
-if_stmt = 292
-while_stmt = 293
-for_stmt = 294
-try_stmt = 295
-with_stmt = 296
-with_var = 297
-except_clause = 298
-suite = 299
-testlist_safe = 300
-old_test = 301
-old_lambdef = 302
-test = 303
-or_test = 304
-and_test = 305
-not_test = 306
-comparison = 307
-comp_op = 308
-expr = 309
-xor_expr = 310
-and_expr = 311
-shift_expr = 312
-arith_expr = 313
-term = 314
-factor = 315
-power = 316
-atom = 317
-listmaker = 318
-testlist_gexp = 319
-lambdef = 320
-trailer = 321
-subscriptlist = 322
-subscript = 323
-sliceop = 324
-exprlist = 325
-testlist = 326
-dictmaker = 327
-classdef = 328
-arglist = 329
-argument = 330
-list_iter = 331
-list_for = 332
-list_if = 333
-gen_iter = 334
-gen_for = 335
-gen_if = 336
-testlist1 = 337
-encoding_decl = 338
-yield_expr = 339
+decorated = 261
+funcdef = 262
+parameters = 263
+varargslist = 264
+fpdef = 265
+fplist = 266
+stmt = 267
+simple_stmt = 268
+small_stmt = 269
+expr_stmt = 270
+augassign = 271
+print_stmt = 272
+del_stmt = 273
+pass_stmt = 274
+flow_stmt = 275
+break_stmt = 276
+continue_stmt = 277
+return_stmt = 278
+yield_stmt = 279
+raise_stmt = 280
+import_stmt = 281
+import_name = 282
+import_from = 283
+import_as_name = 284
+dotted_as_name = 285
+import_as_names = 286
+dotted_as_names = 287
+dotted_name = 288
+global_stmt = 289
+exec_stmt = 290
+assert_stmt = 291
+compound_stmt = 292
+if_stmt = 293
+while_stmt = 294
+for_stmt = 295
+try_stmt = 296
+with_stmt = 297
+with_var = 298
+except_clause = 299
+suite = 300
+testlist_safe = 301
+old_test = 302
+old_lambdef = 303
+test = 304
+or_test = 305
+and_test = 306
+not_test = 307
+comparison = 308
+comp_op = 309
+expr = 310
+xor_expr = 311
+and_expr = 312
+shift_expr = 313
+arith_expr = 314
+term = 315
+factor = 316
+power = 317
+atom = 318
+listmaker = 319
+testlist_gexp = 320
+lambdef = 321
+trailer = 322
+subscriptlist = 323
+subscript = 324
+sliceop = 325
+exprlist = 326
+testlist = 327
+dictmaker = 328
+classdef = 329
+arglist = 330
+argument = 331
+list_iter = 332
+list_for = 333
+list_if = 334
+gen_iter = 335
+gen_for = 336
+gen_if = 337
+testlist1 = 338
+encoding_decl = 339
+yield_expr = 340
 #--end constants--
 
 sym_name = {}

Modified: python/branches/trunk-math/Lib/test/fork_wait.py
==============================================================================
--- python/branches/trunk-math/Lib/test/fork_wait.py	(original)
+++ python/branches/trunk-math/Lib/test/fork_wait.py	Thu Feb 28 21:09:17 2008
@@ -13,7 +13,6 @@
 """
 
 import os, sys, time, thread, unittest
-from test.test_support import TestSkipped
 
 LONGSLEEP = 2
 SHORTSLEEP = 0.5

Modified: python/branches/trunk-math/Lib/test/list_tests.py
==============================================================================
--- python/branches/trunk-math/Lib/test/list_tests.py	(original)
+++ python/branches/trunk-math/Lib/test/list_tests.py	Thu Feb 28 21:09:17 2008
@@ -5,7 +5,6 @@
 import sys
 import os
 
-import unittest
 from test import test_support, seq_tests
 
 class CommonTest(seq_tests.CommonTest):

Deleted: /python/branches/trunk-math/Lib/test/output/test_logging
==============================================================================
--- /python/branches/trunk-math/Lib/test/output/test_logging	Thu Feb 28 21:09:17 2008
+++ (empty file)
@@ -1,525 +0,0 @@
-test_logging
--- log_test0  begin  ---------------------------------------------------
-CRITICAL:ERR:Message 0
-ERROR:ERR:Message 1
-CRITICAL:INF:Message 2
-ERROR:INF:Message 3
-WARNING:INF:Message 4
-INFO:INF:Message 5
-CRITICAL:INF.UNDEF:Message 6
-ERROR:INF.UNDEF:Message 7
-WARNING:INF.UNDEF:Message 8
-INFO:INF.UNDEF:Message 9
-CRITICAL:INF.ERR:Message 10
-ERROR:INF.ERR:Message 11
-CRITICAL:INF.ERR.UNDEF:Message 12
-ERROR:INF.ERR.UNDEF:Message 13
-CRITICAL:DEB:Message 14
-ERROR:DEB:Message 15
-WARNING:DEB:Message 16
-INFO:DEB:Message 17
-DEBUG:DEB:Message 18
-CRITICAL:UNDEF:Message 19
-ERROR:UNDEF:Message 20
-WARNING:UNDEF:Message 21
-INFO:UNDEF:Message 22
-CRITICAL:INF.BADPARENT.UNDEF:Message 23
-CRITICAL:INF.BADPARENT:Message 24
-INFO:INF:Finish up, it's closing time. Messages should bear numbers 0 through 24.
--- log_test0  end    ---------------------------------------------------
--- log_test1  begin  ---------------------------------------------------
--- setting logging level to 'Boring' -----
-Boring:root:This should only be seen at the 'Boring' logging level (or lower)
-Chatterbox:root:This should only be seen at the 'Chatterbox' logging level (or lower)
-Garrulous:root:This should only be seen at the 'Garrulous' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Chatterbox' -----
-Chatterbox:root:This should only be seen at the 'Chatterbox' logging level (or lower)
-Garrulous:root:This should only be seen at the 'Garrulous' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Garrulous' -----
-Garrulous:root:This should only be seen at the 'Garrulous' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Talkative' -----
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Verbose' -----
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Sociable' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Effusive' -----
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Terse' -----
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Taciturn' -----
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Silent' -----
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- Filtering at handler level to SOCIABLE --
--- setting logging level to 'Boring' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Chatterbox' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Garrulous' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Talkative' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Verbose' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Sociable' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Effusive' -----
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Terse' -----
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Taciturn' -----
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Silent' -----
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- Filtering using GARRULOUS filter --
--- setting logging level to 'Boring' -----
-Boring:root:This should only be seen at the 'Boring' logging level (or lower)
-Chatterbox:root:This should only be seen at the 'Chatterbox' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Chatterbox' -----
-Chatterbox:root:This should only be seen at the 'Chatterbox' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Garrulous' -----
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Talkative' -----
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Verbose' -----
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Sociable' -----
-Sociable:root:This should only be seen at the 'Sociable' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Effusive' -----
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Terse' -----
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Taciturn' -----
-Taciturn:root:This should only be seen at the 'Taciturn' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Silent' -----
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- Filtering using specific filter for SOCIABLE, TACITURN --
--- setting logging level to 'Boring' -----
-Boring:root:This should only be seen at the 'Boring' logging level (or lower)
-Chatterbox:root:This should only be seen at the 'Chatterbox' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Chatterbox' -----
-Chatterbox:root:This should only be seen at the 'Chatterbox' logging level (or lower)
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Garrulous' -----
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Talkative' -----
-Talkative:root:This should only be seen at the 'Talkative' logging level (or lower)
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Verbose' -----
-Verbose:root:This should only be seen at the 'Verbose' logging level (or lower)
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Sociable' -----
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Effusive' -----
-Effusive:root:This should only be seen at the 'Effusive' logging level (or lower)
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Terse' -----
-Terse:root:This should only be seen at the 'Terse' logging level (or lower)
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Taciturn' -----
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- setting logging level to 'Silent' -----
-Silent:root:This should only be seen at the 'Silent' logging level (or lower)
--- log_test1  end    ---------------------------------------------------
--- log_test2  begin  ---------------------------------------------------
--- logging at DEBUG, nothing should be seen yet --
--- logging at INFO, nothing should be seen yet --
--- logging at WARNING, 3 messages should be seen --
-DEBUG:root:Debug message
-INFO:root:Info message
-WARNING:root:Warn message
--- logging 0 at INFO, messages should be seen every 10 events --
--- logging 1 at INFO, messages should be seen every 10 events --
--- logging 2 at INFO, messages should be seen every 10 events --
--- logging 3 at INFO, messages should be seen every 10 events --
--- logging 4 at INFO, messages should be seen every 10 events --
--- logging 5 at INFO, messages should be seen every 10 events --
--- logging 6 at INFO, messages should be seen every 10 events --
--- logging 7 at INFO, messages should be seen every 10 events --
--- logging 8 at INFO, messages should be seen every 10 events --
--- logging 9 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 0
-INFO:root:Info index = 1
-INFO:root:Info index = 2
-INFO:root:Info index = 3
-INFO:root:Info index = 4
-INFO:root:Info index = 5
-INFO:root:Info index = 6
-INFO:root:Info index = 7
-INFO:root:Info index = 8
-INFO:root:Info index = 9
--- logging 10 at INFO, messages should be seen every 10 events --
--- logging 11 at INFO, messages should be seen every 10 events --
--- logging 12 at INFO, messages should be seen every 10 events --
--- logging 13 at INFO, messages should be seen every 10 events --
--- logging 14 at INFO, messages should be seen every 10 events --
--- logging 15 at INFO, messages should be seen every 10 events --
--- logging 16 at INFO, messages should be seen every 10 events --
--- logging 17 at INFO, messages should be seen every 10 events --
--- logging 18 at INFO, messages should be seen every 10 events --
--- logging 19 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 10
-INFO:root:Info index = 11
-INFO:root:Info index = 12
-INFO:root:Info index = 13
-INFO:root:Info index = 14
-INFO:root:Info index = 15
-INFO:root:Info index = 16
-INFO:root:Info index = 17
-INFO:root:Info index = 18
-INFO:root:Info index = 19
--- logging 20 at INFO, messages should be seen every 10 events --
--- logging 21 at INFO, messages should be seen every 10 events --
--- logging 22 at INFO, messages should be seen every 10 events --
--- logging 23 at INFO, messages should be seen every 10 events --
--- logging 24 at INFO, messages should be seen every 10 events --
--- logging 25 at INFO, messages should be seen every 10 events --
--- logging 26 at INFO, messages should be seen every 10 events --
--- logging 27 at INFO, messages should be seen every 10 events --
--- logging 28 at INFO, messages should be seen every 10 events --
--- logging 29 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 20
-INFO:root:Info index = 21
-INFO:root:Info index = 22
-INFO:root:Info index = 23
-INFO:root:Info index = 24
-INFO:root:Info index = 25
-INFO:root:Info index = 26
-INFO:root:Info index = 27
-INFO:root:Info index = 28
-INFO:root:Info index = 29
--- logging 30 at INFO, messages should be seen every 10 events --
--- logging 31 at INFO, messages should be seen every 10 events --
--- logging 32 at INFO, messages should be seen every 10 events --
--- logging 33 at INFO, messages should be seen every 10 events --
--- logging 34 at INFO, messages should be seen every 10 events --
--- logging 35 at INFO, messages should be seen every 10 events --
--- logging 36 at INFO, messages should be seen every 10 events --
--- logging 37 at INFO, messages should be seen every 10 events --
--- logging 38 at INFO, messages should be seen every 10 events --
--- logging 39 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 30
-INFO:root:Info index = 31
-INFO:root:Info index = 32
-INFO:root:Info index = 33
-INFO:root:Info index = 34
-INFO:root:Info index = 35
-INFO:root:Info index = 36
-INFO:root:Info index = 37
-INFO:root:Info index = 38
-INFO:root:Info index = 39
--- logging 40 at INFO, messages should be seen every 10 events --
--- logging 41 at INFO, messages should be seen every 10 events --
--- logging 42 at INFO, messages should be seen every 10 events --
--- logging 43 at INFO, messages should be seen every 10 events --
--- logging 44 at INFO, messages should be seen every 10 events --
--- logging 45 at INFO, messages should be seen every 10 events --
--- logging 46 at INFO, messages should be seen every 10 events --
--- logging 47 at INFO, messages should be seen every 10 events --
--- logging 48 at INFO, messages should be seen every 10 events --
--- logging 49 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 40
-INFO:root:Info index = 41
-INFO:root:Info index = 42
-INFO:root:Info index = 43
-INFO:root:Info index = 44
-INFO:root:Info index = 45
-INFO:root:Info index = 46
-INFO:root:Info index = 47
-INFO:root:Info index = 48
-INFO:root:Info index = 49
--- logging 50 at INFO, messages should be seen every 10 events --
--- logging 51 at INFO, messages should be seen every 10 events --
--- logging 52 at INFO, messages should be seen every 10 events --
--- logging 53 at INFO, messages should be seen every 10 events --
--- logging 54 at INFO, messages should be seen every 10 events --
--- logging 55 at INFO, messages should be seen every 10 events --
--- logging 56 at INFO, messages should be seen every 10 events --
--- logging 57 at INFO, messages should be seen every 10 events --
--- logging 58 at INFO, messages should be seen every 10 events --
--- logging 59 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 50
-INFO:root:Info index = 51
-INFO:root:Info index = 52
-INFO:root:Info index = 53
-INFO:root:Info index = 54
-INFO:root:Info index = 55
-INFO:root:Info index = 56
-INFO:root:Info index = 57
-INFO:root:Info index = 58
-INFO:root:Info index = 59
--- logging 60 at INFO, messages should be seen every 10 events --
--- logging 61 at INFO, messages should be seen every 10 events --
--- logging 62 at INFO, messages should be seen every 10 events --
--- logging 63 at INFO, messages should be seen every 10 events --
--- logging 64 at INFO, messages should be seen every 10 events --
--- logging 65 at INFO, messages should be seen every 10 events --
--- logging 66 at INFO, messages should be seen every 10 events --
--- logging 67 at INFO, messages should be seen every 10 events --
--- logging 68 at INFO, messages should be seen every 10 events --
--- logging 69 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 60
-INFO:root:Info index = 61
-INFO:root:Info index = 62
-INFO:root:Info index = 63
-INFO:root:Info index = 64
-INFO:root:Info index = 65
-INFO:root:Info index = 66
-INFO:root:Info index = 67
-INFO:root:Info index = 68
-INFO:root:Info index = 69
--- logging 70 at INFO, messages should be seen every 10 events --
--- logging 71 at INFO, messages should be seen every 10 events --
--- logging 72 at INFO, messages should be seen every 10 events --
--- logging 73 at INFO, messages should be seen every 10 events --
--- logging 74 at INFO, messages should be seen every 10 events --
--- logging 75 at INFO, messages should be seen every 10 events --
--- logging 76 at INFO, messages should be seen every 10 events --
--- logging 77 at INFO, messages should be seen every 10 events --
--- logging 78 at INFO, messages should be seen every 10 events --
--- logging 79 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 70
-INFO:root:Info index = 71
-INFO:root:Info index = 72
-INFO:root:Info index = 73
-INFO:root:Info index = 74
-INFO:root:Info index = 75
-INFO:root:Info index = 76
-INFO:root:Info index = 77
-INFO:root:Info index = 78
-INFO:root:Info index = 79
--- logging 80 at INFO, messages should be seen every 10 events --
--- logging 81 at INFO, messages should be seen every 10 events --
--- logging 82 at INFO, messages should be seen every 10 events --
--- logging 83 at INFO, messages should be seen every 10 events --
--- logging 84 at INFO, messages should be seen every 10 events --
--- logging 85 at INFO, messages should be seen every 10 events --
--- logging 86 at INFO, messages should be seen every 10 events --
--- logging 87 at INFO, messages should be seen every 10 events --
--- logging 88 at INFO, messages should be seen every 10 events --
--- logging 89 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 80
-INFO:root:Info index = 81
-INFO:root:Info index = 82
-INFO:root:Info index = 83
-INFO:root:Info index = 84
-INFO:root:Info index = 85
-INFO:root:Info index = 86
-INFO:root:Info index = 87
-INFO:root:Info index = 88
-INFO:root:Info index = 89
--- logging 90 at INFO, messages should be seen every 10 events --
--- logging 91 at INFO, messages should be seen every 10 events --
--- logging 92 at INFO, messages should be seen every 10 events --
--- logging 93 at INFO, messages should be seen every 10 events --
--- logging 94 at INFO, messages should be seen every 10 events --
--- logging 95 at INFO, messages should be seen every 10 events --
--- logging 96 at INFO, messages should be seen every 10 events --
--- logging 97 at INFO, messages should be seen every 10 events --
--- logging 98 at INFO, messages should be seen every 10 events --
--- logging 99 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 90
-INFO:root:Info index = 91
-INFO:root:Info index = 92
-INFO:root:Info index = 93
-INFO:root:Info index = 94
-INFO:root:Info index = 95
-INFO:root:Info index = 96
-INFO:root:Info index = 97
-INFO:root:Info index = 98
-INFO:root:Info index = 99
--- logging 100 at INFO, messages should be seen every 10 events --
--- logging 101 at INFO, messages should be seen every 10 events --
-INFO:root:Info index = 100
-INFO:root:Info index = 101
--- log_test2  end    ---------------------------------------------------
--- log_test3  begin  ---------------------------------------------------
-Unfiltered...
-INFO:a:Info 1
-INFO:a.b:Info 2
-INFO:a.c:Info 3
-INFO:a.b.c:Info 4
-INFO:a.b.c.d:Info 5
-INFO:a.bb.c:Info 6
-INFO:b:Info 7
-INFO:b.a:Info 8
-INFO:c.a.b:Info 9
-INFO:a.bb:Info 10
-Filtered with 'a.b'...
-INFO:a.b:Info 2
-INFO:a.b.c:Info 4
-INFO:a.b.c.d:Info 5
--- log_test3  end    ---------------------------------------------------
--- log_test4  begin  ---------------------------------------------------
-config0: ok.
-config1: ok.
-config2: <type 'exceptions.AttributeError'>
-config3: <type 'exceptions.KeyError'>
--- log_test4  end    ---------------------------------------------------
--- log_test5  begin  ---------------------------------------------------
-ERROR:root:just testing
-<type 'exceptions.KeyError'>... Don't panic!
--- log_test5  end    ---------------------------------------------------
--- logrecv output begin  ---------------------------------------------------
-ERR -> CRITICAL: Message 0 (via logrecv.tcp.ERR)
-ERR -> ERROR: Message 1 (via logrecv.tcp.ERR)
-INF -> CRITICAL: Message 2 (via logrecv.tcp.INF)
-INF -> ERROR: Message 3 (via logrecv.tcp.INF)
-INF -> WARNING: Message 4 (via logrecv.tcp.INF)
-INF -> INFO: Message 5 (via logrecv.tcp.INF)
-INF.UNDEF -> CRITICAL: Message 6 (via logrecv.tcp.INF.UNDEF)
-INF.UNDEF -> ERROR: Message 7 (via logrecv.tcp.INF.UNDEF)
-INF.UNDEF -> WARNING: Message 8 (via logrecv.tcp.INF.UNDEF)
-INF.UNDEF -> INFO: Message 9 (via logrecv.tcp.INF.UNDEF)
-INF.ERR -> CRITICAL: Message 10 (via logrecv.tcp.INF.ERR)
-INF.ERR -> ERROR: Message 11 (via logrecv.tcp.INF.ERR)
-INF.ERR.UNDEF -> CRITICAL: Message 12 (via logrecv.tcp.INF.ERR.UNDEF)
-INF.ERR.UNDEF -> ERROR: Message 13 (via logrecv.tcp.INF.ERR.UNDEF)
-DEB -> CRITICAL: Message 14 (via logrecv.tcp.DEB)
-DEB -> ERROR: Message 15 (via logrecv.tcp.DEB)
-DEB -> WARNING: Message 16 (via logrecv.tcp.DEB)
-DEB -> INFO: Message 17 (via logrecv.tcp.DEB)
-DEB -> DEBUG: Message 18 (via logrecv.tcp.DEB)
-UNDEF -> CRITICAL: Message 19 (via logrecv.tcp.UNDEF)
-UNDEF -> ERROR: Message 20 (via logrecv.tcp.UNDEF)
-UNDEF -> WARNING: Message 21 (via logrecv.tcp.UNDEF)
-UNDEF -> INFO: Message 22 (via logrecv.tcp.UNDEF)
-INF.BADPARENT.UNDEF -> CRITICAL: Message 23 (via logrecv.tcp.INF.BADPARENT.UNDEF)
-INF.BADPARENT -> CRITICAL: Message 24 (via logrecv.tcp.INF.BADPARENT)
-INF -> INFO: Finish up, it's closing time. Messages should bear numbers 0 through 24. (via logrecv.tcp.INF)
--- logrecv output end    ---------------------------------------------------

Modified: python/branches/trunk-math/Lib/test/seq_tests.py
==============================================================================
--- python/branches/trunk-math/Lib/test/seq_tests.py	(original)
+++ python/branches/trunk-math/Lib/test/seq_tests.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
 """
 
 import unittest
-from test import test_support
 import sys
 
 # Various iterables

Modified: python/branches/trunk-math/Lib/test/string_tests.py
==============================================================================
--- python/branches/trunk-math/Lib/test/string_tests.py	(original)
+++ python/branches/trunk-math/Lib/test/string_tests.py	Thu Feb 28 21:09:17 2008
@@ -1033,7 +1033,14 @@
             # unicode raises ValueError, str raises OverflowError
             self.checkraises((ValueError, OverflowError), '%c', '__mod__', ordinal)
 
+        longvalue = sys.maxint + 10L
+        slongvalue = str(longvalue)
+        if slongvalue[-1] in ("L","l"): slongvalue = slongvalue[:-1]
         self.checkequal(' 42', '%3ld', '__mod__', 42)
+        self.checkequal('42', '%d', '__mod__', 42L)
+        self.checkequal('42', '%d', '__mod__', 42.0)
+        self.checkequal(slongvalue, '%d', '__mod__', longvalue)
+        self.checkcall('%d', '__mod__', float(longvalue))
         self.checkequal('0042.00', '%07.2f', '__mod__', 42)
         self.checkequal('0042.00', '%07.2F', '__mod__', 42)
 
@@ -1043,6 +1050,8 @@
         self.checkraises(TypeError, '%c', '__mod__', (None,))
         self.checkraises(ValueError, '%(foo', '__mod__', {})
         self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42))
+        self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric
+        self.checkraises(TypeError, '%d', '__mod__', (42+0j)) # no int/long conversion provided
 
         # argument names with properly nested brackets are supported
         self.checkequal('bar', '%((foo))s', '__mod__', {'(foo)': 'bar'})

Modified: python/branches/trunk-math/Lib/test/test_MimeWriter.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_MimeWriter.py	(original)
+++ python/branches/trunk-math/Lib/test/test_MimeWriter.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,7 @@
 
 """
 
-import unittest, sys, StringIO
+import unittest, StringIO
 from test.test_support import run_unittest
 
 import warnings

Modified: python/branches/trunk-math/Lib/test/test___all__.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test___all__.py	(original)
+++ python/branches/trunk-math/Lib/test/test___all__.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,5 @@
 import unittest
-from test.test_support import verbose, run_unittest
+from test.test_support import run_unittest
 import sys
 import warnings
 

Modified: python/branches/trunk-math/Lib/test/test_abc.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_abc.py	(original)
+++ python/branches/trunk-math/Lib/test/test_abc.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
 
 """Unit tests for abc.py."""
 
-import sys
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_applesingle.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_applesingle.py	(original)
+++ python/branches/trunk-math/Lib/test/test_applesingle.py	Thu Feb 28 21:09:17 2008
@@ -5,7 +5,6 @@
 import Carbon.File
 import MacOS
 import os
-import sys
 from test import test_support
 import struct
 import applesingle

Modified: python/branches/trunk-math/Lib/test/test_array.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_array.py	(original)
+++ python/branches/trunk-math/Lib/test/test_array.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 import unittest
 from test import test_support
 from weakref import proxy
-import array, cStringIO, math
+import array, cStringIO
 from cPickle import loads, dumps
 
 class ArraySubclass(array.array):

Modified: python/branches/trunk-math/Lib/test/test_ast.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_ast.py	(original)
+++ python/branches/trunk-math/Lib/test/test_ast.py	Thu Feb 28 21:09:17 2008
@@ -156,7 +156,7 @@
 #### EVERYTHING BELOW IS GENERATED #####
 exec_results = [
 ('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, []), [('Pass', (1, 9))], [])]),
-('Module', [('ClassDef', (1, 0), 'C', [], [('Pass', (1, 8))])]),
+('Module', [('ClassDef', (1, 0), 'C', [], [('Pass', (1, 8))], [])]),
 ('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, []), [('Return', (1, 8), ('Num', (1, 15), 1))], [])]),
 ('Module', [('Delete', (1, 0), [('Name', (1, 4), 'v', ('Del',))])]),
 ('Module', [('Assign', (1, 0), [('Name', (1, 0), 'v', ('Store',))], ('Num', (1, 4), 1))]),

Modified: python/branches/trunk-math/Lib/test/test_bisect.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_bisect.py	(original)
+++ python/branches/trunk-math/Lib/test/test_bisect.py	Thu Feb 28 21:09:17 2008
@@ -1,91 +1,113 @@
+import sys
 import unittest
 from test import test_support
-from bisect import bisect_right, bisect_left, insort_left, insort_right, insort, bisect
 from UserList import UserList
 
+# We do a bit of trickery here to be able to test both the C implementation
+# and the Python implementation of the module.
+
+# Make it impossible to import the C implementation anymore.
+sys.modules['_bisect'] = 0
+# We must also handle the case that bisect was imported before.
+if 'bisect' in sys.modules:
+    del sys.modules['bisect']
+
+# Now we can import the module and get the pure Python implementation.
+import bisect as py_bisect
+
+# Restore everything to normal.
+del sys.modules['_bisect']
+del sys.modules['bisect']
+
+# This is now the module with the C implementation.
+import bisect as c_bisect
+
+
 class TestBisect(unittest.TestCase):
+    module = None
 
-    precomputedCases = [
-        (bisect_right, [], 1, 0),
-        (bisect_right, [1], 0, 0),
-        (bisect_right, [1], 1, 1),
-        (bisect_right, [1], 2, 1),
-        (bisect_right, [1, 1], 0, 0),
-        (bisect_right, [1, 1], 1, 2),
-        (bisect_right, [1, 1], 2, 2),
-        (bisect_right, [1, 1, 1], 0, 0),
-        (bisect_right, [1, 1, 1], 1, 3),
-        (bisect_right, [1, 1, 1], 2, 3),
-        (bisect_right, [1, 1, 1, 1], 0, 0),
-        (bisect_right, [1, 1, 1, 1], 1, 4),
-        (bisect_right, [1, 1, 1, 1], 2, 4),
-        (bisect_right, [1, 2], 0, 0),
-        (bisect_right, [1, 2], 1, 1),
-        (bisect_right, [1, 2], 1.5, 1),
-        (bisect_right, [1, 2], 2, 2),
-        (bisect_right, [1, 2], 3, 2),
-        (bisect_right, [1, 1, 2, 2], 0, 0),
-        (bisect_right, [1, 1, 2, 2], 1, 2),
-        (bisect_right, [1, 1, 2, 2], 1.5, 2),
-        (bisect_right, [1, 1, 2, 2], 2, 4),
-        (bisect_right, [1, 1, 2, 2], 3, 4),
-        (bisect_right, [1, 2, 3], 0, 0),
-        (bisect_right, [1, 2, 3], 1, 1),
-        (bisect_right, [1, 2, 3], 1.5, 1),
-        (bisect_right, [1, 2, 3], 2, 2),
-        (bisect_right, [1, 2, 3], 2.5, 2),
-        (bisect_right, [1, 2, 3], 3, 3),
-        (bisect_right, [1, 2, 3], 4, 3),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 0, 0),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1, 1),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1.5, 1),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2, 3),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2.5, 3),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3, 6),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3.5, 6),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 4, 10),
-        (bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 5, 10),
-
-        (bisect_left, [], 1, 0),
-        (bisect_left, [1], 0, 0),
-        (bisect_left, [1], 1, 0),
-        (bisect_left, [1], 2, 1),
-        (bisect_left, [1, 1], 0, 0),
-        (bisect_left, [1, 1], 1, 0),
-        (bisect_left, [1, 1], 2, 2),
-        (bisect_left, [1, 1, 1], 0, 0),
-        (bisect_left, [1, 1, 1], 1, 0),
-        (bisect_left, [1, 1, 1], 2, 3),
-        (bisect_left, [1, 1, 1, 1], 0, 0),
-        (bisect_left, [1, 1, 1, 1], 1, 0),
-        (bisect_left, [1, 1, 1, 1], 2, 4),
-        (bisect_left, [1, 2], 0, 0),
-        (bisect_left, [1, 2], 1, 0),
-        (bisect_left, [1, 2], 1.5, 1),
-        (bisect_left, [1, 2], 2, 1),
-        (bisect_left, [1, 2], 3, 2),
-        (bisect_left, [1, 1, 2, 2], 0, 0),
-        (bisect_left, [1, 1, 2, 2], 1, 0),
-        (bisect_left, [1, 1, 2, 2], 1.5, 2),
-        (bisect_left, [1, 1, 2, 2], 2, 2),
-        (bisect_left, [1, 1, 2, 2], 3, 4),
-        (bisect_left, [1, 2, 3], 0, 0),
-        (bisect_left, [1, 2, 3], 1, 0),
-        (bisect_left, [1, 2, 3], 1.5, 1),
-        (bisect_left, [1, 2, 3], 2, 1),
-        (bisect_left, [1, 2, 3], 2.5, 2),
-        (bisect_left, [1, 2, 3], 3, 2),
-        (bisect_left, [1, 2, 3], 4, 3),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 0, 0),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1, 0),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1.5, 1),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2, 1),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2.5, 3),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3, 3),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3.5, 6),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 4, 6),
-        (bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 5, 10)
-    ]
+    def setUp(self):
+        self.precomputedCases = [
+            (self.module.bisect_right, [], 1, 0),
+            (self.module.bisect_right, [1], 0, 0),
+            (self.module.bisect_right, [1], 1, 1),
+            (self.module.bisect_right, [1], 2, 1),
+            (self.module.bisect_right, [1, 1], 0, 0),
+            (self.module.bisect_right, [1, 1], 1, 2),
+            (self.module.bisect_right, [1, 1], 2, 2),
+            (self.module.bisect_right, [1, 1, 1], 0, 0),
+            (self.module.bisect_right, [1, 1, 1], 1, 3),
+            (self.module.bisect_right, [1, 1, 1], 2, 3),
+            (self.module.bisect_right, [1, 1, 1, 1], 0, 0),
+            (self.module.bisect_right, [1, 1, 1, 1], 1, 4),
+            (self.module.bisect_right, [1, 1, 1, 1], 2, 4),
+            (self.module.bisect_right, [1, 2], 0, 0),
+            (self.module.bisect_right, [1, 2], 1, 1),
+            (self.module.bisect_right, [1, 2], 1.5, 1),
+            (self.module.bisect_right, [1, 2], 2, 2),
+            (self.module.bisect_right, [1, 2], 3, 2),
+            (self.module.bisect_right, [1, 1, 2, 2], 0, 0),
+            (self.module.bisect_right, [1, 1, 2, 2], 1, 2),
+            (self.module.bisect_right, [1, 1, 2, 2], 1.5, 2),
+            (self.module.bisect_right, [1, 1, 2, 2], 2, 4),
+            (self.module.bisect_right, [1, 1, 2, 2], 3, 4),
+            (self.module.bisect_right, [1, 2, 3], 0, 0),
+            (self.module.bisect_right, [1, 2, 3], 1, 1),
+            (self.module.bisect_right, [1, 2, 3], 1.5, 1),
+            (self.module.bisect_right, [1, 2, 3], 2, 2),
+            (self.module.bisect_right, [1, 2, 3], 2.5, 2),
+            (self.module.bisect_right, [1, 2, 3], 3, 3),
+            (self.module.bisect_right, [1, 2, 3], 4, 3),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 0, 0),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1, 1),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1.5, 1),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2, 3),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2.5, 3),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3, 6),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3.5, 6),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 4, 10),
+            (self.module.bisect_right, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 5, 10),
+
+            (self.module.bisect_left, [], 1, 0),
+            (self.module.bisect_left, [1], 0, 0),
+            (self.module.bisect_left, [1], 1, 0),
+            (self.module.bisect_left, [1], 2, 1),
+            (self.module.bisect_left, [1, 1], 0, 0),
+            (self.module.bisect_left, [1, 1], 1, 0),
+            (self.module.bisect_left, [1, 1], 2, 2),
+            (self.module.bisect_left, [1, 1, 1], 0, 0),
+            (self.module.bisect_left, [1, 1, 1], 1, 0),
+            (self.module.bisect_left, [1, 1, 1], 2, 3),
+            (self.module.bisect_left, [1, 1, 1, 1], 0, 0),
+            (self.module.bisect_left, [1, 1, 1, 1], 1, 0),
+            (self.module.bisect_left, [1, 1, 1, 1], 2, 4),
+            (self.module.bisect_left, [1, 2], 0, 0),
+            (self.module.bisect_left, [1, 2], 1, 0),
+            (self.module.bisect_left, [1, 2], 1.5, 1),
+            (self.module.bisect_left, [1, 2], 2, 1),
+            (self.module.bisect_left, [1, 2], 3, 2),
+            (self.module.bisect_left, [1, 1, 2, 2], 0, 0),
+            (self.module.bisect_left, [1, 1, 2, 2], 1, 0),
+            (self.module.bisect_left, [1, 1, 2, 2], 1.5, 2),
+            (self.module.bisect_left, [1, 1, 2, 2], 2, 2),
+            (self.module.bisect_left, [1, 1, 2, 2], 3, 4),
+            (self.module.bisect_left, [1, 2, 3], 0, 0),
+            (self.module.bisect_left, [1, 2, 3], 1, 0),
+            (self.module.bisect_left, [1, 2, 3], 1.5, 1),
+            (self.module.bisect_left, [1, 2, 3], 2, 1),
+            (self.module.bisect_left, [1, 2, 3], 2.5, 2),
+            (self.module.bisect_left, [1, 2, 3], 3, 2),
+            (self.module.bisect_left, [1, 2, 3], 4, 3),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 0, 0),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1, 0),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1.5, 1),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2, 1),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2.5, 3),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3, 3),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3.5, 6),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 4, 6),
+            (self.module.bisect_left, [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 5, 10)
+        ]
 
     def test_precomputed(self):
         for func, data, elem, expected in self.precomputedCases:
@@ -98,12 +120,12 @@
             data = [randrange(0, n, 2) for j in xrange(i)]
             data.sort()
             elem = randrange(-1, n+1)
-            ip = bisect_left(data, elem)
+            ip = self.module.bisect_left(data, elem)
             if ip < len(data):
                 self.failUnless(elem <= data[ip])
             if ip > 0:
                 self.failUnless(data[ip-1] < elem)
-            ip = bisect_right(data, elem)
+            ip = self.module.bisect_right(data, elem)
             if ip < len(data):
                 self.failUnless(elem < data[ip])
             if ip > 0:
@@ -117,32 +139,39 @@
                     hi = min(len(data), hi)
                     ip = func(data, elem, lo, hi)
                     self.failUnless(lo <= ip <= hi)
-                    if func is bisect_left and ip < hi:
+                    if func is self.module.bisect_left and ip < hi:
                         self.failUnless(elem <= data[ip])
-                    if func is bisect_left and ip > lo:
+                    if func is self.module.bisect_left and ip > lo:
                         self.failUnless(data[ip-1] < elem)
-                    if func is bisect_right and ip < hi:
+                    if func is self.module.bisect_right and ip < hi:
                         self.failUnless(elem < data[ip])
-                    if func is bisect_right and ip > lo:
+                    if func is self.module.bisect_right and ip > lo:
                         self.failUnless(data[ip-1] <= elem)
                     self.assertEqual(ip, max(lo, min(hi, expected)))
 
     def test_backcompatibility(self):
-        self.assertEqual(bisect, bisect_right)
+        self.assertEqual(self.module.bisect, self.module.bisect_right)
 
     def test_keyword_args(self):
         data = [10, 20, 30, 40, 50]
-        self.assertEqual(bisect_left(a=data, x=25, lo=1, hi=3), 2)
-        self.assertEqual(bisect_right(a=data, x=25, lo=1, hi=3), 2)
-        self.assertEqual(bisect(a=data, x=25, lo=1, hi=3), 2)
-        insort_left(a=data, x=25, lo=1, hi=3)
-        insort_right(a=data, x=25, lo=1, hi=3)
-        insort(a=data, x=25, lo=1, hi=3)
+        self.assertEqual(self.module.bisect_left(a=data, x=25, lo=1, hi=3), 2)
+        self.assertEqual(self.module.bisect_right(a=data, x=25, lo=1, hi=3), 2)
+        self.assertEqual(self.module.bisect(a=data, x=25, lo=1, hi=3), 2)
+        self.module.insort_left(a=data, x=25, lo=1, hi=3)
+        self.module.insort_right(a=data, x=25, lo=1, hi=3)
+        self.module.insort(a=data, x=25, lo=1, hi=3)
         self.assertEqual(data, [10, 20, 25, 25, 25, 30, 40, 50])
 
+class TestBisectPython(TestBisect):
+    module = py_bisect
+
+class TestBisectC(TestBisect):
+    module = c_bisect
+
 #==============================================================================
 
 class TestInsort(unittest.TestCase):
+    module = None
 
     def test_vsBuiltinSort(self, n=500):
         from random import choice
@@ -150,14 +179,20 @@
             for i in xrange(n):
                 digit = choice("0123456789")
                 if digit in "02468":
-                    f = insort_left
+                    f = self.module.insort_left
                 else:
-                    f = insort_right
+                    f = self.module.insort_right
                 f(insorted, digit)
         self.assertEqual(sorted(insorted), insorted)
 
     def test_backcompatibility(self):
-        self.assertEqual(insort, insort_right)
+        self.assertEqual(self.module.insort, self.module.insort_right)
+
+class TestInsortPython(TestInsort):
+    module = py_bisect
+
+class TestInsortC(TestInsort):
+    module = c_bisect
 
 #==============================================================================
 
@@ -178,32 +213,44 @@
         raise ZeroDivisionError
 
 class TestErrorHandling(unittest.TestCase):
+    module = None
 
     def test_non_sequence(self):
-        for f in (bisect_left, bisect_right, insort_left, insort_right):
+        for f in (self.module.bisect_left, self.module.bisect_right,
+                  self.module.insort_left, self.module.insort_right):
             self.assertRaises(TypeError, f, 10, 10)
 
     def test_len_only(self):
-        for f in (bisect_left, bisect_right, insort_left, insort_right):
+        for f in (self.module.bisect_left, self.module.bisect_right,
+                  self.module.insort_left, self.module.insort_right):
             self.assertRaises(AttributeError, f, LenOnly(), 10)
 
     def test_get_only(self):
-        for f in (bisect_left, bisect_right, insort_left, insort_right):
+        for f in (self.module.bisect_left, self.module.bisect_right,
+                  self.module.insort_left, self.module.insort_right):
             self.assertRaises(AttributeError, f, GetOnly(), 10)
 
     def test_cmp_err(self):
         seq = [CmpErr(), CmpErr(), CmpErr()]
-        for f in (bisect_left, bisect_right, insort_left, insort_right):
+        for f in (self.module.bisect_left, self.module.bisect_right,
+                  self.module.insort_left, self.module.insort_right):
             self.assertRaises(ZeroDivisionError, f, seq, 10)
 
     def test_arg_parsing(self):
-        for f in (bisect_left, bisect_right, insort_left, insort_right):
+        for f in (self.module.bisect_left, self.module.bisect_right,
+                  self.module.insort_left, self.module.insort_right):
             self.assertRaises(TypeError, f, 10)
 
+class TestErrorHandlingPython(TestErrorHandling):
+    module = py_bisect
+
+class TestErrorHandlingC(TestErrorHandling):
+    module = c_bisect
+
 #==============================================================================
 
 libreftest = """
-Example from the Library Reference:  Doc/lib/libbisect.tex
+Example from the Library Reference:  Doc/library/bisect.rst
 
 The bisect() function is generally useful for categorizing numeric data.
 This example uses bisect() to look up a letter grade for an exam total
@@ -229,12 +276,10 @@
 
 def test_main(verbose=None):
     from test import test_bisect
-    from types import BuiltinFunctionType
-    import sys
 
-    test_classes = [TestBisect, TestInsort]
-    if isinstance(bisect_left, BuiltinFunctionType):
-        test_classes.append(TestErrorHandling)
+    test_classes = [TestBisectPython, TestBisectC,
+                    TestInsortPython, TestInsortC,
+                    TestErrorHandlingPython, TestErrorHandlingC]
 
     test_support.run_unittest(*test_classes)
     test_support.run_doctest(test_bisect, verbose)

Modified: python/branches/trunk-math/Lib/test/test_bsddb185.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_bsddb185.py	(original)
+++ python/branches/trunk-math/Lib/test/test_bsddb185.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,7 @@
 testing suite.
 
 """
-from test.test_support import verbose, run_unittest, findfile
+from test.test_support import run_unittest, findfile
 import unittest
 import bsddb185
 import anydbm

Modified: python/branches/trunk-math/Lib/test/test_bsddb3.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_bsddb3.py	(original)
+++ python/branches/trunk-math/Lib/test/test_bsddb3.py	Thu Feb 28 21:09:17 2008
@@ -2,10 +2,12 @@
 """
 Run all test cases.
 """
+import os
 import sys
+import tempfile
 import time
 import unittest
-from test.test_support import requires, verbose, run_unittest, unlink
+from test.test_support import requires, verbose, run_unittest, unlink, rmtree
 
 # When running as a script instead of within the regrtest framework, skip the
 # requires test, since it's obvious we want to run them.
@@ -85,6 +87,15 @@
 # For invocation through regrtest
 def test_main():
     run_unittest(suite())
+    db_home = os.path.join(tempfile.gettempdir(), 'db_home')
+    # The only reason to remove db_home is in case if there is an old
+    # one lying around.  This might be by a different user, so just
+    # ignore errors.  We should always make a unique name now.
+    try:
+        rmtree(db_home)
+    except:
+        pass
+    rmtree('db_home%d' % os.getpid())
 
 # For invocation as a script
 if __name__ == '__main__':

Modified: python/branches/trunk-math/Lib/test/test_builtin.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_builtin.py	(original)
+++ python/branches/trunk-math/Lib/test/test_builtin.py	Thu Feb 28 21:09:17 2008
@@ -1983,6 +1983,110 @@
                     return i
         self.assertRaises(ValueError, zip, BadSeq(), BadSeq())
 
+    def test_format(self):
+        # Test the basic machinery of the format() builtin.  Don't test
+        #  the specifics of the various formatters
+        self.assertEqual(format(3, ''), '3')
+
+        # Returns some classes to use for various tests.  There's
+        #  an old-style version, and a new-style version
+        def classes_new():
+            class A(object):
+                def __init__(self, x):
+                    self.x = x
+                def __format__(self, format_spec):
+                    return str(self.x) + format_spec
+            class DerivedFromA(A):
+                pass
+
+            class Simple(object): pass
+            class DerivedFromSimple(Simple):
+                def __init__(self, x):
+                    self.x = x
+                def __format__(self, format_spec):
+                    return str(self.x) + format_spec
+            class DerivedFromSimple2(DerivedFromSimple): pass
+            return A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2
+
+        # In 3.0, classes_classic has the same meaning as classes_new
+        def classes_classic():
+            class A:
+                def __init__(self, x):
+                    self.x = x
+                def __format__(self, format_spec):
+                    return str(self.x) + format_spec
+            class DerivedFromA(A):
+                pass
+
+            class Simple: pass
+            class DerivedFromSimple(Simple):
+                def __init__(self, x):
+                    self.x = x
+                def __format__(self, format_spec):
+                    return str(self.x) + format_spec
+            class DerivedFromSimple2(DerivedFromSimple): pass
+            return A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2
+
+        def class_test(A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2):
+            self.assertEqual(format(A(3), 'spec'), '3spec')
+            self.assertEqual(format(DerivedFromA(4), 'spec'), '4spec')
+            self.assertEqual(format(DerivedFromSimple(5), 'abc'), '5abc')
+            self.assertEqual(format(DerivedFromSimple2(10), 'abcdef'),
+                             '10abcdef')
+
+        class_test(*classes_new())
+        class_test(*classes_classic())
+
+        def empty_format_spec(value):
+            # test that:
+            #  format(x, '') == str(x)
+            #  format(x) == str(x)
+            self.assertEqual(format(value, ""), str(value))
+            self.assertEqual(format(value), str(value))
+
+        # for builtin types, format(x, "") == str(x)
+        empty_format_spec(17**13)
+        empty_format_spec(1.0)
+        empty_format_spec(3.1415e104)
+        empty_format_spec(-3.1415e104)
+        empty_format_spec(3.1415e-104)
+        empty_format_spec(-3.1415e-104)
+        empty_format_spec(object)
+        empty_format_spec(None)
+
+        # TypeError because self.__format__ returns the wrong type
+        class BadFormatResult:
+            def __format__(self, format_spec):
+                return 1.0
+        self.assertRaises(TypeError, format, BadFormatResult(), "")
+
+        # TypeError because format_spec is not unicode or str
+        self.assertRaises(TypeError, format, object(), 4)
+        self.assertRaises(TypeError, format, object(), object())
+
+        # tests for object.__format__ really belong elsewhere, but
+        #  there's no good place to put them
+        x = object().__format__('')
+        self.assert_(x.startswith('<object object at'))
+
+        # first argument to object.__format__ must be string
+        self.assertRaises(TypeError, object().__format__, 3)
+        self.assertRaises(TypeError, object().__format__, object())
+        self.assertRaises(TypeError, object().__format__, None)
+
+        # make sure we can take a subclass of str as a format spec
+        class DerivedFromStr(str): pass
+        self.assertEqual(format(0, DerivedFromStr('10')), '         0')
+
+    def test_bin(self):
+        self.assertEqual(bin(0), '0b0')
+        self.assertEqual(bin(1), '0b1')
+        self.assertEqual(bin(-1), '-0b1')
+        self.assertEqual(bin(2**65), '0b1' + '0' * 65)
+        self.assertEqual(bin(2**65-1), '0b' + '1' * 65)
+        self.assertEqual(bin(-(2**65)), '-0b1' + '0' * 65)
+        self.assertEqual(bin(-(2**65-1)), '-0b' + '1' * 65)
+
 class TestSorted(unittest.TestCase):
 
     def test_basic(self):

Modified: python/branches/trunk-math/Lib/test/test_cfgparser.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_cfgparser.py	(original)
+++ python/branches/trunk-math/Lib/test/test_cfgparser.py	Thu Feb 28 21:09:17 2008
@@ -446,6 +446,14 @@
         self.assertRaises(TypeError, cf.set, "sect", "option2", 1.0)
         self.assertRaises(TypeError, cf.set, "sect", "option2", object())
 
+    def test_add_section_default_1(self):
+        cf = self.newconfig()
+        self.assertRaises(ValueError, cf.add_section, "default")
+
+    def test_add_section_default_2(self):
+        cf = self.newconfig()
+        self.assertRaises(ValueError, cf.add_section, "DEFAULT")
+
 class SortedTestCase(RawConfigParserTestCase):
     def newconfig(self, defaults=None):
         self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)

Modified: python/branches/trunk-math/Lib/test/test_class.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_class.py	(original)
+++ python/branches/trunk-math/Lib/test/test_class.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 "Test the functionality of Python classes implementing operators."
 
 import unittest
-import sys
 
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_cmd.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_cmd.py	(original)
+++ python/branches/trunk-math/Lib/test/test_cmd.py	Thu Feb 28 21:09:17 2008
@@ -5,7 +5,6 @@
 """
 
 
-from test import test_support
 import cmd
 import sys
 
@@ -170,7 +169,7 @@
     from test import test_support, test_cmd
     test_support.run_doctest(test_cmd, verbose)
 
-import trace, sys,re,StringIO
+import trace, sys
 def test_coverage(coverdir):
     tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
                         trace=0, count=1)

Modified: python/branches/trunk-math/Lib/test/test_coercion.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_coercion.py	(original)
+++ python/branches/trunk-math/Lib/test/test_coercion.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import copy
-import sys
 import warnings
 import unittest
 from test.test_support import run_unittest, TestFailed

Modified: python/branches/trunk-math/Lib/test/test_compare.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_compare.py	(original)
+++ python/branches/trunk-math/Lib/test/test_compare.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,3 @@
-import sys
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_compiler.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_compiler.py	(original)
+++ python/branches/trunk-math/Lib/test/test_compiler.py	Thu Feb 28 21:09:17 2008
@@ -52,7 +52,8 @@
                         compiler.compile(buf, basename, "exec")
                     except Exception, e:
                         args = list(e.args)
-                        args[0] += "[in file %s]" % basename
+                        args.append("in file %s]" % basename)
+                        #args[0] += "[in file %s]" % basename
                         e.args = tuple(args)
                         raise
 

Modified: python/branches/trunk-math/Lib/test/test_copy.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_copy.py	(original)
+++ python/branches/trunk-math/Lib/test/test_copy.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 """Unit tests for the copy module."""
 
-import sys
 import copy
 import copy_reg
 

Modified: python/branches/trunk-math/Lib/test/test_cpickle.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_cpickle.py	(original)
+++ python/branches/trunk-math/Lib/test/test_cpickle.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import cPickle
-import unittest
 from cStringIO import StringIO
 from test.pickletester import AbstractPickleTests, AbstractPickleModuleTests
 from test import test_support

Modified: python/branches/trunk-math/Lib/test/test_curses.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_curses.py	(original)
+++ python/branches/trunk-math/Lib/test/test_curses.py	Thu Feb 28 21:09:17 2008
@@ -269,13 +269,12 @@
     curses.wrapper(main)
     unit_tests()
 else:
+    # testing setupterm() inside initscr/endwin
+    # causes terminal breakage
+    curses.setupterm(fd=sys.__stdout__.fileno())
     try:
-        # testing setupterm() inside initscr/endwin
-        # causes terminal breakage
-        curses.setupterm(fd=sys.__stdout__.fileno())
         stdscr = curses.initscr()
         main(stdscr)
     finally:
         curses.endwin()
-
     unit_tests()

Modified: python/branches/trunk-math/Lib/test/test_datetime.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_datetime.py	(original)
+++ python/branches/trunk-math/Lib/test/test_datetime.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,6 @@
 """
 
 import os
-import sys
 import pickle
 import cPickle
 import unittest
@@ -854,6 +853,32 @@
         # A naive object replaces %z and %Z w/ empty strings.
         self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
 
+    def test_format(self):
+        dt = self.theclass(2007, 9, 10)
+        self.assertEqual(dt.__format__(''), str(dt))
+
+        # check that a derived class's __str__() gets called
+        class A(self.theclass):
+            def __str__(self):
+                return 'A'
+        a = A(2007, 9, 10)
+        self.assertEqual(a.__format__(''), 'A')
+
+        # check that a derived class's strftime gets called
+        class B(self.theclass):
+            def strftime(self, format_spec):
+                return 'B'
+        b = B(2007, 9, 10)
+        self.assertEqual(b.__format__(''), str(dt))
+
+        for fmt in ["m:%m d:%d y:%y",
+                    "m:%m d:%d y:%y H:%H M:%M S:%S",
+                    "%z %Z",
+                    ]:
+            self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
+            self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
+            self.assertEqual(b.__format__(fmt), 'B')
+
     def test_resolution_info(self):
         self.assert_(isinstance(self.theclass.min, self.theclass))
         self.assert_(isinstance(self.theclass.max, self.theclass))
@@ -1136,6 +1161,32 @@
         # str is ISO format with the separator forced to a blank.
         self.assertEqual(str(t), "0002-03-02 00:00:00")
 
+    def test_format(self):
+        dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
+        self.assertEqual(dt.__format__(''), str(dt))
+
+        # check that a derived class's __str__() gets called
+        class A(self.theclass):
+            def __str__(self):
+                return 'A'
+        a = A(2007, 9, 10, 4, 5, 1, 123)
+        self.assertEqual(a.__format__(''), 'A')
+
+        # check that a derived class's strftime gets called
+        class B(self.theclass):
+            def strftime(self, format_spec):
+                return 'B'
+        b = B(2007, 9, 10, 4, 5, 1, 123)
+        self.assertEqual(b.__format__(''), str(dt))
+
+        for fmt in ["m:%m d:%d y:%y",
+                    "m:%m d:%d y:%y H:%H M:%M S:%S",
+                    "%z %Z",
+                    ]:
+            self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
+            self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
+            self.assertEqual(b.__format__(fmt), 'B')
+
     def test_more_ctime(self):
         # Test fields that TestDate doesn't touch.
         import time
@@ -1767,6 +1818,30 @@
         # A naive object replaces %z and %Z with empty strings.
         self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
 
+    def test_format(self):
+        t = self.theclass(1, 2, 3, 4)
+        self.assertEqual(t.__format__(''), str(t))
+
+        # check that a derived class's __str__() gets called
+        class A(self.theclass):
+            def __str__(self):
+                return 'A'
+        a = A(1, 2, 3, 4)
+        self.assertEqual(a.__format__(''), 'A')
+
+        # check that a derived class's strftime gets called
+        class B(self.theclass):
+            def strftime(self, format_spec):
+                return 'B'
+        b = B(1, 2, 3, 4)
+        self.assertEqual(b.__format__(''), str(t))
+
+        for fmt in ['%H %M %S',
+                    ]:
+            self.assertEqual(t.__format__(fmt), t.strftime(fmt))
+            self.assertEqual(a.__format__(fmt), t.strftime(fmt))
+            self.assertEqual(b.__format__(fmt), 'B')
+
     def test_str(self):
         self.assertEqual(str(self.theclass(1, 2, 3, 4)), "01:02:03.000004")
         self.assertEqual(str(self.theclass(10, 2, 3, 4000)), "10:02:03.004000")

Modified: python/branches/trunk-math/Lib/test/test_dbm.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_dbm.py	(original)
+++ python/branches/trunk-math/Lib/test/test_dbm.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
    Roger E. Masse
 """
 import os
-import random
 import dbm
 from dbm import error
 from test.test_support import verbose, verify, TestSkipped, TESTFN

Modified: python/branches/trunk-math/Lib/test/test_decorators.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_decorators.py	(original)
+++ python/branches/trunk-math/Lib/test/test_decorators.py	Thu Feb 28 21:09:17 2008
@@ -266,8 +266,44 @@
         self.assertEqual(bar(), 42)
         self.assertEqual(actions, expected_actions)
 
+class TestClassDecorators(unittest.TestCase):
+
+    def test_simple(self):
+        def plain(x):
+            x.extra = 'Hello'
+            return x
+        @plain
+        class C(object): pass
+        self.assertEqual(C.extra, 'Hello')
+
+    def test_double(self):
+        def ten(x):
+            x.extra = 10
+            return x
+        def add_five(x):
+            x.extra += 5
+            return x
+
+        @add_five
+        @ten
+        class C(object): pass
+        self.assertEqual(C.extra, 15)
+
+    def test_order(self):
+        def applied_first(x):
+            x.extra = 'first'
+            return x
+        def applied_second(x):
+            x.extra = 'second'
+            return x
+        @applied_second
+        @applied_first
+        class C(object): pass
+        self.assertEqual(C.extra, 'second')
+
 def test_main():
     test_support.run_unittest(TestDecorators)
+    test_support.run_unittest(TestClassDecorators)
 
 if __name__=="__main__":
     test_main()

Modified: python/branches/trunk-math/Lib/test/test_deque.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_deque.py	(original)
+++ python/branches/trunk-math/Lib/test/test_deque.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,6 @@
 from weakref import proxy
 import copy
 import cPickle as pickle
-from cStringIO import StringIO
 import random
 import os
 

Modified: python/branches/trunk-math/Lib/test/test_descrtut.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_descrtut.py	(original)
+++ python/branches/trunk-math/Lib/test/test_descrtut.py	Thu Feb 28 21:09:17 2008
@@ -183,6 +183,7 @@
      '__delslice__',
      '__doc__',
      '__eq__',
+     '__format__',
      '__ge__',
      '__getattribute__',
      '__getitem__',
@@ -208,6 +209,7 @@
      '__setitem__',
      '__setslice__',
      '__str__',
+     '__subclasshook__',
      'append',
      'count',
      'extend',

Modified: python/branches/trunk-math/Lib/test/test_dict.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_dict.py	(original)
+++ python/branches/trunk-math/Lib/test/test_dict.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,7 @@
 import unittest
 from test import test_support
 
-import sys, UserDict, cStringIO, random, string
+import UserDict, random, string
 
 
 class DictTest(unittest.TestCase):

Modified: python/branches/trunk-math/Lib/test/test_dis.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_dis.py	(original)
+++ python/branches/trunk-math/Lib/test/test_dis.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,6 @@
 # Minimal tests for dis module
 
-from test.test_support import verbose, run_unittest
+from test.test_support import run_unittest
 import unittest
 import sys
 import dis

Modified: python/branches/trunk-math/Lib/test/test_doctest.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_doctest.py	(original)
+++ python/branches/trunk-math/Lib/test/test_doctest.py	Thu Feb 28 21:09:17 2008
@@ -2418,7 +2418,7 @@
     from test import test_doctest
     test_support.run_doctest(test_doctest, verbosity=True)
 
-import trace, sys, re, StringIO
+import trace, sys
 def test_coverage(coverdir):
     tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
                          trace=0, count=1)

Modified: python/branches/trunk-math/Lib/test/test_dummy_threading.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_dummy_threading.py	(original)
+++ python/branches/trunk-math/Lib/test/test_dummy_threading.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
 # Create a bunch of threads, let each do some work, wait until all are done
 
 from test.test_support import verbose
-import random
 import dummy_threading as _threading
 import time
 

Modified: python/branches/trunk-math/Lib/test/test_email.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_email.py	(original)
+++ python/branches/trunk-math/Lib/test/test_email.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Copyright (C) 2001,2002 Python Software Foundation
 # email package unit tests
 
-import unittest
 # The specific tests now live in Lib/email/test
 from email.test.test_email import suite
 from test import test_support

Modified: python/branches/trunk-math/Lib/test/test_email_renamed.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_email_renamed.py	(original)
+++ python/branches/trunk-math/Lib/test/test_email_renamed.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Copyright (C) 2001-2006 Python Software Foundation
 # email package unit tests
 
-import unittest
 # The specific tests now live in Lib/email/test
 from email.test.test_email_renamed import suite
 from test import test_support

Modified: python/branches/trunk-math/Lib/test/test_eof.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_eof.py	(original)
+++ python/branches/trunk-math/Lib/test/test_eof.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 #! /usr/bin/env python
 """test script for a few new invalid token catches"""
 
-import os
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_extcall.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_extcall.py	(original)
+++ python/branches/trunk-math/Lib/test/test_extcall.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,4 @@
-from test.test_support import verify, verbose, TestFailed, sortdict
+from test.test_support import verify, TestFailed, sortdict
 from UserList import UserList
 from UserDict import UserDict
 

Modified: python/branches/trunk-math/Lib/test/test_file.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_file.py	(original)
+++ python/branches/trunk-math/Lib/test/test_file.py	Thu Feb 28 21:09:17 2008
@@ -322,12 +322,28 @@
         finally:
             os.unlink(TESTFN)
 
+class FileSubclassTests(unittest.TestCase):
+
+    def testExit(self):
+        # test that exiting with context calls subclass' close
+        class C(file):
+            def __init__(self, *args):
+                self.subclass_closed = False
+                file.__init__(self, *args)
+            def close(self):
+                self.subclass_closed = True
+                file.close(self)
+
+        with C(TESTFN, 'w') as f:
+            pass
+        self.failUnless(f.subclass_closed)
+
 
 def test_main():
     # Historically, these tests have been sloppy about removing TESTFN.
     # So get rid of it no matter what.
     try:
-        run_unittest(AutoFileTests, OtherFileTests)
+        run_unittest(AutoFileTests, OtherFileTests, FileSubclassTests)
     finally:
         if os.path.exists(TESTFN):
             os.unlink(TESTFN)

Modified: python/branches/trunk-math/Lib/test/test_fileinput.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_fileinput.py	(original)
+++ python/branches/trunk-math/Lib/test/test_fileinput.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 import unittest
 from test.test_support import verbose, TESTFN, run_unittest
 from test.test_support import unlink as safe_unlink
-import sys, os, re
+import sys, re
 from StringIO import StringIO
 from fileinput import FileInput, hook_encoded
 

Modified: python/branches/trunk-math/Lib/test/test_format.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_format.py	(original)
+++ python/branches/trunk-math/Lib/test/test_format.py	Thu Feb 28 21:09:17 2008
@@ -11,7 +11,7 @@
 overflowok = 1
 overflowrequired = 0
 
-def testformat(formatstr, args, output=None):
+def testformat(formatstr, args, output=None, limit=None):
     if verbose:
         if output:
             print "%s %% %s =? %s ..." %\
@@ -31,7 +31,18 @@
                 print 'no'
             print "overflow expected on %s %% %s" % \
                   (repr(formatstr), repr(args))
-        elif output and result != output:
+        elif output and limit is None and result != output:
+            if verbose:
+                print 'no'
+            print "%s %% %s == %s != %s" % \
+                  (repr(formatstr), repr(args), repr(result), repr(output))
+        # when 'limit' is specified, it determines how many characters
+        # must match exactly; lengths must always match.
+        # ex: limit=5, '12345678' matches '12345___'
+        # (mainly for floating point format tests for which an exact match
+        # can't be guaranteed due to rounding and representation errors)
+        elif output and limit is not None and (
+                len(result)!=len(output) or result[:limit]!=output[:limit]):
             if verbose:
                 print 'no'
             print "%s %% %s == %s != %s" % \
@@ -98,6 +109,7 @@
 testboth("%.30d", big, "123456789012345678901234567890")
 testboth("%.31d", big, "0123456789012345678901234567890")
 testboth("%32.31d", big, " 0123456789012345678901234567890")
+testboth("%d", float(big), "123456________________________", 6)
 
 big = 0x1234567890abcdef12345L  # 21 hex digits
 testboth("%x", big, "1234567890abcdef12345")
@@ -135,6 +147,7 @@
 testboth("%#+027.23X", big, "+0X0001234567890ABCDEF12345")
 # same, except no 0 flag
 testboth("%#+27.23X", big, " +0X001234567890ABCDEF12345")
+testboth("%x", float(big), "123456_______________", 6)
 
 big = 012345670123456701234567012345670L  # 32 octal digits
 testboth("%o", big, "12345670123456701234567012345670")
@@ -175,16 +188,19 @@
 testboth("%034.33o", big, "0012345670123456701234567012345670")
 # base marker shouldn't change that
 testboth("%0#34.33o", big, "0012345670123456701234567012345670")
+testboth("%o", float(big), "123456__________________________", 6)
 
 # Some small ints, in both Python int and long flavors).
 testboth("%d", 42, "42")
 testboth("%d", -42, "-42")
 testboth("%d", 42L, "42")
 testboth("%d", -42L, "-42")
+testboth("%d", 42.0, "42")
 testboth("%#x", 1, "0x1")
 testboth("%#x", 1L, "0x1")
 testboth("%#X", 1, "0X1")
 testboth("%#X", 1L, "0X1")
+testboth("%#x", 1.0, "0x1")
 testboth("%#o", 1, "01")
 testboth("%#o", 1L, "01")
 testboth("%#o", 0, "0")
@@ -202,11 +218,13 @@
 testboth("%x", -0x42, "-42")
 testboth("%x", 0x42L, "42")
 testboth("%x", -0x42L, "-42")
+testboth("%x", float(0x42), "42")
 
 testboth("%o", 042, "42")
 testboth("%o", -042, "-42")
 testboth("%o", 042L, "42")
 testboth("%o", -042L, "-42")
+testboth("%o", float(042), "42")
 
 # Test exception for unknown format characters
 if verbose:
@@ -235,7 +253,7 @@
     test_exc(unicode('abc %\u3000','raw-unicode-escape'), 1, ValueError,
              "unsupported format character '?' (0x3000) at index 5")
 
-test_exc('%d', '1', TypeError, "int argument required, not str")
+test_exc('%d', '1', TypeError, "%d format: a number is required, not str")
 test_exc('%g', '1', TypeError, "float argument required, not str")
 test_exc('no format', '1', TypeError,
          "not all arguments converted during string formatting")

Modified: python/branches/trunk-math/Lib/test/test_fractions.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_fractions.py	(original)
+++ python/branches/trunk-math/Lib/test/test_fractions.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,7 @@
 """Tests for Lib/fractions.py."""
 
 from decimal import Decimal
-from test.test_support import run_unittest, verbose
+from test.test_support import run_unittest
 import math
 import operator
 import fractions

Modified: python/branches/trunk-math/Lib/test/test_ftplib.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_ftplib.py	(original)
+++ python/branches/trunk-math/Lib/test/test_ftplib.py	Thu Feb 28 21:09:17 2008
@@ -6,32 +6,47 @@
 from unittest import TestCase
 from test import test_support
 
+server_port = None
+
+# This function sets the evt 3 times:
+#  1) when the connection is ready to be accepted.
+#  2) when it is safe for the caller to close the connection
+#  3) when we have closed the socket
 def server(evt):
+    global server_port
     serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     serv.settimeout(3)
     serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-    serv.bind(("", 9091))
+    server_port = test_support.bind_port(serv, "", 9091)
     serv.listen(5)
+    # (1) Signal the caller that we are ready to accept the connection.
+    evt.set()
     try:
         conn, addr = serv.accept()
     except socket.timeout:
         pass
     else:
         conn.send("1 Hola mundo\n")
+        # (2) Signal the caller that it is safe to close the socket.
+        evt.set()
         conn.close()
     finally:
         serv.close()
+        # (3) Signal the caller that we are done.
         evt.set()
 
 class GeneralTests(TestCase):
 
     def setUp(self):
-        ftplib.FTP.port = 9091
         self.evt = threading.Event()
         threading.Thread(target=server, args=(self.evt,)).start()
-        time.sleep(.1)
+        # Wait for the server to be ready.
+        self.evt.wait()
+        self.evt.clear()
+        ftplib.FTP.port = server_port
 
     def tearDown(self):
+        # Wait on the closing of the socket (this shouldn't be necessary).
         self.evt.wait()
 
     def testBasic(self):
@@ -40,30 +55,35 @@
 
         # connects
         ftp = ftplib.FTP("localhost")
+        self.evt.wait()
         ftp.sock.close()
 
     def testTimeoutDefault(self):
         # default
         ftp = ftplib.FTP("localhost")
         self.assertTrue(ftp.sock.gettimeout() is None)
+        self.evt.wait()
         ftp.sock.close()
 
     def testTimeoutValue(self):
         # a value
         ftp = ftplib.FTP("localhost", timeout=30)
         self.assertEqual(ftp.sock.gettimeout(), 30)
+        self.evt.wait()
         ftp.sock.close()
 
     def testTimeoutConnect(self):
         ftp = ftplib.FTP()
         ftp.connect("localhost", timeout=30)
         self.assertEqual(ftp.sock.gettimeout(), 30)
+        self.evt.wait()
         ftp.sock.close()
 
     def testTimeoutDifferentOrder(self):
         ftp = ftplib.FTP(timeout=30)
         ftp.connect("localhost")
         self.assertEqual(ftp.sock.gettimeout(), 30)
+        self.evt.wait()
         ftp.sock.close()
 
     def testTimeoutDirectAccess(self):
@@ -71,6 +91,7 @@
         ftp.timeout = 30
         ftp.connect("localhost")
         self.assertEqual(ftp.sock.gettimeout(), 30)
+        self.evt.wait()
         ftp.sock.close()
 
     def testTimeoutNone(self):
@@ -82,10 +103,10 @@
         finally:
             socket.setdefaulttimeout(previous)
         self.assertEqual(ftp.sock.gettimeout(), 30)
+        self.evt.wait()
         ftp.close()
 
 
-
 def test_main(verbose=None):
     test_support.run_unittest(GeneralTests)
 

Modified: python/branches/trunk-math/Lib/test/test_getargs2.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_getargs2.py	(original)
+++ python/branches/trunk-math/Lib/test/test_getargs2.py	Thu Feb 28 21:09:17 2008
@@ -1,8 +1,8 @@
 import unittest
 from test import test_support
-import sys
+from _testcapi import getargs_keywords
 
-import warnings, re
+import warnings
 warnings.filterwarnings("ignore",
                         category=DeprecationWarning,
                         message=".*integer argument expected, got float",
@@ -249,9 +249,57 @@
                 raise ValueError
         self.assertRaises(TypeError, getargs_tuple, 1, seq())
 
+class Keywords_TestCase(unittest.TestCase):
+    def test_positional_args(self):
+        # using all positional args
+        self.assertEquals(
+            getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), 10),
+            (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
+            )
+    def test_mixed_args(self):
+        # positional and keyword args
+        self.assertEquals(
+            getargs_keywords((1,2), 3, (4,(5,6)), arg4=(7,8,9), arg5=10),
+            (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
+            )
+    def test_keyword_args(self):
+        # all keywords
+        self.assertEquals(
+            getargs_keywords(arg1=(1,2), arg2=3, arg3=(4,(5,6)), arg4=(7,8,9), arg5=10),
+            (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
+            )
+    def test_optional_args(self):
+        # missing optional keyword args, skipping tuples
+        self.assertEquals(
+            getargs_keywords(arg1=(1,2), arg2=3, arg5=10),
+            (1, 2, 3, -1, -1, -1, -1, -1, -1, 10)
+            )
+    def test_required_args(self):
+        # required arg missing
+        try:
+            getargs_keywords(arg1=(1,2))
+        except TypeError, err:
+            self.assertEquals(str(err), "Required argument 'arg2' (pos 2) not found")
+        else:
+            self.fail('TypeError should have been raised')
+    def test_too_many_args(self):
+        try:
+            getargs_keywords((1,2),3,(4,(5,6)),(7,8,9),10,111)
+        except TypeError, err:
+            self.assertEquals(str(err), "function takes at most 5 arguments (6 given)")
+        else:
+            self.fail('TypeError should have been raised')
+    def test_invalid_keyword(self):
+        # extraneous keyword arg
+        try:
+            getargs_keywords((1,2),3,arg5=10,arg666=666)
+        except TypeError, err:
+            self.assertEquals(str(err), "'arg666' is an invalid keyword argument for this function")
+        else:
+            self.fail('TypeError should have been raised')
 
 def test_main():
-    tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase]
+    tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase, Keywords_TestCase]
     try:
         from _testcapi import getargs_L, getargs_K
     except ImportError:

Modified: python/branches/trunk-math/Lib/test/test_grammar.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_grammar.py	(original)
+++ python/branches/trunk-math/Lib/test/test_grammar.py	Thu Feb 28 21:09:17 2008
@@ -779,6 +779,16 @@
             def meth1(self): pass
             def meth2(self, arg): pass
             def meth3(self, a1, a2): pass
+        # decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
+        # decorators: decorator+
+        # decorated: decorators (classdef | funcdef)
+        def class_decorator(x):
+            x.decorated = True
+            return x
+        @class_decorator
+        class G:
+            pass
+        self.assertEqual(G.decorated, True)
 
     def testListcomps(self):
         # list comprehension tests

Modified: python/branches/trunk-math/Lib/test/test_gzip.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_gzip.py	(original)
+++ python/branches/trunk-math/Lib/test/test_gzip.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,7 @@
 
 import unittest
 from test import test_support
-import sys, os
+import os
 import gzip
 
 

Modified: python/branches/trunk-math/Lib/test/test_heapq.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_heapq.py	(original)
+++ python/branches/trunk-math/Lib/test/test_heapq.py	Thu Feb 28 21:09:17 2008
@@ -1,21 +1,32 @@
 """Unittests for heapq."""
 
-from heapq import heappush, heappop, heapify, heapreplace, merge, nlargest, nsmallest
 import random
 import unittest
 from test import test_support
 import sys
 
+# We do a bit of trickery here to be able to test both the C implementation
+# and the Python implementation of the module.
+
+# Make it impossible to import the C implementation anymore.
+sys.modules['_heapq'] = 0
+# We must also handle the case that heapq was imported before.
+if 'heapq' in sys.modules:
+    del sys.modules['heapq']
+
+# Now we can import the module and get the pure Python implementation.
+import heapq as py_heapq
+
+# Restore everything to normal.
+del sys.modules['_heapq']
+del sys.modules['heapq']
+
+# This is now the module with the C implementation.
+import heapq as c_heapq
 
-def heapiter(heap):
-    # An iterator returning a heap's elements, smallest-first.
-    try:
-        while 1:
-            yield heappop(heap)
-    except IndexError:
-        pass
 
 class TestHeap(unittest.TestCase):
+    module = None
 
     def test_push_pop(self):
         # 1) Push 256 random numbers and pop them off, verifying all's OK.
@@ -25,11 +36,11 @@
         for i in range(256):
             item = random.random()
             data.append(item)
-            heappush(heap, item)
+            self.module.heappush(heap, item)
             self.check_invariant(heap)
         results = []
         while heap:
-            item = heappop(heap)
+            item = self.module.heappop(heap)
             self.check_invariant(heap)
             results.append(item)
         data_sorted = data[:]
@@ -38,10 +49,10 @@
         # 2) Check that the invariant holds for a sorted array
         self.check_invariant(results)
 
-        self.assertRaises(TypeError, heappush, [])
+        self.assertRaises(TypeError, self.module.heappush, [])
         try:
-            self.assertRaises(TypeError, heappush, None, None)
-            self.assertRaises(TypeError, heappop, None)
+            self.assertRaises(TypeError, self.module.heappush, None, None)
+            self.assertRaises(TypeError, self.module.heappop, None)
         except AttributeError:
             pass
 
@@ -55,21 +66,29 @@
     def test_heapify(self):
         for size in range(30):
             heap = [random.random() for dummy in range(size)]
-            heapify(heap)
+            self.module.heapify(heap)
             self.check_invariant(heap)
 
-        self.assertRaises(TypeError, heapify, None)
+        self.assertRaises(TypeError, self.module.heapify, None)
 
     def test_naive_nbest(self):
         data = [random.randrange(2000) for i in range(1000)]
         heap = []
         for item in data:
-            heappush(heap, item)
+            self.module.heappush(heap, item)
             if len(heap) > 10:
-                heappop(heap)
+                self.module.heappop(heap)
         heap.sort()
         self.assertEqual(heap, sorted(data)[-10:])
 
+    def heapiter(self, heap):
+        # An iterator returning a heap's elements, smallest-first.
+        try:
+            while 1:
+                yield self.module.heappop(heap)
+        except IndexError:
+            pass
+
     def test_nbest(self):
         # Less-naive "N-best" algorithm, much faster (if len(data) is big
         # enough <wink>) than sorting all of data.  However, if we had a max
@@ -78,15 +97,15 @@
         # (10 log-time steps).
         data = [random.randrange(2000) for i in range(1000)]
         heap = data[:10]
-        heapify(heap)
+        self.module.heapify(heap)
         for item in data[10:]:
             if item > heap[0]:  # this gets rarer the longer we run
-                heapreplace(heap, item)
-        self.assertEqual(list(heapiter(heap)), sorted(data)[-10:])
+                self.module.heapreplace(heap, item)
+        self.assertEqual(list(self.heapiter(heap)), sorted(data)[-10:])
 
-        self.assertRaises(TypeError, heapreplace, None)
-        self.assertRaises(TypeError, heapreplace, None, None)
-        self.assertRaises(IndexError, heapreplace, [], None)
+        self.assertRaises(TypeError, self.module.heapreplace, None)
+        self.assertRaises(TypeError, self.module.heapreplace, None, None)
+        self.assertRaises(IndexError, self.module.heapreplace, [], None)
 
     def test_heapsort(self):
         # Exercise everything with repeated heapsort checks
@@ -95,12 +114,12 @@
             data = [random.randrange(25) for i in range(size)]
             if trial & 1:     # Half of the time, use heapify
                 heap = data[:]
-                heapify(heap)
+                self.module.heapify(heap)
             else:             # The rest of the time, use heappush
                 heap = []
                 for item in data:
-                    heappush(heap, item)
-            heap_sorted = [heappop(heap) for i in range(size)]
+                    self.module.heappush(heap, item)
+            heap_sorted = [self.module.heappop(heap) for i in range(size)]
             self.assertEqual(heap_sorted, sorted(data))
 
     def test_merge(self):
@@ -108,8 +127,8 @@
         for i in xrange(random.randrange(5)):
             row = sorted(random.randrange(1000) for j in range(random.randrange(10)))
             inputs.append(row)
-        self.assertEqual(sorted(chain(*inputs)), list(merge(*inputs)))
-        self.assertEqual(list(merge()), [])
+        self.assertEqual(sorted(chain(*inputs)), list(self.module.merge(*inputs)))
+        self.assertEqual(list(self.module.merge()), [])
 
     def test_merge_stability(self):
         class Int(int):
@@ -123,25 +142,32 @@
             inputs[stream].append(obj)
         for stream in inputs:
             stream.sort()
-        result = [i.pair for i in merge(*inputs)]
+        result = [i.pair for i in self.module.merge(*inputs)]
         self.assertEqual(result, sorted(result))
 
     def test_nsmallest(self):
         data = [(random.randrange(2000), i) for i in range(1000)]
         for f in (None, lambda x:  x[0] * 547 % 2000):
             for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
-                self.assertEqual(nsmallest(n, data), sorted(data)[:n])
-                self.assertEqual(nsmallest(n, data, key=f),
+                self.assertEqual(self.module.nsmallest(n, data), sorted(data)[:n])
+                self.assertEqual(self.module.nsmallest(n, data, key=f),
                                  sorted(data, key=f)[:n])
 
     def test_nlargest(self):
         data = [(random.randrange(2000), i) for i in range(1000)]
         for f in (None, lambda x:  x[0] * 547 % 2000):
             for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
-                self.assertEqual(nlargest(n, data), sorted(data, reverse=True)[:n])
-                self.assertEqual(nlargest(n, data, key=f),
+                self.assertEqual(self.module.nlargest(n, data),
+                                 sorted(data, reverse=True)[:n])
+                self.assertEqual(self.module.nlargest(n, data, key=f),
                                  sorted(data, key=f, reverse=True)[:n])
 
+class TestHeapPython(TestHeap):
+    module = py_heapq
+
+class TestHeapC(TestHeap):
+    module = c_heapq
+
 
 #==============================================================================
 
@@ -238,44 +264,49 @@
     return chain(imap(lambda x:x, R(Ig(G(seqn)))))
 
 class TestErrorHandling(unittest.TestCase):
+    # only for C implementation
+    module = c_heapq
 
     def test_non_sequence(self):
-        for f in (heapify, heappop):
+        for f in (self.module.heapify, self.module.heappop):
             self.assertRaises(TypeError, f, 10)
-        for f in (heappush, heapreplace, nlargest, nsmallest):
+        for f in (self.module.heappush, self.module.heapreplace,
+                  self.module.nlargest, self.module.nsmallest):
             self.assertRaises(TypeError, f, 10, 10)
 
     def test_len_only(self):
-        for f in (heapify, heappop):
+        for f in (self.module.heapify, self.module.heappop):
             self.assertRaises(TypeError, f, LenOnly())
-        for f in (heappush, heapreplace):
+        for f in (self.module.heappush, self.module.heapreplace):
             self.assertRaises(TypeError, f, LenOnly(), 10)
-        for f in (nlargest, nsmallest):
+        for f in (self.module.nlargest, self.module.nsmallest):
             self.assertRaises(TypeError, f, 2, LenOnly())
 
     def test_get_only(self):
-        for f in (heapify, heappop):
+        for f in (self.module.heapify, self.module.heappop):
             self.assertRaises(TypeError, f, GetOnly())
-        for f in (heappush, heapreplace):
+        for f in (self.module.heappush, self.module.heapreplace):
             self.assertRaises(TypeError, f, GetOnly(), 10)
-        for f in (nlargest, nsmallest):
+        for f in (self.module.nlargest, self.module.nsmallest):
             self.assertRaises(TypeError, f, 2, GetOnly())
 
     def test_get_only(self):
         seq = [CmpErr(), CmpErr(), CmpErr()]
-        for f in (heapify, heappop):
+        for f in (self.module.heapify, self.module.heappop):
             self.assertRaises(ZeroDivisionError, f, seq)
-        for f in (heappush, heapreplace):
+        for f in (self.module.heappush, self.module.heapreplace):
             self.assertRaises(ZeroDivisionError, f, seq, 10)
-        for f in (nlargest, nsmallest):
+        for f in (self.module.nlargest, self.module.nsmallest):
             self.assertRaises(ZeroDivisionError, f, 2, seq)
 
     def test_arg_parsing(self):
-        for f in (heapify, heappop, heappush, heapreplace, nlargest, nsmallest):
+        for f in (self.module.heapify, self.module.heappop,
+                  self.module.heappush, self.module.heapreplace,
+                  self.module.nlargest, self.module.nsmallest):
             self.assertRaises(TypeError, f, 10)
 
     def test_iterable_args(self):
-        for f in  (nlargest, nsmallest):
+        for f in (self.module.nlargest, self.module.nsmallest):
             for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
                 for g in (G, I, Ig, L, R):
                     self.assertEqual(f(2, g(s)), f(2,s))
@@ -284,15 +315,14 @@
                 self.assertRaises(TypeError, f, 2, N(s))
                 self.assertRaises(ZeroDivisionError, f, 2, E(s))
 
+
 #==============================================================================
 
 
 def test_main(verbose=None):
     from types import BuiltinFunctionType
 
-    test_classes = [TestHeap]
-    if isinstance(heapify, BuiltinFunctionType):
-        test_classes.append(TestErrorHandling)
+    test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
     test_support.run_unittest(*test_classes)
 
     # verify reference counting

Modified: python/branches/trunk-math/Lib/test/test_htmlparser.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_htmlparser.py	(original)
+++ python/branches/trunk-math/Lib/test/test_htmlparser.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 
 import HTMLParser
 import pprint
-import sys
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_httplib.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_httplib.py	(original)
+++ python/branches/trunk-math/Lib/test/test_httplib.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 import httplib
 import StringIO
-import sys
 import socket
 
 from unittest import TestCase
@@ -157,6 +156,42 @@
         conn.request('GET', '/foo', body)
         self.assertTrue(sock.data.startswith(expected))
 
+    def test_chunked(self):
+        chunked_start = (
+            'HTTP/1.1 200 OK\r\n'
+            'Transfer-Encoding: chunked\r\n\r\n'
+            'a\r\n'
+            'hello worl\r\n'
+            '1\r\n'
+            'd\r\n'
+        )
+        sock = FakeSocket(chunked_start + '0\r\n')
+        resp = httplib.HTTPResponse(sock, method="GET")
+        resp.begin()
+        self.assertEquals(resp.read(), 'hello world')
+        resp.close()
+
+        for x in ('', 'foo\r\n'):
+            sock = FakeSocket(chunked_start + x)
+            resp = httplib.HTTPResponse(sock, method="GET")
+            resp.begin()
+            try:
+                resp.read()
+            except httplib.IncompleteRead, i:
+                self.assertEquals(i.partial, 'hello world')
+            else:
+                self.fail('IncompleteRead expected')
+            finally:
+                resp.close()
+
+    def test_negative_content_length(self):
+        sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n')
+        resp = httplib.HTTPResponse(sock, method="GET")
+        resp.begin()
+        self.assertEquals(resp.read(), 'Hello\r\n')
+        resp.close()
+
+
 class OfflineTest(TestCase):
     def test_responses(self):
         self.assertEquals(httplib.responses[httplib.NOT_FOUND], "Not Found")

Modified: python/branches/trunk-math/Lib/test/test_imgfile.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_imgfile.py	(original)
+++ python/branches/trunk-math/Lib/test/test_imgfile.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 
 from test.test_support import verbose, unlink, findfile
 
-import imgfile, uu, os
+import imgfile, uu
 
 
 def main():

Modified: python/branches/trunk-math/Lib/test/test_imp.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_imp.py	(original)
+++ python/branches/trunk-math/Lib/test/test_imp.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import imp
-import thread
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_index.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_index.py	(original)
+++ python/branches/trunk-math/Lib/test/test_index.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 import unittest
 from test import test_support
 import operator
-import sys
 from sys import maxint
 maxsize = test_support.MAX_Py_ssize_t
 minsize = -maxsize-1

Modified: python/branches/trunk-math/Lib/test/test_inspect.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_inspect.py	(original)
+++ python/branches/trunk-math/Lib/test/test_inspect.py	Thu Feb 28 21:09:17 2008
@@ -11,10 +11,10 @@
 
 # Functions tested in this suite:
 # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
-# isbuiltin, isroutine, getmembers, getdoc, getfile, getmodule,
-# getsourcefile, getcomments, getsource, getclasstree, getargspec,
-# getargvalues, formatargspec, formatargvalues, currentframe, stack, trace
-# isdatadescriptor
+# isbuiltin, isroutine, isgenerator, isgeneratorfunction, getmembers,
+# getdoc, getfile, getmodule, getsourcefile, getcomments, getsource,
+# getclasstree, getargspec, getargvalues, formatargspec, formatargvalues,
+# currentframe, stack, trace, isdatadescriptor
 
 modfile = mod.__file__
 if modfile.endswith(('c', 'o')):
@@ -32,23 +32,33 @@
 class IsTestBase(unittest.TestCase):
     predicates = set([inspect.isbuiltin, inspect.isclass, inspect.iscode,
                       inspect.isframe, inspect.isfunction, inspect.ismethod,
-                      inspect.ismodule, inspect.istraceback])
+                      inspect.ismodule, inspect.istraceback,
+                      inspect.isgenerator, inspect.isgeneratorfunction])
 
     def istest(self, predicate, exp):
         obj = eval(exp)
         self.failUnless(predicate(obj), '%s(%s)' % (predicate.__name__, exp))
 
         for other in self.predicates - set([predicate]):
+            if predicate == inspect.isgeneratorfunction and\
+               other == inspect.isfunction:
+                continue
             self.failIf(other(obj), 'not %s(%s)' % (other.__name__, exp))
 
+def generator_function_example(self):
+    for i in xrange(2):
+        yield i
+
 class TestPredicates(IsTestBase):
-    def test_thirteen(self):
+    def test_fifteen(self):
         count = len(filter(lambda x:x.startswith('is'), dir(inspect)))
-        # Doc/lib/libinspect.tex claims there are 13 such functions
-        expected = 13
+        # This test is here for remember you to update Doc/library/inspect.rst
+        # which claims there are 15 such functions
+        expected = 15
         err_msg = "There are %d (not %d) is* functions" % (count, expected)
         self.assertEqual(count, expected, err_msg)
 
+
     def test_excluding_predicates(self):
         self.istest(inspect.isbuiltin, 'sys.exit')
         self.istest(inspect.isbuiltin, '[].append')
@@ -62,6 +72,8 @@
         self.istest(inspect.istraceback, 'tb')
         self.istest(inspect.isdatadescriptor, '__builtin__.file.closed')
         self.istest(inspect.isdatadescriptor, '__builtin__.file.softspace')
+        self.istest(inspect.isgenerator, '(x for x in xrange(2))')
+        self.istest(inspect.isgeneratorfunction, 'generator_function_example')
         if hasattr(types, 'GetSetDescriptorType'):
             self.istest(inspect.isgetsetdescriptor,
                         'type(tb.tb_frame).f_locals')

Modified: python/branches/trunk-math/Lib/test/test_itertools.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_itertools.py	(original)
+++ python/branches/trunk-math/Lib/test/test_itertools.py	Thu Feb 28 21:09:17 2008
@@ -40,6 +40,10 @@
     'Convenience function for partially consuming a long of infinite iterable'
     return list(islice(seq, n))
 
+def fact(n):
+    'Factorial'
+    return reduce(operator.mul, range(1, n+1), 1)
+
 class TestBasicOps(unittest.TestCase):
     def test_chain(self):
         self.assertEqual(list(chain('abc', 'def')), list('abcdef'))
@@ -48,6 +52,26 @@
         self.assertEqual(take(4, chain('abc', 'def')), list('abcd'))
         self.assertRaises(TypeError, chain, 2, 3)
 
+    def test_combinations(self):
+        self.assertRaises(TypeError, combinations, 'abc')   # missing r argument
+        self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments
+        self.assertRaises(ValueError, combinations, 'abc', -2)  # r is negative
+        self.assertRaises(ValueError, combinations, 'abc', 32)  # r is too big
+        self.assertEqual(list(combinations(range(4), 3)),
+                                           [(0,1,2), (0,1,3), (0,2,3), (1,2,3)])
+        for n in range(8):
+            values = [5*x-12 for x in range(n)]
+            for r in range(n+1):
+                result = list(combinations(values, r))
+                self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs
+                self.assertEqual(len(result), len(set(result)))         # no repeats
+                self.assertEqual(result, sorted(result))                # lexicographic order
+                for c in result:
+                    self.assertEqual(len(c), r)                         # r-length combinations
+                    self.assertEqual(len(set(c)), r)                    # no duplicate elements
+                    self.assertEqual(list(c), sorted(c))                # keep original ordering
+                    self.assert_(all(e in values for e in c))           # elements taken from input iterable
+
     def test_count(self):
         self.assertEqual(zip('abc',count()), [('a', 0), ('b', 1), ('c', 2)])
         self.assertEqual(zip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)])
@@ -171,6 +195,7 @@
     def test_ifilter(self):
         self.assertEqual(list(ifilter(isEven, range(6))), [0,2,4])
         self.assertEqual(list(ifilter(None, [0,1,0,2,0])), [1,2])
+        self.assertEqual(list(ifilter(bool, [0,1,0,2,0])), [1,2])
         self.assertEqual(take(4, ifilter(isEven, count())), [0,2,4,6])
         self.assertRaises(TypeError, ifilter)
         self.assertRaises(TypeError, ifilter, lambda x:x)
@@ -181,6 +206,7 @@
     def test_ifilterfalse(self):
         self.assertEqual(list(ifilterfalse(isEven, range(6))), [1,3,5])
         self.assertEqual(list(ifilterfalse(None, [0,1,0,2,0])), [0,0,0])
+        self.assertEqual(list(ifilterfalse(bool, [0,1,0,2,0])), [0,0,0])
         self.assertEqual(take(4, ifilterfalse(isEven, count())), [1,3,5,7])
         self.assertRaises(TypeError, ifilterfalse)
         self.assertRaises(TypeError, ifilterfalse, lambda x:x)
@@ -253,6 +279,31 @@
         ids = map(id, list(izip_longest('abc', 'def')))
         self.assertEqual(len(dict.fromkeys(ids)), len(ids))
 
+    def test_product(self):
+        for args, result in [
+            ([], []),                       # zero iterables   ??? is this correct
+            (['ab'], [('a',), ('b',)]),     # one iterable
+            ([range(2), range(3)], [(0,0), (0,1), (0,2), (1,0), (1,1), (1,2)]),     # two iterables
+            ([range(0), range(2), range(3)], []),           # first iterable with zero length
+            ([range(2), range(0), range(3)], []),           # middle iterable with zero length
+            ([range(2), range(3), range(0)], []),           # last iterable with zero length
+            ]:
+            self.assertEqual(list(product(*args)), result)
+        self.assertEqual(len(list(product(*[range(7)]*6))), 7**6)
+        self.assertRaises(TypeError, product, range(6), None)
+        argtypes = ['', 'abc', '', xrange(0), xrange(4), dict(a=1, b=2, c=3),
+                    set('abcdefg'), range(11), tuple(range(13))]
+        for i in range(100):
+            args = [random.choice(argtypes) for j in range(random.randrange(5))]
+            n = reduce(operator.mul, map(len, args), 1) if args else 0
+            self.assertEqual(len(list(product(*args))), n)
+            args = map(iter, args)
+            self.assertEqual(len(list(product(*args))), n)
+
+        # Test implementation detail:  tuple re-use
+        self.assertEqual(len(set(map(id, product('abc', 'def')))), 1)
+        self.assertNotEqual(len(set(map(id, list(product('abc', 'def'))))), 1)
+
     def test_repeat(self):
         self.assertEqual(zip(xrange(3),repeat('a')),
                          [(0, 'a'), (1, 'a'), (2, 'a')])
@@ -623,6 +674,12 @@
             self.assertRaises(TypeError, list, chain(N(s)))
             self.assertRaises(ZeroDivisionError, list, chain(E(s)))
 
+    def test_product(self):
+        for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
+            self.assertRaises(TypeError, product, X(s))
+            self.assertRaises(TypeError, product, N(s))
+            self.assertRaises(ZeroDivisionError, product, E(s))
+
     def test_cycle(self):
         for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
             for g in (G, I, Ig, S, L, R):

Modified: python/branches/trunk-math/Lib/test/test_linuxaudiodev.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_linuxaudiodev.py	(original)
+++ python/branches/trunk-math/Lib/test/test_linuxaudiodev.py	Thu Feb 28 21:09:17 2008
@@ -4,13 +4,9 @@
 from test.test_support import findfile, TestSkipped, run_unittest
 
 import errno
-import fcntl
 import linuxaudiodev
-import os
 import sys
-import select
 import sunaudio
-import time
 import audioop
 import unittest
 

Modified: python/branches/trunk-math/Lib/test/test_list.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_list.py	(original)
+++ python/branches/trunk-math/Lib/test/test_list.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,3 @@
-import unittest
 import sys
 from test import test_support, list_tests
 

Modified: python/branches/trunk-math/Lib/test/test_logging.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_logging.py	(original)
+++ python/branches/trunk-math/Lib/test/test_logging.py	Thu Feb 28 21:09:17 2008
@@ -1,38 +1,1882 @@
 #!/usr/bin/env python
-#
-# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved.
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of Vinay Sajip
-# not be used in advertising or publicity pertaining to distribution
-# of the software without specific, written prior permission.
-# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# This file is part of the Python logging distribution. See
-# http://www.red-dove.com/python_logging.html
-#
-"""Test harness for the logging module. Run all tests.
+"""
+Test 0
+======
+
+Some preliminaries:
+>>> import sys
+>>> import logging
+>>> def nextmessage():
+...    global msgcount
+...    rv = "Message %d" % msgcount
+...    msgcount = msgcount + 1
+...    return rv
+
+Set a few variables, then go through the logger autoconfig and set the default threshold.
+>>> msgcount = 0
+>>> FINISH_UP = "Finish up, it's closing time. Messages should bear numbers 0 through 24."
+>>> logging.basicConfig(stream=sys.stdout)
+>>> rootLogger = logging.getLogger("")
+>>> rootLogger.setLevel(logging.DEBUG)
+
+Now, create a bunch of loggers, and set their thresholds.
+>>> ERR = logging.getLogger("ERR0")
+>>> ERR.setLevel(logging.ERROR)
+>>> INF = logging.getLogger("INFO0")
+>>> INF.setLevel(logging.INFO)
+>>> INF_ERR  = logging.getLogger("INFO0.ERR")
+>>> INF_ERR.setLevel(logging.ERROR)
+>>> DEB = logging.getLogger("DEB0")
+>>> DEB.setLevel(logging.DEBUG)
+>>> INF_UNDEF = logging.getLogger("INFO0.UNDEF")
+>>> INF_ERR_UNDEF = logging.getLogger("INFO0.ERR.UNDEF")
+>>> UNDEF = logging.getLogger("UNDEF0")
+>>> GRANDCHILD = logging.getLogger("INFO0.BADPARENT.UNDEF")
+>>> CHILD = logging.getLogger("INFO0.BADPARENT")
+
+
+And finally, run all the tests.
+
+>>> ERR.log(logging.FATAL, nextmessage())
+CRITICAL:ERR0:Message 0
+
+>>> ERR.error(nextmessage())
+ERROR:ERR0:Message 1
+
+>>> INF.log(logging.FATAL, nextmessage())
+CRITICAL:INFO0:Message 2
+
+>>> INF.error(nextmessage())
+ERROR:INFO0:Message 3
+
+>>> INF.warn(nextmessage())
+WARNING:INFO0:Message 4
+
+>>> INF.info(nextmessage())
+INFO:INFO0:Message 5
+
+>>> INF_UNDEF.log(logging.FATAL, nextmessage())
+CRITICAL:INFO0.UNDEF:Message 6
+
+>>> INF_UNDEF.error(nextmessage())
+ERROR:INFO0.UNDEF:Message 7
+
+>>> INF_UNDEF.warn (nextmessage())
+WARNING:INFO0.UNDEF:Message 8
+
+>>> INF_UNDEF.info (nextmessage())
+INFO:INFO0.UNDEF:Message 9
+
+>>> INF_ERR.log(logging.FATAL, nextmessage())
+CRITICAL:INFO0.ERR:Message 10
+
+>>> INF_ERR.error(nextmessage())
+ERROR:INFO0.ERR:Message 11
+
+>>> INF_ERR_UNDEF.log(logging.FATAL, nextmessage())
+CRITICAL:INFO0.ERR.UNDEF:Message 12
+
+>>> INF_ERR_UNDEF.error(nextmessage())
+ERROR:INFO0.ERR.UNDEF:Message 13
+
+>>> DEB.log(logging.FATAL, nextmessage())
+CRITICAL:DEB0:Message 14
+
+>>> DEB.error(nextmessage())
+ERROR:DEB0:Message 15
+
+>>> DEB.warn (nextmessage())
+WARNING:DEB0:Message 16
+
+>>> DEB.info (nextmessage())
+INFO:DEB0:Message 17
+
+>>> DEB.debug(nextmessage())
+DEBUG:DEB0:Message 18
+
+>>> UNDEF.log(logging.FATAL, nextmessage())
+CRITICAL:UNDEF0:Message 19
+
+>>> UNDEF.error(nextmessage())
+ERROR:UNDEF0:Message 20
+
+>>> UNDEF.warn (nextmessage())
+WARNING:UNDEF0:Message 21
+
+>>> UNDEF.info (nextmessage())
+INFO:UNDEF0:Message 22
+
+>>> GRANDCHILD.log(logging.FATAL, nextmessage())
+CRITICAL:INFO0.BADPARENT.UNDEF:Message 23
+
+>>> CHILD.log(logging.FATAL, nextmessage())
+CRITICAL:INFO0.BADPARENT:Message 24
+
+These should not log:
+
+>>> ERR.warn(nextmessage())
+
+>>> ERR.info(nextmessage())
+
+>>> ERR.debug(nextmessage())
+
+>>> INF.debug(nextmessage())
+
+>>> INF_UNDEF.debug(nextmessage())
+
+>>> INF_ERR.warn(nextmessage())
+
+>>> INF_ERR.info(nextmessage())
+
+>>> INF_ERR.debug(nextmessage())
+
+>>> INF_ERR_UNDEF.warn(nextmessage())
+
+>>> INF_ERR_UNDEF.info(nextmessage())
+
+>>> INF_ERR_UNDEF.debug(nextmessage())
+
+>>> INF.info(FINISH_UP)
+INFO:INFO0:Finish up, it's closing time. Messages should bear numbers 0 through 24.
+
+Test 1
+======
+
+>>> import sys, logging
+>>> logging.basicConfig(stream=sys.stdout)
+
+First, we define our levels. There can be as many as you want - the only
+limitations are that they should be integers, the lowest should be > 0 and
+larger values mean less information being logged. If you need specific
+level values which do not fit into these limitations, you can use a
+mapping dictionary to convert between your application levels and the
+logging system.
+
+>>> SILENT      = 10
+>>> TACITURN    = 9
+>>> TERSE       = 8
+>>> EFFUSIVE    = 7
+>>> SOCIABLE    = 6
+>>> VERBOSE     = 5
+>>> TALKATIVE   = 4
+>>> GARRULOUS   = 3
+>>> CHATTERBOX  = 2
+>>> BORING      = 1
+>>> LEVEL_RANGE = range(BORING, SILENT + 1)
+
+
+Next, we define names for our levels. You don't need to do this - in which
+  case the system will use "Level n" to denote the text for the level.
+'
+
+
+>>> my_logging_levels = {
+...     SILENT      : 'SILENT',
+...     TACITURN    : 'TACITURN',
+...     TERSE       : 'TERSE',
+...     EFFUSIVE    : 'EFFUSIVE',
+...     SOCIABLE    : 'SOCIABLE',
+...     VERBOSE     : 'VERBOSE',
+...     TALKATIVE   : 'TALKATIVE',
+...     GARRULOUS   : 'GARRULOUS',
+...     CHATTERBOX  : 'CHATTERBOX',
+...     BORING      : 'BORING',
+...     }
+
+
+Now, to demonstrate filtering: suppose for some perverse reason we only
+want to print out all except GARRULOUS messages. We create a filter for
+this purpose...
+
+>>> class SpecificLevelFilter(logging.Filter):
+...     def __init__(self, lvl):
+...         self.level = lvl
+...
+...     def filter(self, record):
+...         return self.level != record.levelno
+
+>>> class GarrulousFilter(SpecificLevelFilter):
+...     def __init__(self):
+...         SpecificLevelFilter.__init__(self, GARRULOUS)
+
+
+Now, demonstrate filtering at the logger. This time, use a filter
+which excludes SOCIABLE and TACITURN messages. Note that GARRULOUS events
+are still excluded.
+
+
+>>> class VerySpecificFilter(logging.Filter):
+...     def filter(self, record):
+...         return record.levelno not in [SOCIABLE, TACITURN]
+
+>>> SHOULD1 = "This should only be seen at the '%s' logging level (or lower)"
+
+Configure the logger, and tell the logging system to associate names with our levels.
+>>> logging.basicConfig(stream=sys.stdout)
+>>> rootLogger = logging.getLogger("")
+>>> rootLogger.setLevel(logging.DEBUG)
+>>> for lvl in my_logging_levels.keys():
+...    logging.addLevelName(lvl, my_logging_levels[lvl])
+>>> log = logging.getLogger("")
+>>> hdlr = log.handlers[0]
+>>> from test_logging import message
+
+Set the logging level to each different value and call the utility
+function to log events. In the output, you should see that each time
+round the loop, the number of logging events which are actually output
+decreases.
+
+>>> log.setLevel(1)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+BORING:root:This should only be seen at the '1' logging level (or lower)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+GARRULOUS:root:This should only be seen at the '3' logging level (or lower)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(2)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+GARRULOUS:root:This should only be seen at the '3' logging level (or lower)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(3)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+GARRULOUS:root:This should only be seen at the '3' logging level (or lower)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(4)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(5)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+
+>>> log.setLevel(6)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(7)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(8)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(9)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(10)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> hdlr.setLevel(SOCIABLE)
+
+>>> log.setLevel(1)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(2)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(3)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(4)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(5)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(6)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(7)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(8)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(9)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(10)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>>
+
+>>> hdlr.setLevel(0)
+
+>>> garr = GarrulousFilter()
+
+>>> hdlr.addFilter(garr)
+
+>>> log.setLevel(1)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+BORING:root:This should only be seen at the '1' logging level (or lower)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(2)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(3)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(4)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(5)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.setLevel(6)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(7)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(8)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(9)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+TACITURN:root:This should only be seen at the '9' logging level (or lower)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(10)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> spec = VerySpecificFilter()
+
+>>> log.addFilter(spec)
+
+>>> log.setLevel(1)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+BORING:root:This should only be seen at the '1' logging level (or lower)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(2)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(3)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(4)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(5)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+VERBOSE:root:This should only be seen at the '5' logging level (or lower)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(6)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
 
-Copyright (C) 2001-2002 Vinay Sajip. All Rights Reserved.
-"""
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(7)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(8)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+TERSE:root:This should only be seen at the '8' logging level (or lower)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(9)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(10)
+
+>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
+
+>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
+
+>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
+
+>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
+
+>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
+
+>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
+
+>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
+
+>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
+
+>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
+
+>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
+SILENT:root:This should only be seen at the '10' logging level (or lower)
+
+>>> log.setLevel(0)
+
+>>> log.removeFilter(spec)
+
+>>> hdlr.removeFilter(garr)
+
+>>> logging.addLevelName(logging.DEBUG, "DEBUG")
+
+
+Test 2
+======
+Test memory handlers. These are basically buffers for log messages: they take so many messages, and then print them all.
+
+>>> import logging.handlers
+
+>>> sys.stderr = sys.stdout
+>>> logger = logging.getLogger("")
+>>> sh = logger.handlers[0]
+>>> sh.close()
+>>> logger.removeHandler(sh)
+>>> mh = logging.handlers.MemoryHandler(10,logging.WARNING, sh)
+>>> logger.setLevel(logging.DEBUG)
+>>> logger.addHandler(mh)
+
+>>> logger.debug("Debug message")
+
+-- logging at INFO, nothing should be seen yet --
+
+>>> logger.info("Info message")
+
+-- logging at WARNING, 3 messages should be seen --
+
+>>> logger.warn("Warn message")
+DEBUG:root:Debug message
+INFO:root:Info message
+WARNING:root:Warn message
+
+>>> logger.info("Info index = 0")
+
+>>> logger.info("Info index = 1")
+
+>>> logger.info("Info index = 2")
+
+>>> logger.info("Info index = 3")
+
+>>> logger.info("Info index = 4")
+
+>>> logger.info("Info index = 5")
+
+>>> logger.info("Info index = 6")
+
+>>> logger.info("Info index = 7")
+
+>>> logger.info("Info index = 8")
+
+>>> logger.info("Info index = 9")
+INFO:root:Info index = 0
+INFO:root:Info index = 1
+INFO:root:Info index = 2
+INFO:root:Info index = 3
+INFO:root:Info index = 4
+INFO:root:Info index = 5
+INFO:root:Info index = 6
+INFO:root:Info index = 7
+INFO:root:Info index = 8
+INFO:root:Info index = 9
+
+>>> logger.info("Info index = 10")
+
+>>> logger.info("Info index = 11")
+
+>>> logger.info("Info index = 12")
+
+>>> logger.info("Info index = 13")
+
+>>> logger.info("Info index = 14")
+
+>>> logger.info("Info index = 15")
+
+>>> logger.info("Info index = 16")
+
+>>> logger.info("Info index = 17")
+
+>>> logger.info("Info index = 18")
+
+>>> logger.info("Info index = 19")
+INFO:root:Info index = 10
+INFO:root:Info index = 11
+INFO:root:Info index = 12
+INFO:root:Info index = 13
+INFO:root:Info index = 14
+INFO:root:Info index = 15
+INFO:root:Info index = 16
+INFO:root:Info index = 17
+INFO:root:Info index = 18
+INFO:root:Info index = 19
+
+>>> logger.info("Info index = 20")
+
+>>> logger.info("Info index = 21")
+
+>>> logger.info("Info index = 22")
+
+>>> logger.info("Info index = 23")
+
+>>> logger.info("Info index = 24")
+
+>>> logger.info("Info index = 25")
+
+>>> logger.info("Info index = 26")
+
+>>> logger.info("Info index = 27")
+
+>>> logger.info("Info index = 28")
+
+>>> logger.info("Info index = 29")
+INFO:root:Info index = 20
+INFO:root:Info index = 21
+INFO:root:Info index = 22
+INFO:root:Info index = 23
+INFO:root:Info index = 24
+INFO:root:Info index = 25
+INFO:root:Info index = 26
+INFO:root:Info index = 27
+INFO:root:Info index = 28
+INFO:root:Info index = 29
+
+>>> logger.info("Info index = 30")
+
+>>> logger.info("Info index = 31")
+
+>>> logger.info("Info index = 32")
+
+>>> logger.info("Info index = 33")
+
+>>> logger.info("Info index = 34")
+
+>>> logger.info("Info index = 35")
+
+>>> logger.info("Info index = 36")
+
+>>> logger.info("Info index = 37")
+
+>>> logger.info("Info index = 38")
+
+>>> logger.info("Info index = 39")
+INFO:root:Info index = 30
+INFO:root:Info index = 31
+INFO:root:Info index = 32
+INFO:root:Info index = 33
+INFO:root:Info index = 34
+INFO:root:Info index = 35
+INFO:root:Info index = 36
+INFO:root:Info index = 37
+INFO:root:Info index = 38
+INFO:root:Info index = 39
+
+>>> logger.info("Info index = 40")
+
+>>> logger.info("Info index = 41")
+
+>>> logger.info("Info index = 42")
+
+>>> logger.info("Info index = 43")
+
+>>> logger.info("Info index = 44")
+
+>>> logger.info("Info index = 45")
+
+>>> logger.info("Info index = 46")
+
+>>> logger.info("Info index = 47")
+
+>>> logger.info("Info index = 48")
+
+>>> logger.info("Info index = 49")
+INFO:root:Info index = 40
+INFO:root:Info index = 41
+INFO:root:Info index = 42
+INFO:root:Info index = 43
+INFO:root:Info index = 44
+INFO:root:Info index = 45
+INFO:root:Info index = 46
+INFO:root:Info index = 47
+INFO:root:Info index = 48
+INFO:root:Info index = 49
+
+>>> logger.info("Info index = 50")
+
+>>> logger.info("Info index = 51")
+
+>>> logger.info("Info index = 52")
+
+>>> logger.info("Info index = 53")
+
+>>> logger.info("Info index = 54")
+
+>>> logger.info("Info index = 55")
+
+>>> logger.info("Info index = 56")
+
+>>> logger.info("Info index = 57")
+
+>>> logger.info("Info index = 58")
+
+>>> logger.info("Info index = 59")
+INFO:root:Info index = 50
+INFO:root:Info index = 51
+INFO:root:Info index = 52
+INFO:root:Info index = 53
+INFO:root:Info index = 54
+INFO:root:Info index = 55
+INFO:root:Info index = 56
+INFO:root:Info index = 57
+INFO:root:Info index = 58
+INFO:root:Info index = 59
+
+>>> logger.info("Info index = 60")
+
+>>> logger.info("Info index = 61")
+
+>>> logger.info("Info index = 62")
+
+>>> logger.info("Info index = 63")
 
+>>> logger.info("Info index = 64")
+
+>>> logger.info("Info index = 65")
+
+>>> logger.info("Info index = 66")
+
+>>> logger.info("Info index = 67")
+
+>>> logger.info("Info index = 68")
+
+>>> logger.info("Info index = 69")
+INFO:root:Info index = 60
+INFO:root:Info index = 61
+INFO:root:Info index = 62
+INFO:root:Info index = 63
+INFO:root:Info index = 64
+INFO:root:Info index = 65
+INFO:root:Info index = 66
+INFO:root:Info index = 67
+INFO:root:Info index = 68
+INFO:root:Info index = 69
+
+>>> logger.info("Info index = 70")
+
+>>> logger.info("Info index = 71")
+
+>>> logger.info("Info index = 72")
+
+>>> logger.info("Info index = 73")
+
+>>> logger.info("Info index = 74")
+
+>>> logger.info("Info index = 75")
+
+>>> logger.info("Info index = 76")
+
+>>> logger.info("Info index = 77")
+
+>>> logger.info("Info index = 78")
+
+>>> logger.info("Info index = 79")
+INFO:root:Info index = 70
+INFO:root:Info index = 71
+INFO:root:Info index = 72
+INFO:root:Info index = 73
+INFO:root:Info index = 74
+INFO:root:Info index = 75
+INFO:root:Info index = 76
+INFO:root:Info index = 77
+INFO:root:Info index = 78
+INFO:root:Info index = 79
+
+>>> logger.info("Info index = 80")
+
+>>> logger.info("Info index = 81")
+
+>>> logger.info("Info index = 82")
+
+>>> logger.info("Info index = 83")
+
+>>> logger.info("Info index = 84")
+
+>>> logger.info("Info index = 85")
+
+>>> logger.info("Info index = 86")
+
+>>> logger.info("Info index = 87")
+
+>>> logger.info("Info index = 88")
+
+>>> logger.info("Info index = 89")
+INFO:root:Info index = 80
+INFO:root:Info index = 81
+INFO:root:Info index = 82
+INFO:root:Info index = 83
+INFO:root:Info index = 84
+INFO:root:Info index = 85
+INFO:root:Info index = 86
+INFO:root:Info index = 87
+INFO:root:Info index = 88
+INFO:root:Info index = 89
+
+>>> logger.info("Info index = 90")
+
+>>> logger.info("Info index = 91")
+
+>>> logger.info("Info index = 92")
+
+>>> logger.info("Info index = 93")
+
+>>> logger.info("Info index = 94")
+
+>>> logger.info("Info index = 95")
+
+>>> logger.info("Info index = 96")
+
+>>> logger.info("Info index = 97")
+
+>>> logger.info("Info index = 98")
+
+>>> logger.info("Info index = 99")
+INFO:root:Info index = 90
+INFO:root:Info index = 91
+INFO:root:Info index = 92
+INFO:root:Info index = 93
+INFO:root:Info index = 94
+INFO:root:Info index = 95
+INFO:root:Info index = 96
+INFO:root:Info index = 97
+INFO:root:Info index = 98
+INFO:root:Info index = 99
+
+>>> logger.info("Info index = 100")
+
+>>> logger.info("Info index = 101")
+
+>>> mh.close()
+INFO:root:Info index = 100
+INFO:root:Info index = 101
+
+>>> logger.removeHandler(mh)
+>>> logger.addHandler(sh)
+
+
+
+Test 3
+======
+
+>>> import sys, logging
+>>> sys.stderr = sys
+>>> logging.basicConfig()
+>>> FILTER = "a.b"
+>>> root = logging.getLogger()
+>>> root.setLevel(logging.DEBUG)
+>>> hand = root.handlers[0]
+
+>>> logging.getLogger("a").info("Info 1")
+INFO:a:Info 1
+
+>>> logging.getLogger("a.b").info("Info 2")
+INFO:a.b:Info 2
+
+>>> logging.getLogger("a.c").info("Info 3")
+INFO:a.c:Info 3
+
+>>> logging.getLogger("a.b.c").info("Info 4")
+INFO:a.b.c:Info 4
+
+>>> logging.getLogger("a.b.c.d").info("Info 5")
+INFO:a.b.c.d:Info 5
+
+>>> logging.getLogger("a.bb.c").info("Info 6")
+INFO:a.bb.c:Info 6
+
+>>> logging.getLogger("b").info("Info 7")
+INFO:b:Info 7
+
+>>> logging.getLogger("b.a").info("Info 8")
+INFO:b.a:Info 8
+
+>>> logging.getLogger("c.a.b").info("Info 9")
+INFO:c.a.b:Info 9
+
+>>> logging.getLogger("a.bb").info("Info 10")
+INFO:a.bb:Info 10
+
+Filtered with 'a.b'...
+
+>>> filt = logging.Filter(FILTER)
+
+>>> hand.addFilter(filt)
+
+>>> logging.getLogger("a").info("Info 1")
+
+>>> logging.getLogger("a.b").info("Info 2")
+INFO:a.b:Info 2
+
+>>> logging.getLogger("a.c").info("Info 3")
+
+>>> logging.getLogger("a.b.c").info("Info 4")
+INFO:a.b.c:Info 4
+
+>>> logging.getLogger("a.b.c.d").info("Info 5")
+INFO:a.b.c.d:Info 5
+
+>>> logging.getLogger("a.bb.c").info("Info 6")
+
+>>> logging.getLogger("b").info("Info 7")
+
+>>> logging.getLogger("b.a").info("Info 8")
+
+>>> logging.getLogger("c.a.b").info("Info 9")
+
+>>> logging.getLogger("a.bb").info("Info 10")
+
+>>> hand.removeFilter(filt)
+
+
+Test 4
+======
+>>> import sys, logging, logging.handlers, string
+>>> import tempfile, logging.config, os, test.test_support
+>>> sys.stderr = sys.stdout
+
+>>> from test_logging import config0, config1
+
+config2 has a subtle configuration error that should be reported
+>>> config2 = string.replace(config1, "sys.stdout", "sys.stbout")
+
+config3 has a less subtle configuration error
+>>> config3 = string.replace(config1, "formatter=form1", "formatter=misspelled_name")
+
+>>> def test4(conf):
+...     loggerDict = logging.getLogger().manager.loggerDict
+...     logging._acquireLock()
+...     try:
+...         saved_handlers = logging._handlers.copy()
+...         saved_handler_list = logging._handlerList[:]
+...         saved_loggers = loggerDict.copy()
+...     finally:
+...         logging._releaseLock()
+...     try:
+...         fn = test.test_support.TESTFN
+...         f = open(fn, "w")
+...         f.write(conf)
+...         f.close()
+...         try:
+...             logging.config.fileConfig(fn)
+...             #call again to make sure cleanup is correct
+...             logging.config.fileConfig(fn)
+...         except:
+...             t = sys.exc_info()[0]
+...             message(str(t))
+...         else:
+...             message('ok.')
+...             os.remove(fn)
+...     finally:
+...         logging._acquireLock()
+...         try:
+...             logging._handlers.clear()
+...             logging._handlers.update(saved_handlers)
+...             logging._handlerList[:] = saved_handler_list
+...             loggerDict = logging.getLogger().manager.loggerDict
+...             loggerDict.clear()
+...             loggerDict.update(saved_loggers)
+...         finally:
+...             logging._releaseLock()
+
+>>> test4(config0)
+ok.
+
+>>> test4(config1)
+ok.
+
+>>> test4(config2)
+<type 'exceptions.AttributeError'>
+
+>>> test4(config3)
+<type 'exceptions.KeyError'>
+
+>>> import test_logging
+>>> test_logging.test5()
+ERROR:root:just testing
+<type 'exceptions.KeyError'>... Don't panic!
+
+
+Test Main
+=========
+>>> import select
+>>> import os, sys, string, struct, types, cPickle, cStringIO
+>>> import socket, tempfile, threading, time
+>>> import logging, logging.handlers, logging.config
+>>> import test_logging
+
+>>> test_logging.test_main_inner()
+ERR -> CRITICAL: Message 0 (via logrecv.tcp.ERR)
+ERR -> ERROR: Message 1 (via logrecv.tcp.ERR)
+INF -> CRITICAL: Message 2 (via logrecv.tcp.INF)
+INF -> ERROR: Message 3 (via logrecv.tcp.INF)
+INF -> WARNING: Message 4 (via logrecv.tcp.INF)
+INF -> INFO: Message 5 (via logrecv.tcp.INF)
+INF.UNDEF -> CRITICAL: Message 6 (via logrecv.tcp.INF.UNDEF)
+INF.UNDEF -> ERROR: Message 7 (via logrecv.tcp.INF.UNDEF)
+INF.UNDEF -> WARNING: Message 8 (via logrecv.tcp.INF.UNDEF)
+INF.UNDEF -> INFO: Message 9 (via logrecv.tcp.INF.UNDEF)
+INF.ERR -> CRITICAL: Message 10 (via logrecv.tcp.INF.ERR)
+INF.ERR -> ERROR: Message 11 (via logrecv.tcp.INF.ERR)
+INF.ERR.UNDEF -> CRITICAL: Message 12 (via logrecv.tcp.INF.ERR.UNDEF)
+INF.ERR.UNDEF -> ERROR: Message 13 (via logrecv.tcp.INF.ERR.UNDEF)
+DEB -> CRITICAL: Message 14 (via logrecv.tcp.DEB)
+DEB -> ERROR: Message 15 (via logrecv.tcp.DEB)
+DEB -> WARNING: Message 16 (via logrecv.tcp.DEB)
+DEB -> INFO: Message 17 (via logrecv.tcp.DEB)
+DEB -> DEBUG: Message 18 (via logrecv.tcp.DEB)
+UNDEF -> CRITICAL: Message 19 (via logrecv.tcp.UNDEF)
+UNDEF -> ERROR: Message 20 (via logrecv.tcp.UNDEF)
+UNDEF -> WARNING: Message 21 (via logrecv.tcp.UNDEF)
+UNDEF -> INFO: Message 22 (via logrecv.tcp.UNDEF)
+INF.BADPARENT.UNDEF -> CRITICAL: Message 23 (via logrecv.tcp.INF.BADPARENT.UNDEF)
+INF.BADPARENT -> CRITICAL: Message 24 (via logrecv.tcp.INF.BADPARENT)
+INF -> INFO: Finish up, it's closing time. Messages should bear numbers 0 through 24. (via logrecv.tcp.INF)
+<BLANKLINE>
+"""
 import select
-import os, sys, string, struct, types, cPickle, cStringIO
-import socket, tempfile, threading, time
-import logging, logging.handlers, logging.config
-from test.test_support import run_with_locale
+import os, sys, string, struct, cPickle, cStringIO
+import socket, threading
+import logging, logging.handlers, logging.config, test.test_support
+
 
 BANNER = "-- %-10s %-6s ---------------------------------------------------\n"
 
 FINISH_UP = "Finish up, it's closing time. Messages should bear numbers 0 through 24."
+#----------------------------------------------------------------------------
+# Test 0
+#----------------------------------------------------------------------------
+
+msgcount = 0
+
+def nextmessage():
+    global msgcount
+    rv = "Message %d" % msgcount
+    msgcount = msgcount + 1
+    return rv
 
 #----------------------------------------------------------------------------
 # Log receiver
@@ -69,20 +1913,89 @@
             except:
                 raise
 
-    def unPickle(self, data):
-        return cPickle.loads(data)
+    def unPickle(self, data):
+        return cPickle.loads(data)
+
+    def handleLogRecord(self, record):
+        logname = "logrecv.tcp." + record.name
+        #If the end-of-messages sentinel is seen, tell the server to terminate
+        if record.msg == FINISH_UP:
+            self.server.abort = 1
+        record.msg = record.msg + " (via " + logname + ")"
+        logger = logging.getLogger("logrecv")
+        logger.handle(record)
+
+# The server sets socketDataProcessed when it's done.
+socketDataProcessed = threading.Event()
+#----------------------------------------------------------------------------
+# Test 5
+#----------------------------------------------------------------------------
+
+test5_config = """
+[loggers]
+keys=root
+
+[handlers]
+keys=hand1
+
+[formatters]
+keys=form1
+
+[logger_root]
+level=NOTSET
+handlers=hand1
+
+[handler_hand1]
+class=StreamHandler
+level=NOTSET
+formatter=form1
+args=(sys.stdout,)
+
+[formatter_form1]
+class=test.test_logging.FriendlyFormatter
+format=%(levelname)s:%(name)s:%(message)s
+datefmt=
+"""
 
-    def handleLogRecord(self, record):
-        logname = "logrecv.tcp." + record.name
-        #If the end-of-messages sentinel is seen, tell the server to terminate
-        if record.msg == FINISH_UP:
-            self.server.abort = 1
-        record.msg = record.msg + " (via " + logname + ")"
-        logger = logging.getLogger(logname)
-        logger.handle(record)
+class FriendlyFormatter (logging.Formatter):
+    def formatException(self, ei):
+        return "%s... Don't panic!" % str(ei[0])
+
+
+def test5():
+    loggerDict = logging.getLogger().manager.loggerDict
+    logging._acquireLock()
+    try:
+        saved_handlers = logging._handlers.copy()
+        saved_handler_list = logging._handlerList[:]
+        saved_loggers = loggerDict.copy()
+    finally:
+        logging._releaseLock()
+    try:
+        fn = test.test_support.TESTFN
+        f = open(fn, "w")
+        f.write(test5_config)
+        f.close()
+        logging.config.fileConfig(fn)
+        try:
+            raise KeyError
+        except KeyError:
+            logging.exception("just testing")
+        os.remove(fn)
+        hdlr = logging.getLogger().handlers[0]
+        logging.getLogger().handlers.remove(hdlr)
+    finally:
+        logging._acquireLock()
+        try:
+            logging._handlers.clear()
+            logging._handlers.update(saved_handlers)
+            logging._handlerList[:] = saved_handler_list
+            loggerDict = logging.getLogger().manager.loggerDict
+            loggerDict.clear()
+            loggerDict.update(saved_loggers)
+        finally:
+            logging._releaseLock()
 
-# The server sets socketDataProcessed when it's done.
-socketDataProcessed = threading.Event()
 
 class LogRecordSocketReceiver(ThreadingTCPServer):
     """
@@ -96,7 +2009,7 @@
                              port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
                      handler=LogRecordStreamHandler):
         ThreadingTCPServer.__init__(self, (host, port), handler)
-        self.abort = 0
+        self.abort = False
         self.timeout = 1
 
     def serve_until_stopped(self):
@@ -105,13 +2018,11 @@
                                        self.timeout)
             if rd:
                 self.handle_request()
-        #notify the main thread that we're about to exit
-        socketDataProcessed.set()
+            socketDataProcessed.set()
         # close the listen socket
         self.server_close()
 
     def process_request(self, request, client_address):
-        #import threading
         t = threading.Thread(target = self.finish_request,
                              args = (request, client_address))
         t.start()
@@ -119,17 +2030,10 @@
 def runTCP(tcpserver):
     tcpserver.serve_until_stopped()
 
-#----------------------------------------------------------------------------
-# Test 0
-#----------------------------------------------------------------------------
-
-msgcount = 0
-
-def nextmessage():
-    global msgcount
-    rv = "Message %d" % msgcount
-    msgcount = msgcount + 1
-    return rv
+def banner(nm, typ):
+    sep = BANNER % (nm, typ)
+    sys.stdout.write(sep)
+    sys.stdout.flush()
 
 def test0():
     ERR = logging.getLogger("ERR")
@@ -199,202 +2103,60 @@
 
     INF.info(FINISH_UP)
 
-#----------------------------------------------------------------------------
-# Test 1
-#----------------------------------------------------------------------------
-
-#
-#   First, we define our levels. There can be as many as you want - the only
-#     limitations are that they should be integers, the lowest should be > 0 and
-#   larger values mean less information being logged. If you need specific
-#   level values which do not fit into these limitations, you can use a
-#   mapping dictionary to convert between your application levels and the
-#   logging system.
-#
-SILENT      = 10
-TACITURN    = 9
-TERSE       = 8
-EFFUSIVE    = 7
-SOCIABLE    = 6
-VERBOSE     = 5
-TALKATIVE   = 4
-GARRULOUS   = 3
-CHATTERBOX  = 2
-BORING      = 1
-
-LEVEL_RANGE = range(BORING, SILENT + 1)
-
-#
-#   Next, we define names for our levels. You don't need to do this - in which
-#   case the system will use "Level n" to denote the text for the level.
-#
-my_logging_levels = {
-    SILENT      : 'Silent',
-    TACITURN    : 'Taciturn',
-    TERSE       : 'Terse',
-    EFFUSIVE    : 'Effusive',
-    SOCIABLE    : 'Sociable',
-    VERBOSE     : 'Verbose',
-    TALKATIVE   : 'Talkative',
-    GARRULOUS   : 'Garrulous',
-    CHATTERBOX  : 'Chatterbox',
-    BORING      : 'Boring',
-}
-
-#
-#   Now, to demonstrate filtering: suppose for some perverse reason we only
-#   want to print out all except GARRULOUS messages. Let's create a filter for
-#   this purpose...
-#
-class SpecificLevelFilter(logging.Filter):
-    def __init__(self, lvl):
-        self.level = lvl
-
-    def filter(self, record):
-        return self.level != record.levelno
-
-class GarrulousFilter(SpecificLevelFilter):
-    def __init__(self):
-        SpecificLevelFilter.__init__(self, GARRULOUS)
-
-#
-#   Now, let's demonstrate filtering at the logger. This time, use a filter
-#   which excludes SOCIABLE and TACITURN messages. Note that GARRULOUS events
-#   are still excluded.
-#
-class VerySpecificFilter(logging.Filter):
-    def filter(self, record):
-        return record.levelno not in [SOCIABLE, TACITURN]
-
-def message(s):
-    sys.stdout.write("%s\n" % s)
-
-SHOULD1 = "This should only be seen at the '%s' logging level (or lower)"
+def test_main_inner():
+    rootLogger = logging.getLogger("")
+    rootLogger.setLevel(logging.DEBUG)
 
-def test1():
-#
-#   Now, tell the logging system to associate names with our levels.
-#
-    for lvl in my_logging_levels.keys():
-        logging.addLevelName(lvl, my_logging_levels[lvl])
-
-#
-#   Now, define a test function which logs an event at each of our levels.
-#
-
-    def doLog(log):
-        for lvl in LEVEL_RANGE:
-            log.log(lvl, SHOULD1, logging.getLevelName(lvl))
-
-    log = logging.getLogger("")
-    hdlr = log.handlers[0]
-#
-#   Set the logging level to each different value and call the utility
-#   function to log events.
-#   In the output, you should see that each time round the loop, the number of
-#   logging events which are actually output decreases.
-#
-    for lvl in LEVEL_RANGE:
-        message("-- setting logging level to '%s' -----" %
-                        logging.getLevelName(lvl))
-        log.setLevel(lvl)
-        doLog(log)
-  #
-  #   Now, we demonstrate level filtering at the handler level. Tell the
-  #   handler defined above to filter at level 'SOCIABLE', and repeat the
-  #   above loop. Compare the output from the two runs.
-  #
-    hdlr.setLevel(SOCIABLE)
-    message("-- Filtering at handler level to SOCIABLE --")
-    for lvl in LEVEL_RANGE:
-        message("-- setting logging level to '%s' -----" %
-                      logging.getLevelName(lvl))
-        log.setLevel(lvl)
-        doLog(log)
-
-    hdlr.setLevel(0)    #turn off level filtering at the handler
-
-    garr = GarrulousFilter()
-    hdlr.addFilter(garr)
-    message("-- Filtering using GARRULOUS filter --")
-    for lvl in LEVEL_RANGE:
-        message("-- setting logging level to '%s' -----" %
-                        logging.getLevelName(lvl))
-        log.setLevel(lvl)
-        doLog(log)
-    spec = VerySpecificFilter()
-    log.addFilter(spec)
-    message("-- Filtering using specific filter for SOCIABLE, TACITURN --")
-    for lvl in LEVEL_RANGE:
-        message("-- setting logging level to '%s' -----" %
-                      logging.getLevelName(lvl))
-        log.setLevel(lvl)
-        doLog(log)
-
-    log.removeFilter(spec)
-    hdlr.removeFilter(garr)
-    #Undo the one level which clashes...for regression tests
-    logging.addLevelName(logging.DEBUG, "DEBUG")
+    tcpserver = LogRecordSocketReceiver(port=0)
+    port = tcpserver.socket.getsockname()[1]
 
-#----------------------------------------------------------------------------
-# Test 2
-#----------------------------------------------------------------------------
+    # Set up a handler such that all events are sent via a socket to the log
+    # receiver (logrecv).
+    # The handler will only be added to the rootLogger for some of the tests
+    shdlr = logging.handlers.SocketHandler('localhost', port)
+    rootLogger.addHandler(shdlr)
 
-MSG = "-- logging %d at INFO, messages should be seen every 10 events --"
-def test2():
-    logger = logging.getLogger("")
-    sh = logger.handlers[0]
-    sh.close()
-    logger.removeHandler(sh)
-    mh = logging.handlers.MemoryHandler(10,logging.WARNING, sh)
-    logger.setLevel(logging.DEBUG)
-    logger.addHandler(mh)
-    message("-- logging at DEBUG, nothing should be seen yet --")
-    logger.debug("Debug message")
-    message("-- logging at INFO, nothing should be seen yet --")
-    logger.info("Info message")
-    message("-- logging at WARNING, 3 messages should be seen --")
-    logger.warn("Warn message")
-    for i in xrange(102):
-        message(MSG % i)
-        logger.info("Info index = %d", i)
-    mh.close()
-    logger.removeHandler(mh)
-    logger.addHandler(sh)
+    # Configure the logger for logrecv so events do not propagate beyond it.
+    # The sockLogger output is buffered in memory until the end of the test,
+    # and printed at the end.
+    sockOut = cStringIO.StringIO()
+    sockLogger = logging.getLogger("logrecv")
+    sockLogger.setLevel(logging.DEBUG)
+    sockhdlr = logging.StreamHandler(sockOut)
+    sockhdlr.setFormatter(logging.Formatter(
+                                   "%(name)s -> %(levelname)s: %(message)s"))
+    sockLogger.addHandler(sockhdlr)
+    sockLogger.propagate = 0
 
-#----------------------------------------------------------------------------
-# Test 3
-#----------------------------------------------------------------------------
+    #Set up servers
+    threads = []
+    #sys.stdout.write("About to start TCP server...\n")
+    threads.append(threading.Thread(target=runTCP, args=(tcpserver,)))
 
-FILTER = "a.b"
+    for thread in threads:
+        thread.start()
+    try:
+        test0()
 
-def doLog3():
-    logging.getLogger("a").info("Info 1")
-    logging.getLogger("a.b").info("Info 2")
-    logging.getLogger("a.c").info("Info 3")
-    logging.getLogger("a.b.c").info("Info 4")
-    logging.getLogger("a.b.c.d").info("Info 5")
-    logging.getLogger("a.bb.c").info("Info 6")
-    logging.getLogger("b").info("Info 7")
-    logging.getLogger("b.a").info("Info 8")
-    logging.getLogger("c.a.b").info("Info 9")
-    logging.getLogger("a.bb").info("Info 10")
-
-def test3():
-    root = logging.getLogger()
-    root.setLevel(logging.DEBUG)
-    hand = root.handlers[0]
-    message("Unfiltered...")
-    doLog3()
-    message("Filtered with '%s'..." % FILTER)
-    filt = logging.Filter(FILTER)
-    hand.addFilter(filt)
-    doLog3()
-    hand.removeFilter(filt)
+        # XXX(nnorwitz): Try to fix timing related test failures.
+        # This sleep gives us some extra time to read messages.
+        # The test generally only fails on Solaris without this sleep.
+        #time.sleep(2.0)
+        shdlr.close()
+        rootLogger.removeHandler(shdlr)
 
-#----------------------------------------------------------------------------
-# Test 4
-#----------------------------------------------------------------------------
+    finally:
+        #wait for TCP receiver to terminate
+        socketDataProcessed.wait()
+        # ensure the server dies
+        tcpserver.abort = True
+        for thread in threads:
+            thread.join(2.0)
+        print(sockOut.getvalue())
+        sockOut.close()
+        sockLogger.removeHandler(sockhdlr)
+        sockhdlr.close()
+        sys.stdout.flush()
 
 # config0 is a standard configuration.
 config0 = """
@@ -454,6 +2216,9 @@
 datefmt=
 """
 
+def message(s):
+    sys.stdout.write("%s\n" % s)
+
 # config2 has a subtle configuration error that should be reported
 config2 = string.replace(config1, "sys.stdout", "sys.stbout")
 
@@ -461,225 +2226,9 @@
 config3 = string.replace(
     config1, "formatter=form1", "formatter=misspelled_name")
 
-def test4():
-    for i in range(4):
-        conf = globals()['config%d' % i]
-        sys.stdout.write('config%d: ' % i)
-        loggerDict = logging.getLogger().manager.loggerDict
-        logging._acquireLock()
-        try:
-            saved_handlers = logging._handlers.copy()
-            saved_handler_list = logging._handlerList[:]
-            saved_loggers = loggerDict.copy()
-        finally:
-            logging._releaseLock()
-        try:
-            fn = tempfile.mktemp(".ini")
-            f = open(fn, "w")
-            f.write(conf)
-            f.close()
-            try:
-                logging.config.fileConfig(fn)
-                #call again to make sure cleanup is correct
-                logging.config.fileConfig(fn)
-            except:
-                t = sys.exc_info()[0]
-                message(str(t))
-            else:
-                message('ok.')
-            os.remove(fn)
-        finally:
-            logging._acquireLock()
-            try:
-                logging._handlers.clear()
-                logging._handlers.update(saved_handlers)
-                logging._handlerList[:] = saved_handler_list
-                loggerDict = logging.getLogger().manager.loggerDict
-                loggerDict.clear()
-                loggerDict.update(saved_loggers)
-            finally:
-                logging._releaseLock()
-
-#----------------------------------------------------------------------------
-# Test 5
-#----------------------------------------------------------------------------
-
-test5_config = """
-[loggers]
-keys=root
-
-[handlers]
-keys=hand1
-
-[formatters]
-keys=form1
-
-[logger_root]
-level=NOTSET
-handlers=hand1
-
-[handler_hand1]
-class=StreamHandler
-level=NOTSET
-formatter=form1
-args=(sys.stdout,)
-
-[formatter_form1]
-class=test.test_logging.FriendlyFormatter
-format=%(levelname)s:%(name)s:%(message)s
-datefmt=
-"""
-
-class FriendlyFormatter (logging.Formatter):
-    def formatException(self, ei):
-        return "%s... Don't panic!" % str(ei[0])
-
-
-def test5():
-    loggerDict = logging.getLogger().manager.loggerDict
-    logging._acquireLock()
-    try:
-        saved_handlers = logging._handlers.copy()
-        saved_handler_list = logging._handlerList[:]
-        saved_loggers = loggerDict.copy()
-    finally:
-        logging._releaseLock()
-    try:
-        fn = tempfile.mktemp(".ini")
-        f = open(fn, "w")
-        f.write(test5_config)
-        f.close()
-        logging.config.fileConfig(fn)
-        try:
-            raise KeyError
-        except KeyError:
-            logging.exception("just testing")
-        os.remove(fn)
-        hdlr = logging.getLogger().handlers[0]
-        logging.getLogger().handlers.remove(hdlr)
-    finally:
-        logging._acquireLock()
-        try:
-            logging._handlers.clear()
-            logging._handlers.update(saved_handlers)
-            logging._handlerList[:] = saved_handler_list
-            loggerDict = logging.getLogger().manager.loggerDict
-            loggerDict.clear()
-            loggerDict.update(saved_loggers)
-        finally:
-            logging._releaseLock()
-
-
-#----------------------------------------------------------------------------
-# Test Harness
-#----------------------------------------------------------------------------
-def banner(nm, typ):
-    sep = BANNER % (nm, typ)
-    sys.stdout.write(sep)
-    sys.stdout.flush()
-
-def test_main_inner():
-    rootLogger = logging.getLogger("")
-    rootLogger.setLevel(logging.DEBUG)
-    hdlr = logging.StreamHandler(sys.stdout)
-    fmt = logging.Formatter(logging.BASIC_FORMAT)
-    hdlr.setFormatter(fmt)
-    rootLogger.addHandler(hdlr)
-
-    # Find an unused port number
-    port = logging.handlers.DEFAULT_TCP_LOGGING_PORT
-    while port < logging.handlers.DEFAULT_TCP_LOGGING_PORT+100:
-        try:
-            tcpserver = LogRecordSocketReceiver(port=port)
-        except socket.error:
-            port += 1
-        else:
-            break
-    else:
-        raise ImportError, "Could not find unused port"
-
-
-    #Set up a handler such that all events are sent via a socket to the log
-    #receiver (logrecv).
-    #The handler will only be added to the rootLogger for some of the tests
-    shdlr = logging.handlers.SocketHandler('localhost', port)
-
-    #Configure the logger for logrecv so events do not propagate beyond it.
-    #The sockLogger output is buffered in memory until the end of the test,
-    #and printed at the end.
-    sockOut = cStringIO.StringIO()
-    sockLogger = logging.getLogger("logrecv")
-    sockLogger.setLevel(logging.DEBUG)
-    sockhdlr = logging.StreamHandler(sockOut)
-    sockhdlr.setFormatter(logging.Formatter(
-                                   "%(name)s -> %(levelname)s: %(message)s"))
-    sockLogger.addHandler(sockhdlr)
-    sockLogger.propagate = 0
-
-    #Set up servers
-    threads = []
-    #sys.stdout.write("About to start TCP server...\n")
-    threads.append(threading.Thread(target=runTCP, args=(tcpserver,)))
-
-    for thread in threads:
-        thread.start()
-    try:
-        banner("log_test0", "begin")
-
-        rootLogger.addHandler(shdlr)
-        test0()
-        # XXX(nnorwitz): Try to fix timing related test failures.
-        # This sleep gives us some extra time to read messages.
-        # The test generally only fails on Solaris without this sleep.
-        time.sleep(2.0)
-        shdlr.close()
-        rootLogger.removeHandler(shdlr)
-
-        banner("log_test0", "end")
-
-        for t in range(1,6):
-            banner("log_test%d" % t, "begin")
-            globals()['test%d' % t]()
-            banner("log_test%d" % t, "end")
-
-    finally:
-        #wait for TCP receiver to terminate
-        socketDataProcessed.wait()
-        # ensure the server dies
-        tcpserver.abort = 1
-        for thread in threads:
-            thread.join(2.0)
-        banner("logrecv output", "begin")
-        sys.stdout.write(sockOut.getvalue())
-        sockOut.close()
-        sockLogger.removeHandler(sockhdlr)
-        sockhdlr.close()
-        banner("logrecv output", "end")
-        sys.stdout.flush()
-        try:
-            hdlr.close()
-        except:
-            pass
-        rootLogger.removeHandler(hdlr)
-
-# Set the locale to the platform-dependent default.  I have no idea
-# why the test does this, but in any case we save the current locale
-# first and restore it at the end.
- at run_with_locale('LC_ALL', '')
 def test_main():
-    # Save and restore the original root logger level across the tests.
-    # Otherwise, e.g., if any test using cookielib runs after test_logging,
-    # cookielib's debug-level logger tries to log messages, leading to
-    # confusing:
-    #    No handlers could be found for logger "cookielib"
-    # output while the tests are running.
-    root_logger = logging.getLogger("")
-    original_logging_level = root_logger.getEffectiveLevel()
-    try:
-        test_main_inner()
-    finally:
-        root_logger.setLevel(original_logging_level)
+    from test import test_support, test_logging
+    test_support.run_doctest(test_logging)
 
-if __name__ == "__main__":
-    sys.stdout.write("test_logging\n")
+if __name__=="__main__":
     test_main()

Modified: python/branches/trunk-math/Lib/test/test_minidom.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_minidom.py	(original)
+++ python/branches/trunk-math/Lib/test/test_minidom.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
 import os
 import sys
 import pickle
-import traceback
 from StringIO import StringIO
 from test.test_support import verbose, run_unittest, TestSkipped
 import unittest
@@ -791,6 +790,14 @@
                 "testNormalize -- single empty node removed")
         doc.unlink()
 
+    def testBug1433694(self):
+        doc = parseString("<o><i/>t</o>")
+        node = doc.documentElement
+        node.childNodes[1].nodeValue = ""
+        node.normalize()
+        self.confirm(node.childNodes[-1].nextSibling == None,
+                     "Final child's .nextSibling should be None")
+
     def testSiblings(self):
         doc = parseString("<doc><?pi?>text?<elm/></doc>")
         root = doc.documentElement

Modified: python/branches/trunk-math/Lib/test/test_mmap.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_mmap.py	(original)
+++ python/branches/trunk-math/Lib/test/test_mmap.py	Thu Feb 28 21:09:17 2008
@@ -436,6 +436,11 @@
         self.assertRaises(TypeError, m.write, "foo")
 
 
+    def test_error(self):
+        self.assert_(issubclass(mmap.error, EnvironmentError))
+        self.assert_("mmap.error" in str(mmap.error))
+
+
 def test_main():
     run_unittest(MmapTests)
 

Modified: python/branches/trunk-math/Lib/test/test_module.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_module.py	(original)
+++ python/branches/trunk-math/Lib/test/test_module.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,6 @@
 # Test the module type
 import unittest
-from test.test_support import verbose, run_unittest
+from test.test_support import run_unittest
 
 import sys
 ModuleType = type(sys)

Modified: python/branches/trunk-math/Lib/test/test_modulefinder.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_modulefinder.py	(original)
+++ python/branches/trunk-math/Lib/test/test_modulefinder.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,5 @@
 import __future__
-import sys, os
+import os
 import unittest
 import distutils.dir_util
 import tempfile

Modified: python/branches/trunk-math/Lib/test/test_multibytecodec_support.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_multibytecodec_support.py	(original)
+++ python/branches/trunk-math/Lib/test/test_multibytecodec_support.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,7 @@
 #   Common Unittest Routines for CJK codecs
 #
 
-import sys, codecs, os.path
+import sys, codecs
 import unittest, re
 from test import test_support
 from StringIO import StringIO

Modified: python/branches/trunk-math/Lib/test/test_operator.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_operator.py	(original)
+++ python/branches/trunk-math/Lib/test/test_operator.py	Thu Feb 28 21:09:17 2008
@@ -386,6 +386,26 @@
                 raise SyntaxError
         self.failUnlessRaises(SyntaxError, operator.attrgetter('foo'), C())
 
+        # recursive gets
+        a = A()
+        a.name = 'arthur'
+        a.child = A()
+        a.child.name = 'thomas'
+        f = operator.attrgetter('child.name')
+        self.assertEqual(f(a), 'thomas')
+        self.assertRaises(AttributeError, f, a.child)
+        f = operator.attrgetter('name', 'child.name')
+        self.assertEqual(f(a), ('arthur', 'thomas'))
+        f = operator.attrgetter('name', 'child.name', 'child.child.name')
+        self.assertRaises(AttributeError, f, a)
+
+        a.child.child = A()
+        a.child.child.name = 'johnson'
+        f = operator.attrgetter('child.child.name')
+        self.assertEqual(f(a), 'johnson')
+        f = operator.attrgetter('name', 'child.name', 'child.child.name')
+        self.assertEqual(f(a), ('arthur', 'thomas', 'johnson'))
+
     def test_itemgetter(self):
         a = 'ABCDE'
         f = operator.itemgetter(2)
@@ -420,6 +440,24 @@
         self.assertEqual(operator.itemgetter(2,10,5)(data), ('2', '10', '5'))
         self.assertRaises(TypeError, operator.itemgetter(2, 'x', 5), data)
 
+    def test_methodcaller(self):
+        self.assertRaises(TypeError, operator.methodcaller)
+        class A:
+            def foo(self, *args, **kwds):
+                return args[0] + args[1]
+            def bar(self, f=42):
+                return f
+        a = A()
+        f = operator.methodcaller('foo')
+        self.assertRaises(IndexError, f, a)
+        f = operator.methodcaller('foo', 1, 2)
+        self.assertEquals(f(a), 3)
+        f = operator.methodcaller('bar')
+        self.assertEquals(f(a), 42)
+        self.assertRaises(TypeError, f, a, a)
+        f = operator.methodcaller('bar', f=5)
+        self.assertEquals(f(a), 5)
+
     def test_inplace(self):
         class C(object):
             def __iadd__     (self, other): return "iadd"

Modified: python/branches/trunk-math/Lib/test/test_optparse.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_optparse.py	(original)
+++ python/branches/trunk-math/Lib/test/test_optparse.py	Thu Feb 28 21:09:17 2008
@@ -16,7 +16,6 @@
 import unittest
 
 from StringIO import StringIO
-from pprint import pprint
 from test import test_support
 
 

Modified: python/branches/trunk-math/Lib/test/test_ossaudiodev.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_ossaudiodev.py	(original)
+++ python/branches/trunk-math/Lib/test/test_ossaudiodev.py	Thu Feb 28 21:09:17 2008
@@ -1,14 +1,11 @@
 from test import test_support
 test_support.requires('audio')
 
-from test.test_support import verbose, findfile, TestSkipped
+from test.test_support import findfile, TestSkipped
 
 import errno
-import fcntl
 import ossaudiodev
-import os
 import sys
-import select
 import sunaudio
 import time
 import audioop

Modified: python/branches/trunk-math/Lib/test/test_parser.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_parser.py	(original)
+++ python/branches/trunk-math/Lib/test/test_parser.py	Thu Feb 28 21:09:17 2008
@@ -480,11 +480,28 @@
         st = parser.suite('a = u"\u1"')
         self.assertRaises(SyntaxError, parser.compilest, st)
 
+class ParserStackLimitTestCase(unittest.TestCase):
+    """try to push the parser to/over it's limits.
+    see http://bugs.python.org/issue1881 for a discussion
+    """
+    def _nested_expression(self, level):
+        return "["*level+"]"*level
+
+    def test_deeply_nested_list(self):
+        e = self._nested_expression(99)
+        st = parser.expr(e)
+        st.compile()
+
+    def test_trigger_memory_error(self):
+        e = self._nested_expression(100)
+        self.assertRaises(MemoryError, parser.expr, e)
+
 def test_main():
     test_support.run_unittest(
         RoundtripLegalSyntaxTestCase,
         IllegalSyntaxTestCase,
         CompileTestCase,
+        ParserStackLimitTestCase,
     )
 
 

Modified: python/branches/trunk-math/Lib/test/test_pickle.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_pickle.py	(original)
+++ python/branches/trunk-math/Lib/test/test_pickle.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import pickle
-import unittest
 from cStringIO import StringIO
 
 from test import test_support

Modified: python/branches/trunk-math/Lib/test/test_pkg.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_pkg.py	(original)
+++ python/branches/trunk-math/Lib/test/test_pkg.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,6 @@
 import os
 import tempfile
 import textwrap
-import traceback
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_plistlib.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_plistlib.py	(original)
+++ python/branches/trunk-math/Lib/test/test_plistlib.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
 import unittest
 import plistlib
 import os
-import time
 import datetime
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_poll.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_poll.py	(original)
+++ python/branches/trunk-math/Lib/test/test_poll.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,6 @@
 # Test case for the os.poll() function
 
-import sys, os, select, random, unittest
+import os, select, random, unittest
 from test.test_support import TestSkipped, TESTFN, run_unittest
 
 try:

Modified: python/branches/trunk-math/Lib/test/test_posix.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_posix.py	(original)
+++ python/branches/trunk-math/Lib/test/test_posix.py	Thu Feb 28 21:09:17 2008
@@ -9,7 +9,6 @@
 
 import time
 import os
-import sys
 import unittest
 import warnings
 warnings.filterwarnings('ignore', '.* potential security risk .*',

Modified: python/branches/trunk-math/Lib/test/test_pyclbr.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_pyclbr.py	(original)
+++ python/branches/trunk-math/Lib/test/test_pyclbr.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,7 @@
    Nick Mathewson
 '''
 from test.test_support import run_unittest
-import unittest, sys
+import sys
 from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
 import pyclbr
 from unittest import TestCase

Modified: python/branches/trunk-math/Lib/test/test_quopri.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_quopri.py	(original)
+++ python/branches/trunk-math/Lib/test/test_quopri.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,7 @@
 from test import test_support
 import unittest
 
-import sys, os, cStringIO, subprocess
+import sys, cStringIO, subprocess
 import quopri
 
 

Modified: python/branches/trunk-math/Lib/test/test_resource.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_resource.py	(original)
+++ python/branches/trunk-math/Lib/test/test_resource.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 import unittest
 from test import test_support
 
-import os
 import resource
 import time
 

Modified: python/branches/trunk-math/Lib/test/test_rfc822.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_rfc822.py	(original)
+++ python/branches/trunk-math/Lib/test/test_rfc822.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 import rfc822
-import sys
 import unittest
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_scope.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_scope.py	(original)
+++ python/branches/trunk-math/Lib/test/test_scope.py	Thu Feb 28 21:09:17 2008
@@ -597,6 +597,24 @@
 
         f(4)()
 
+    def testFreeingCell(self):
+        # Test what happens when a finalizer accesses
+        # the cell where the object was stored.
+        class Special:
+            def __del__(self):
+                nestedcell_get()
+
+        def f():
+            global nestedcell_get
+            def nestedcell_get():
+                return c
+
+            c = (Special(),)
+            c = 2
+
+        f() # used to crash the interpreter...
+
+
 
 def test_main():
     run_unittest(ScopeTests)

Modified: python/branches/trunk-math/Lib/test/test_scriptpackages.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_scriptpackages.py	(original)
+++ python/branches/trunk-math/Lib/test/test_scriptpackages.py	Thu Feb 28 21:09:17 2008
@@ -1,9 +1,6 @@
 # Copyright (C) 2003 Python Software Foundation
 
 import unittest
-import os
-import sys
-import tempfile
 from test import test_support
 import aetools
 

Modified: python/branches/trunk-math/Lib/test/test_sgmllib.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_sgmllib.py	(original)
+++ python/branches/trunk-math/Lib/test/test_sgmllib.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,3 @@
-import htmlentitydefs
 import pprint
 import re
 import sgmllib
@@ -116,7 +115,7 @@
         try:
             events = self.get_events(source)
         except:
-            import sys
+            #import sys
             #print >>sys.stderr, pprint.pformat(self.events)
             raise
         if events != expected_events:

Modified: python/branches/trunk-math/Lib/test/test_shlex.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_shlex.py	(original)
+++ python/branches/trunk-math/Lib/test/test_shlex.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # -*- coding: iso-8859-1 -*-
 import unittest
-import os, sys
 import shlex
 
 from test import test_support

Modified: python/branches/trunk-math/Lib/test/test_signal.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_signal.py	(original)
+++ python/branches/trunk-math/Lib/test/test_signal.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,7 @@
 import unittest
 from test import test_support
 import signal
-import os, sys, time
+import os, sys, time, errno
 
 class HandlerBCalled(Exception):
     pass
@@ -210,6 +210,50 @@
         os.close(self.write)
         signal.signal(signal.SIGALRM, self.alrm)
 
+class SiginterruptTest(unittest.TestCase):
+    signum = signal.SIGUSR1
+    def readpipe_interrupted(self, cb):
+        r, w = os.pipe()
+        ppid = os.getpid()
+        pid = os.fork()
+
+        oldhandler = signal.signal(self.signum, lambda x,y: None)
+        cb()
+        if pid==0:
+            # child code: sleep, kill, sleep. and then exit,
+            # which closes the pipe from which the parent process reads
+            try:
+                time.sleep(0.2)
+                os.kill(ppid, self.signum)
+                time.sleep(0.2)
+            finally:
+                os._exit(0)
+
+        try:
+            os.close(w)
+
+            try:
+                d=os.read(r, 1)
+                return False
+            except OSError, err:
+                if err.errno != errno.EINTR:
+                    raise
+                return True
+        finally:
+            signal.signal(self.signum, oldhandler)
+            os.waitpid(pid, 0)
+
+    def test_without_siginterrupt(self):
+        i=self.readpipe_interrupted(lambda: None)
+        self.assertEquals(i, True)
+
+    def test_siginterrupt_on(self):
+        i=self.readpipe_interrupted(lambda: signal.siginterrupt(self.signum, 1))
+        self.assertEquals(i, True)
+
+    def test_siginterrupt_off(self):
+        i=self.readpipe_interrupted(lambda: signal.siginterrupt(self.signum, 0))
+        self.assertEquals(i, False)
 
 def test_main():
     if sys.platform[:3] in ('win', 'os2') or sys.platform == 'riscos':
@@ -217,7 +261,7 @@
                                        sys.platform)
 
     test_support.run_unittest(BasicSignalTests, InterProcessSignalTests,
-        WakeupSignalTests)
+        WakeupSignalTests, SiginterruptTest)
 
 
 if __name__ == "__main__":

Modified: python/branches/trunk-math/Lib/test/test_site.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_site.py	(original)
+++ python/branches/trunk-math/Lib/test/test_site.py	Thu Feb 28 21:09:17 2008
@@ -5,12 +5,11 @@
 
 """
 import unittest
-from test.test_support import TestSkipped, TestFailed, run_unittest, TESTFN
+from test.test_support import TestSkipped, run_unittest, TESTFN
 import __builtin__
 import os
 import sys
 import encodings
-import tempfile
 # Need to make sure to not import 'site' if someone specified ``-S`` at the
 # command-line.  Detect this by just making sure 'site' has not been imported
 # already.

Modified: python/branches/trunk-math/Lib/test/test_smtplib.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_smtplib.py	(original)
+++ python/branches/trunk-math/Lib/test/test_smtplib.py	Thu Feb 28 21:09:17 2008
@@ -18,14 +18,15 @@
 PORT = None
 
 def server(evt, buf):
+    serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    serv.settimeout(1)
+    serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+    serv.bind(("", 0))
+    global PORT
+    PORT = serv.getsockname()[1]
+    serv.listen(5)
+    evt.set()
     try:
-        serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        serv.settimeout(3)
-        serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        serv.bind(("", 0))
-        global PORT
-        PORT = serv.getsockname()[1]
-        serv.listen(5)
         conn, addr = serv.accept()
     except socket.timeout:
         pass
@@ -38,7 +39,6 @@
                 buf = buf[sent:]
 
             n -= 1
-            time.sleep(0.01)
 
         conn.close()
     finally:
@@ -52,16 +52,8 @@
         self.evt = threading.Event()
         servargs = (self.evt, "220 Hola mundo\n")
         threading.Thread(target=server, args=servargs).start()
-
-        # wait until server thread has assigned a port number
-        n = 500
-        while PORT is None and n > 0:
-            time.sleep(0.01)
-            n -= 1
-
-        # wait a little longer (sometimes connections are refused
-        # on slow machines without this additional wait)
-        time.sleep(0.5)
+        self.evt.wait()
+        self.evt.clear()
 
     def tearDown(self):
         self.evt.wait()
@@ -76,28 +68,12 @@
         smtp = smtplib.SMTP("%s:%s" % (HOST, PORT))
         smtp.sock.close()
 
-    def testNotConnected(self):
-        # Test various operations on an unconnected SMTP object that
-        # should raise exceptions (at present the attempt in SMTP.send
-        # to reference the nonexistent 'sock' attribute of the SMTP object
-        # causes an AttributeError)
-        smtp = smtplib.SMTP()
-        self.assertRaises(AttributeError, smtp.ehlo)
-        self.assertRaises(AttributeError, smtp.send, 'test msg')
-
     def testLocalHostName(self):
         # check that supplied local_hostname is used
         smtp = smtplib.SMTP(HOST, PORT, local_hostname="testhost")
         self.assertEqual(smtp.local_hostname, "testhost")
         smtp.sock.close()
 
-    def testNonnumericPort(self):
-        # check that non-numeric port raises socket.error
-        self.assertRaises(socket.error, smtplib.SMTP,
-                          "localhost", "bogus")
-        self.assertRaises(socket.error, smtplib.SMTP,
-                          "localhost:bogus")
-
     def testTimeoutDefault(self):
         # default
         smtp = smtplib.SMTP(HOST, PORT)
@@ -127,6 +103,7 @@
     serv = server_class(("", 0), ('nowhere', -1))
     global PORT
     PORT = serv.getsockname()[1]
+    serv_evt.set()
 
     try:
         if hasattr(select, 'poll'):
@@ -149,12 +126,12 @@
     except socket.timeout:
         pass
     finally:
-        # allow some time for the client to read the result
-        time.sleep(0.5)
-        serv.close()
+        if not client_evt.isSet():
+            # allow some time for the client to read the result
+            time.sleep(0.5)
+            serv.close()
         asyncore.close_all()
         PORT = None
-        time.sleep(0.5)
         serv_evt.set()
 
 MSG_BEGIN = '---------- MESSAGE FOLLOWS ----------\n'
@@ -180,14 +157,8 @@
         threading.Thread(target=debugging_server, args=serv_args).start()
 
         # wait until server thread has assigned a port number
-        n = 500
-        while PORT is None and n > 0:
-            time.sleep(0.01)
-            n -= 1
-
-        # wait a little longer (sometimes connections are refused
-        # on slow machines without this additional wait)
-        time.sleep(0.5)
+        self.serv_evt.wait()
+        self.serv_evt.clear()
 
     def tearDown(self):
         # indicate that the client is finished
@@ -257,6 +228,26 @@
         self.assertEqual(self.output.getvalue(), mexpect)
 
 
+class NonConnectingTests(TestCase):
+
+    def testNotConnected(self):
+        # Test various operations on an unconnected SMTP object that
+        # should raise exceptions (at present the attempt in SMTP.send
+        # to reference the nonexistent 'sock' attribute of the SMTP object
+        # causes an AttributeError)
+        smtp = smtplib.SMTP()
+        self.assertRaises(smtplib.SMTPServerDisconnected, smtp.ehlo)
+        self.assertRaises(smtplib.SMTPServerDisconnected,
+                          smtp.send, 'test msg')
+
+    def testNonnumericPort(self):
+        # check that non-numeric port raises socket.error
+        self.assertRaises(socket.error, smtplib.SMTP,
+                          "localhost", "bogus")
+        self.assertRaises(socket.error, smtplib.SMTP,
+                          "localhost:bogus")
+
+
 # test response of client to a non-successful HELO message
 class BadHELOServerTests(TestCase):
 
@@ -268,16 +259,8 @@
         self.evt = threading.Event()
         servargs = (self.evt, "199 no hello for you!\n")
         threading.Thread(target=server, args=servargs).start()
-
-        # wait until server thread has assigned a port number
-        n = 500
-        while PORT is None and n > 0:
-            time.sleep(0.01)
-            n -= 1
-
-        # wait a little longer (sometimes connections are refused
-        # on slow machines without this additional wait)
-        time.sleep(0.5)
+        self.evt.wait()
+        self.evt.clear()
 
     def tearDown(self):
         self.evt.wait()
@@ -354,14 +337,8 @@
         threading.Thread(target=debugging_server, args=serv_args).start()
 
         # wait until server thread has assigned a port number
-        n = 500
-        while PORT is None and n > 0:
-            time.sleep(0.01)
-            n -= 1
-
-        # wait a little longer (sometimes connections are refused
-        # on slow machines without this additional wait)
-        time.sleep(0.5)
+        self.serv_evt.wait()
+        self.serv_evt.clear()
 
     def tearDown(self):
         # indicate that the client is finished
@@ -426,6 +403,7 @@
 
 def test_main(verbose=None):
     test_support.run_unittest(GeneralTests, DebuggingServerTests,
+                              NonConnectingTests,
                               BadHELOServerTests, SMTPSimTests)
 
 if __name__ == '__main__':

Modified: python/branches/trunk-math/Lib/test/test_socketserver.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_socketserver.py	(original)
+++ python/branches/trunk-math/Lib/test/test_socketserver.py	Thu Feb 28 21:09:17 2008
@@ -2,14 +2,15 @@
 Test suite for SocketServer.py.
 """
 
-import os
-import socket
 import errno
 import imp
+import os
 import select
-import time
+import signal
+import socket
+import tempfile
 import threading
-from functools import wraps
+import time
 import unittest
 import SocketServer
 
@@ -20,7 +21,6 @@
 test.test_support.requires("network")
 
 NREQ = 3
-DELAY = 0.5
 TEST_STR = "hello world\n"
 HOST = "localhost"
 
@@ -28,14 +28,6 @@
 HAVE_FORKING = hasattr(os, "fork") and os.name != "os2"
 
 
-class MyMixinHandler:
-    def handle(self):
-        time.sleep(DELAY)
-        line = self.rfile.readline()
-        time.sleep(DELAY)
-        self.wfile.write(line)
-
-
 def receive(sock, n, timeout=20):
     r, w, x = select.select([sock], [], [], timeout)
     if sock in r:
@@ -43,14 +35,6 @@
     else:
         raise RuntimeError, "timed out on %r" % (sock,)
 
-
-class MyStreamHandler(MyMixinHandler, SocketServer.StreamRequestHandler):
-    pass
-
-class MyDatagramHandler(MyMixinHandler,
-    SocketServer.DatagramRequestHandler):
-    pass
-
 if HAVE_UNIX_SOCKETS:
     class ForkingUnixStreamServer(SocketServer.ForkingMixIn,
                                   SocketServer.UnixStreamServer):
@@ -85,48 +69,28 @@
             pass
         if verbose: print "thread: creating server"
         svr = svrcls(self.__addr, self.__hdlrcls)
-        # pull the address out of the server in case it changed
-        # this can happen if another process is using the port
-        addr = svr.server_address
-        if addr:
-            self.__addr = addr
-            if self.__addr != svr.socket.getsockname():
-                raise RuntimeError('server_address was %s, expected %s' %
-                                       (self.__addr, svr.socket.getsockname()))
+        # We had the OS pick a port, so pull the real address out of
+        # the server.
+        self.addr = svr.server_address
+        self.port = self.addr[1]
+        if self.addr != svr.socket.getsockname():
+            raise RuntimeError('server_address was %s, expected %s' %
+                               (self.addr, svr.socket.getsockname()))
         self.ready.set()
         if verbose: print "thread: serving three times"
         svr.serve_a_few()
         if verbose: print "thread: done"
 
 
-class ForgivingTCPServer(SocketServer.TCPServer):
-    # prevent errors if another process is using the port we want
-    def server_bind(self):
-        host, default_port = self.server_address
-        # this code shamelessly stolen from test.test_support
-        # the ports were changed to protect the innocent
-        import sys
-        for port in [default_port, 3434, 8798, 23833]:
-            try:
-                self.server_address = host, port
-                SocketServer.TCPServer.server_bind(self)
-                break
-            except socket.error, (err, msg):
-                if err != errno.EADDRINUSE:
-                    raise
-                print >> sys.__stderr__, \
-                    "WARNING: failed to listen on port %d, trying another: " % port
-
-
 class SocketServerTest(unittest.TestCase):
     """Test all socket servers."""
 
     def setUp(self):
+        signal.alarm(20)  # Kill deadlocks after 20 seconds.
         self.port_seed = 0
         self.test_files = []
 
     def tearDown(self):
-        time.sleep(DELAY)
         reap_children()
 
         for fn in self.test_files:
@@ -135,16 +99,18 @@
             except os.error:
                 pass
         self.test_files[:] = []
-
-    def pickport(self):
-        self.port_seed += 1
-        return 10000 + (os.getpid() % 1000)*10 + self.port_seed
+        signal.alarm(0)  # Didn't deadlock.
 
     def pickaddr(self, proto):
         if proto == socket.AF_INET:
-            return (HOST, self.pickport())
+            return (HOST, 0)
         else:
-            fn = TEST_FILE + str(self.pickport())
+            # XXX: We need a way to tell AF_UNIX to pick its own name
+            # like AF_INET provides port==0.
+            dir = None
+            if os.name == 'os2':
+                dir = '\socket'
+            fn = tempfile.mktemp(prefix='unix_socket.', dir=dir)
             if os.name == 'os2':
                 # AF_UNIX socket names on OS/2 require a specific prefix
                 # which can't include a drive letter and must also use
@@ -153,7 +119,6 @@
                     fn = fn[2:]
                 if fn[0] in (os.sep, os.altsep):
                     fn = fn[1:]
-                fn = os.path.join('\socket', fn)
                 if os.sep == '/':
                     fn = fn.replace(os.sep, os.altsep)
                 else:
@@ -161,25 +126,30 @@
             self.test_files.append(fn)
             return fn
 
-    def run_servers(self, proto, servers, hdlrcls, testfunc):
-        for svrcls in servers:
-            addr = self.pickaddr(proto)
-            if verbose:
-                print "ADDR =", addr
-                print "CLASS =", svrcls
-            t = ServerThread(addr, svrcls, hdlrcls)
-            if verbose: print "server created"
-            t.start()
-            if verbose: print "server running"
-            for i in range(NREQ):
-                t.ready.wait(10*DELAY)
-                self.assert_(t.ready.isSet(),
-                    "Server not ready within a reasonable time")
-                if verbose: print "test client", i
-                testfunc(proto, addr)
-            if verbose: print "waiting for server"
-            t.join()
-            if verbose: print "done"
+    def run_server(self, svrcls, hdlrbase, testfunc):
+        class MyHandler(hdlrbase):
+            def handle(self):
+                line = self.rfile.readline()
+                self.wfile.write(line)
+
+        addr = self.pickaddr(svrcls.address_family)
+        if verbose:
+            print "ADDR =", addr
+            print "CLASS =", svrcls
+        t = ServerThread(addr, svrcls, MyHandler)
+        if verbose: print "server created"
+        t.start()
+        if verbose: print "server running"
+        t.ready.wait(10)
+        self.assert_(t.ready.isSet(),
+                     "%s not ready within a reasonable time" % svrcls)
+        addr = t.addr
+        for i in range(NREQ):
+            if verbose: print "test client", i
+            testfunc(svrcls.address_family, addr)
+        if verbose: print "waiting for server"
+        t.join()
+        if verbose: print "done"
 
     def stream_examine(self, proto, addr):
         s = socket.socket(proto, socket.SOCK_STREAM)
@@ -202,47 +172,74 @@
         self.assertEquals(buf, TEST_STR)
         s.close()
 
-    def test_TCPServers(self):
-        # Test SocketServer.TCPServer
-        servers = [ForgivingTCPServer, SocketServer.ThreadingTCPServer]
-        if HAVE_FORKING:
-            servers.append(SocketServer.ForkingTCPServer)
-        self.run_servers(socket.AF_INET, servers,
-                         MyStreamHandler, self.stream_examine)
-
-    def test_UDPServers(self):
-        # Test SocketServer.UDPServer
-        servers = [SocketServer.UDPServer,
-                   SocketServer.ThreadingUDPServer]
-        if HAVE_FORKING:
-            servers.append(SocketServer.ForkingUDPServer)
-        self.run_servers(socket.AF_INET, servers, MyDatagramHandler,
-                         self.dgram_examine)
-
-    def test_stream_servers(self):
-        # Test SocketServer's stream servers
-        if not HAVE_UNIX_SOCKETS:
-            return
-        servers = [SocketServer.UnixStreamServer,
-                   SocketServer.ThreadingUnixStreamServer]
+    def test_TCPServer(self):
+        self.run_server(SocketServer.TCPServer,
+                        SocketServer.StreamRequestHandler,
+                        self.stream_examine)
+
+    def test_ThreadingTCPServer(self):
+        self.run_server(SocketServer.ThreadingTCPServer,
+                        SocketServer.StreamRequestHandler,
+                        self.stream_examine)
+
+    if HAVE_FORKING:
+        def test_ThreadingTCPServer(self):
+            self.run_server(SocketServer.ForkingTCPServer,
+                            SocketServer.StreamRequestHandler,
+                            self.stream_examine)
+
+    if HAVE_UNIX_SOCKETS:
+        def test_UnixStreamServer(self):
+            self.run_server(SocketServer.UnixStreamServer,
+                            SocketServer.StreamRequestHandler,
+                            self.stream_examine)
+
+        def test_ThreadingUnixStreamServer(self):
+            self.run_server(SocketServer.ThreadingUnixStreamServer,
+                            SocketServer.StreamRequestHandler,
+                            self.stream_examine)
+
         if HAVE_FORKING:
-            servers.append(ForkingUnixStreamServer)
-        self.run_servers(socket.AF_UNIX, servers, MyStreamHandler,
-                         self.stream_examine)
+            def test_ForkingUnixStreamServer(self):
+                self.run_server(ForkingUnixStreamServer,
+                                SocketServer.StreamRequestHandler,
+                                self.stream_examine)
+
+    def test_UDPServer(self):
+        self.run_server(SocketServer.UDPServer,
+                        SocketServer.DatagramRequestHandler,
+                        self.dgram_examine)
+
+    def test_ThreadingUDPServer(self):
+        self.run_server(SocketServer.ThreadingUDPServer,
+                        SocketServer.DatagramRequestHandler,
+                        self.dgram_examine)
+
+    if HAVE_FORKING:
+        def test_ForkingUDPServer(self):
+            self.run_server(SocketServer.ForkingUDPServer,
+                            SocketServer.DatagramRequestHandler,
+                            self.dgram_examine)
 
     # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
     # client address so this cannot work:
 
-    # def test_dgram_servers(self):
-    #     # Test SocketServer.UnixDatagramServer
-    #     if not HAVE_UNIX_SOCKETS:
-    #         return
-    #     servers = [SocketServer.UnixDatagramServer,
-    #                SocketServer.ThreadingUnixDatagramServer]
+    # if HAVE_UNIX_SOCKETS:
+    #     def test_UnixDatagramServer(self):
+    #         self.run_server(SocketServer.UnixDatagramServer,
+    #                         SocketServer.DatagramRequestHandler,
+    #                         self.dgram_examine)
+    #
+    #     def test_ThreadingUnixDatagramServer(self):
+    #         self.run_server(SocketServer.ThreadingUnixDatagramServer,
+    #                         SocketServer.DatagramRequestHandler,
+    #                         self.dgram_examine)
+    #
     #     if HAVE_FORKING:
-    #         servers.append(ForkingUnixDatagramServer)
-    #     self.run_servers(socket.AF_UNIX, servers, MyDatagramHandler,
-    #                      self.dgram_examine)
+    #         def test_ForkingUnixDatagramServer(self):
+    #             self.run_server(SocketServer.ForkingUnixDatagramServer,
+    #                             SocketServer.DatagramRequestHandler,
+    #                             self.dgram_examine)
 
 
 def test_main():
@@ -254,3 +251,4 @@
 
 if __name__ == "__main__":
     test_main()
+    signal.alarm(3)  # Shutdown shouldn't take more than 3 seconds.

Modified: python/branches/trunk-math/Lib/test/test_sqlite.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_sqlite.py	(original)
+++ python/branches/trunk-math/Lib/test/test_sqlite.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 from test.test_support import run_unittest, TestSkipped
-import unittest
 
 try:
     import _sqlite3

Modified: python/branches/trunk-math/Lib/test/test_str.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_str.py	(original)
+++ python/branches/trunk-math/Lib/test/test_str.py	Thu Feb 28 21:09:17 2008
@@ -1,5 +1,4 @@
 
-import unittest
 import struct
 import sys
 from test import test_support, string_tests
@@ -93,6 +92,264 @@
             return
         self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxint)
 
+    def test__format__(self):
+        def test(value, format, expected):
+            # test both with and without the trailing 's'
+            self.assertEqual(value.__format__(format), expected)
+            self.assertEqual(value.__format__(format + 's'), expected)
+
+        test('', '', '')
+        test('abc', '', 'abc')
+        test('abc', '.3', 'abc')
+        test('ab', '.3', 'ab')
+        test('abcdef', '.3', 'abc')
+        test('abcdef', '.0', '')
+        test('abc', '3.3', 'abc')
+        test('abc', '2.3', 'abc')
+        test('abc', '2.2', 'ab')
+        test('abc', '3.2', 'ab ')
+        test('result', 'x<0', 'result')
+        test('result', 'x<5', 'result')
+        test('result', 'x<6', 'result')
+        test('result', 'x<7', 'resultx')
+        test('result', 'x<8', 'resultxx')
+        test('result', ' <7', 'result ')
+        test('result', '<7', 'result ')
+        test('result', '>7', ' result')
+        test('result', '>8', '  result')
+        test('result', '^8', ' result ')
+        test('result', '^9', ' result  ')
+        test('result', '^10', '  result  ')
+        test('a', '10000', 'a' + ' ' * 9999)
+        test('', '10000', ' ' * 10000)
+        test('', '10000000', ' ' * 10000000)
+
+    def test_format(self):
+        self.assertEqual(''.format(), '')
+        self.assertEqual('a'.format(), 'a')
+        self.assertEqual('ab'.format(), 'ab')
+        self.assertEqual('a{{'.format(), 'a{')
+        self.assertEqual('a}}'.format(), 'a}')
+        self.assertEqual('{{b'.format(), '{b')
+        self.assertEqual('}}b'.format(), '}b')
+        self.assertEqual('a{{b'.format(), 'a{b')
+
+        # examples from the PEP:
+        import datetime
+        self.assertEqual("My name is {0}".format('Fred'), "My name is Fred")
+        self.assertEqual("My name is {0[name]}".format(dict(name='Fred')),
+                         "My name is Fred")
+        self.assertEqual("My name is {0} :-{{}}".format('Fred'),
+                         "My name is Fred :-{}")
+
+        d = datetime.date(2007, 8, 18)
+        self.assertEqual("The year is {0.year}".format(d),
+                         "The year is 2007")
+
+        # classes we'll use for testing
+        class C:
+            def __init__(self, x=100):
+                self._x = x
+            def __format__(self, spec):
+                return spec
+
+        class D:
+            def __init__(self, x):
+                self.x = x
+            def __format__(self, spec):
+                return str(self.x)
+
+        # class with __str__, but no __format__
+        class E:
+            def __init__(self, x):
+                self.x = x
+            def __str__(self):
+                return 'E(' + self.x + ')'
+
+        # class with __repr__, but no __format__ or __str__
+        class F:
+            def __init__(self, x):
+                self.x = x
+            def __repr__(self):
+                return 'F(' + self.x + ')'
+
+        # class with __format__ that forwards to string, for some format_spec's
+        class G:
+            def __init__(self, x):
+                self.x = x
+            def __str__(self):
+                return "string is " + self.x
+            def __format__(self, format_spec):
+                if format_spec == 'd':
+                    return 'G(' + self.x + ')'
+                return object.__format__(self, format_spec)
+
+        # class that returns a bad type from __format__
+        class H:
+            def __format__(self, format_spec):
+                return 1.0
+
+        class I(datetime.date):
+            def __format__(self, format_spec):
+                return self.strftime(format_spec)
+
+        class J(int):
+            def __format__(self, format_spec):
+                return int.__format__(self * 2, format_spec)
+
+
+        self.assertEqual(''.format(), '')
+        self.assertEqual('abc'.format(), 'abc')
+        self.assertEqual('{0}'.format('abc'), 'abc')
+        self.assertEqual('{0:}'.format('abc'), 'abc')
+        self.assertEqual('X{0}'.format('abc'), 'Xabc')
+        self.assertEqual('{0}X'.format('abc'), 'abcX')
+        self.assertEqual('X{0}Y'.format('abc'), 'XabcY')
+        self.assertEqual('{1}'.format(1, 'abc'), 'abc')
+        self.assertEqual('X{1}'.format(1, 'abc'), 'Xabc')
+        self.assertEqual('{1}X'.format(1, 'abc'), 'abcX')
+        self.assertEqual('X{1}Y'.format(1, 'abc'), 'XabcY')
+        self.assertEqual('{0}'.format(-15), '-15')
+        self.assertEqual('{0}{1}'.format(-15, 'abc'), '-15abc')
+        self.assertEqual('{0}X{1}'.format(-15, 'abc'), '-15Xabc')
+        self.assertEqual('{{'.format(), '{')
+        self.assertEqual('}}'.format(), '}')
+        self.assertEqual('{{}}'.format(), '{}')
+        self.assertEqual('{{x}}'.format(), '{x}')
+        self.assertEqual('{{{0}}}'.format(123), '{123}')
+        self.assertEqual('{{{{0}}}}'.format(), '{{0}}')
+        self.assertEqual('}}{{'.format(), '}{')
+        self.assertEqual('}}x{{'.format(), '}x{')
+
+        # weird field names
+        self.assertEqual("{0[foo-bar]}".format({'foo-bar':'baz'}), 'baz')
+        self.assertEqual("{0[foo bar]}".format({'foo bar':'baz'}), 'baz')
+        self.assertEqual("{0[ ]}".format({' ':3}), '3')
+
+        self.assertEqual('{foo._x}'.format(foo=C(20)), '20')
+        self.assertEqual('{1}{0}'.format(D(10), D(20)), '2010')
+        self.assertEqual('{0._x.x}'.format(C(D('abc'))), 'abc')
+        self.assertEqual('{0[0]}'.format(['abc', 'def']), 'abc')
+        self.assertEqual('{0[1]}'.format(['abc', 'def']), 'def')
+        self.assertEqual('{0[1][0]}'.format(['abc', ['def']]), 'def')
+        self.assertEqual('{0[1][0].x}'.format(['abc', [D('def')]]), 'def')
+
+        # strings
+        self.assertEqual('{0:.3s}'.format('abc'), 'abc')
+        self.assertEqual('{0:.3s}'.format('ab'), 'ab')
+        self.assertEqual('{0:.3s}'.format('abcdef'), 'abc')
+        self.assertEqual('{0:.0s}'.format('abcdef'), '')
+        self.assertEqual('{0:3.3s}'.format('abc'), 'abc')
+        self.assertEqual('{0:2.3s}'.format('abc'), 'abc')
+        self.assertEqual('{0:2.2s}'.format('abc'), 'ab')
+        self.assertEqual('{0:3.2s}'.format('abc'), 'ab ')
+        self.assertEqual('{0:x<0s}'.format('result'), 'result')
+        self.assertEqual('{0:x<5s}'.format('result'), 'result')
+        self.assertEqual('{0:x<6s}'.format('result'), 'result')
+        self.assertEqual('{0:x<7s}'.format('result'), 'resultx')
+        self.assertEqual('{0:x<8s}'.format('result'), 'resultxx')
+        self.assertEqual('{0: <7s}'.format('result'), 'result ')
+        self.assertEqual('{0:<7s}'.format('result'), 'result ')
+        self.assertEqual('{0:>7s}'.format('result'), ' result')
+        self.assertEqual('{0:>8s}'.format('result'), '  result')
+        self.assertEqual('{0:^8s}'.format('result'), ' result ')
+        self.assertEqual('{0:^9s}'.format('result'), ' result  ')
+        self.assertEqual('{0:^10s}'.format('result'), '  result  ')
+        self.assertEqual('{0:10000}'.format('a'), 'a' + ' ' * 9999)
+        self.assertEqual('{0:10000}'.format(''), ' ' * 10000)
+        self.assertEqual('{0:10000000}'.format(''), ' ' * 10000000)
+
+        # format specifiers for user defined type
+        self.assertEqual('{0:abc}'.format(C()), 'abc')
+
+        # !r and !s coersions
+        self.assertEqual('{0!s}'.format('Hello'), 'Hello')
+        self.assertEqual('{0!s:}'.format('Hello'), 'Hello')
+        self.assertEqual('{0!s:15}'.format('Hello'), 'Hello          ')
+        self.assertEqual('{0!s:15s}'.format('Hello'), 'Hello          ')
+        self.assertEqual('{0!r}'.format('Hello'), "'Hello'")
+        self.assertEqual('{0!r:}'.format('Hello'), "'Hello'")
+        self.assertEqual('{0!r}'.format(F('Hello')), 'F(Hello)')
+
+        # test fallback to object.__format__
+        self.assertEqual('{0}'.format({}), '{}')
+        self.assertEqual('{0}'.format([]), '[]')
+        self.assertEqual('{0}'.format([1]), '[1]')
+        self.assertEqual('{0}'.format(E('data')), 'E(data)')
+        self.assertEqual('{0:^10}'.format(E('data')), ' E(data)  ')
+        self.assertEqual('{0:^10s}'.format(E('data')), ' E(data)  ')
+        self.assertEqual('{0:d}'.format(G('data')), 'G(data)')
+        self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
+        self.assertEqual('{0!s}'.format(G('data')), 'string is data')
+
+        self.assertEqual("{0:date: %Y-%m-%d}".format(I(year=2007,
+                                                       month=8,
+                                                       day=27)),
+                         "date: 2007-08-27")
+
+        # test deriving from a builtin type and overriding __format__
+        self.assertEqual("{0}".format(J(10)), "20")
+
+
+        # string format specifiers
+        self.assertEqual('{0:}'.format('a'), 'a')
+
+        # computed format specifiers
+        self.assertEqual("{0:.{1}}".format('hello world', 5), 'hello')
+        self.assertEqual("{0:.{1}s}".format('hello world', 5), 'hello')
+        self.assertEqual("{0:.{precision}s}".format('hello world', precision=5), 'hello')
+        self.assertEqual("{0:{width}.{precision}s}".format('hello world', width=10, precision=5), 'hello     ')
+        self.assertEqual("{0:{width}.{precision}s}".format('hello world', width='10', precision='5'), 'hello     ')
+
+        # test various errors
+        self.assertRaises(ValueError, '{'.format)
+        self.assertRaises(ValueError, '}'.format)
+        self.assertRaises(ValueError, 'a{'.format)
+        self.assertRaises(ValueError, 'a}'.format)
+        self.assertRaises(ValueError, '{a'.format)
+        self.assertRaises(ValueError, '}a'.format)
+        self.assertRaises(IndexError, '{0}'.format)
+        self.assertRaises(IndexError, '{1}'.format, 'abc')
+        self.assertRaises(KeyError,   '{x}'.format)
+        self.assertRaises(ValueError, "}{".format)
+        self.assertRaises(ValueError, "{".format)
+        self.assertRaises(ValueError, "}".format)
+        self.assertRaises(ValueError, "abc{0:{}".format)
+        self.assertRaises(ValueError, "{0".format)
+        self.assertRaises(IndexError, "{0.}".format)
+        self.assertRaises(ValueError, "{0.}".format, 0)
+        self.assertRaises(IndexError, "{0[}".format)
+        self.assertRaises(ValueError, "{0[}".format, [])
+        self.assertRaises(KeyError,   "{0]}".format)
+        self.assertRaises(ValueError, "{0.[]}".format, 0)
+        self.assertRaises(ValueError, "{0..foo}".format, 0)
+        self.assertRaises(ValueError, "{0[0}".format, 0)
+        self.assertRaises(ValueError, "{0[0:foo}".format, 0)
+        self.assertRaises(KeyError,   "{c]}".format)
+        self.assertRaises(ValueError, "{{ {{{0}}".format, 0)
+        self.assertRaises(ValueError, "{0}}".format, 0)
+        self.assertRaises(KeyError,   "{foo}".format, bar=3)
+        self.assertRaises(ValueError, "{0!x}".format, 3)
+        self.assertRaises(ValueError, "{0!}".format, 0)
+        self.assertRaises(ValueError, "{0!rs}".format, 0)
+        self.assertRaises(ValueError, "{!}".format)
+        self.assertRaises(ValueError, "{:}".format)
+        self.assertRaises(ValueError, "{:s}".format)
+        self.assertRaises(ValueError, "{}".format)
+
+        # can't have a replacement on the field name portion
+        self.assertRaises(TypeError, '{0[{1}]}'.format, 'abcdefg', 4)
+
+        # exceed maximum recursion depth
+        self.assertRaises(ValueError, "{0:{1:{2}}}".format, 'abc', 's', '')
+        self.assertRaises(ValueError, "{0:{1:{2:{3:{4:{5:{6}}}}}}}".format,
+                          0, 1, 2, 3, 4, 5, 6, 7)
+
+        # string format spec errors
+        self.assertRaises(ValueError, "{0:-s}".format, '')
+        self.assertRaises(ValueError, format, "", "-")
+        self.assertRaises(ValueError, "{0:=s}".format, '')
+
 
 def test_main():
     test_support.run_unittest(StrTest)

Modified: python/branches/trunk-math/Lib/test/test_strftime.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_strftime.py	(original)
+++ python/branches/trunk-math/Lib/test/test_strftime.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,7 @@
 
 # Sanity checker for time.strftime
 
-import time, calendar, sys, os, re
+import time, calendar, sys, re
 from test.test_support import verbose
 
 def main():

Modified: python/branches/trunk-math/Lib/test/test_string.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_string.py	(original)
+++ python/branches/trunk-math/Lib/test/test_string.py	Thu Feb 28 21:09:17 2008
@@ -106,6 +106,92 @@
         self.assertEqual(string.capwords('ABC-DEF-GHI', '-'), 'Abc-Def-Ghi')
         self.assertEqual(string.capwords('ABC-def DEF-ghi GHI'), 'Abc-def Def-ghi Ghi')
 
+    def test_formatter(self):
+        fmt = string.Formatter()
+        self.assertEqual(fmt.format("foo"), "foo")
+
+        self.assertEqual(fmt.format("foo{0}", "bar"), "foobar")
+        self.assertEqual(fmt.format("foo{1}{0}-{1}", "bar", 6), "foo6bar-6")
+        self.assertEqual(fmt.format("-{arg!r}-", arg='test'), "-'test'-")
+
+        # override get_value ############################################
+        class NamespaceFormatter(string.Formatter):
+            def __init__(self, namespace={}):
+                string.Formatter.__init__(self)
+                self.namespace = namespace
+
+            def get_value(self, key, args, kwds):
+                if isinstance(key, str):
+                    try:
+                        # Check explicitly passed arguments first
+                        return kwds[key]
+                    except KeyError:
+                        return self.namespace[key]
+                else:
+                    string.Formatter.get_value(key, args, kwds)
+
+        fmt = NamespaceFormatter({'greeting':'hello'})
+        self.assertEqual(fmt.format("{greeting}, world!"), 'hello, world!')
+
+
+        # override format_field #########################################
+        class CallFormatter(string.Formatter):
+            def format_field(self, value, format_spec):
+                return format(value(), format_spec)
+
+        fmt = CallFormatter()
+        self.assertEqual(fmt.format('*{0}*', lambda : 'result'), '*result*')
+
+
+        # override convert_field ########################################
+        class XFormatter(string.Formatter):
+            def convert_field(self, value, conversion):
+                if conversion == 'x':
+                    return None
+                return super(XFormatter, self).convert_field(value, conversion)
+
+        fmt = XFormatter()
+        self.assertEqual(fmt.format("{0!r}:{0!x}", 'foo', 'foo'), "'foo':None")
+
+
+        # override parse ################################################
+        class BarFormatter(string.Formatter):
+            # returns an iterable that contains tuples of the form:
+            # (literal_text, field_name, format_spec, conversion)
+            def parse(self, format_string):
+                for field in format_string.split('|'):
+                    if field[0] == '+':
+                        # it's markup
+                        field_name, _, format_spec = field[1:].partition(':')
+                        yield '', field_name, format_spec, None
+                    else:
+                        yield field, None, None, None
+
+        fmt = BarFormatter()
+        self.assertEqual(fmt.format('*|+0:^10s|*', 'foo'), '*   foo    *')
+
+        # test all parameters used
+        class CheckAllUsedFormatter(string.Formatter):
+            def check_unused_args(self, used_args, args, kwargs):
+                # Track which arguments actuallly got used
+                unused_args = set(kwargs.keys())
+                unused_args.update(range(0, len(args)))
+
+                for arg in used_args:
+                    unused_args.remove(arg)
+
+                if unused_args:
+                    raise ValueError("unused arguments")
+
+        fmt = CheckAllUsedFormatter()
+        self.assertEqual(fmt.format("{0}", 10), "10")
+        self.assertEqual(fmt.format("{0}{i}", 10, i=100), "10100")
+        self.assertEqual(fmt.format("{0}{i}{1}", 10, 20, i=100), "1010020")
+        self.assertRaises(ValueError, fmt.format, "{0}{i}{1}", 10, 20, i=100, j=0)
+        self.assertRaises(ValueError, fmt.format, "{0}", 10, 20)
+        self.assertRaises(ValueError, fmt.format, "{0}", 10, 20, i=100)
+        self.assertRaises(ValueError, fmt.format, "{i}", 10, 20, i=100)
+
 class BytesAliasTest(unittest.TestCase):
 
     def test_builtin(self):

Modified: python/branches/trunk-math/Lib/test/test_sunaudiodev.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_sunaudiodev.py	(original)
+++ python/branches/trunk-math/Lib/test/test_sunaudiodev.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,4 @@
-from test.test_support import verbose, findfile, TestFailed, TestSkipped
+from test.test_support import findfile, TestFailed, TestSkipped
 import sunaudiodev
 import os
 

Modified: python/branches/trunk-math/Lib/test/test_support.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_support.py	(original)
+++ python/branches/trunk-math/Lib/test/test_support.py	Thu Feb 28 21:09:17 2008
@@ -9,8 +9,8 @@
 import sys
 import os
 import os.path
+import shutil
 import warnings
-import types
 import unittest
 
 class Error(Exception):
@@ -65,6 +65,14 @@
     except OSError:
         pass
 
+def rmtree(path):
+    try:
+        shutil.rmtree(path)
+    except OSError, e:
+        # Unix returns ENOENT, Windows returns ESRCH.
+        if e.errno not in (errno.ENOENT, errno.ESRCH):
+            raise
+
 def forget(modname):
     '''"Forget" a module was ever imported by removing it from sys.modules and
     deleting any .pyc and .pyo files.'''
@@ -97,7 +105,7 @@
 
 def bind_port(sock, host='', preferred_port=54321):
     """Try to bind the sock to a port.  If we are running multiple
-    tests and we don't try multiple ports, the test can fails.  This
+    tests and we don't try multiple ports, the test can fail.  This
     makes the test more robust."""
 
     # Find some random ports that hopefully no one is listening on.

Modified: python/branches/trunk-math/Lib/test/test_threading.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_threading.py	(original)
+++ python/branches/trunk-math/Lib/test/test_threading.py	Thu Feb 28 21:09:17 2008
@@ -8,6 +8,7 @@
 import thread
 import time
 import unittest
+import weakref
 
 # A trivial mutable counter.
 class Counter(object):
@@ -253,6 +254,33 @@
         finally:
             sys.setcheckinterval(old_interval)
 
+    def test_no_refcycle_through_target(self):
+        class RunSelfFunction(object):
+            def __init__(self, should_raise):
+                # The links in this refcycle from Thread back to self
+                # should be cleaned up when the thread completes.
+                self.should_raise = should_raise
+                self.thread = threading.Thread(target=self._run,
+                                               args=(self,),
+                                               kwargs={'yet_another':self})
+                self.thread.start()
+
+            def _run(self, other_ref, yet_another):
+                if self.should_raise:
+                    raise SystemExit
+
+        cyclic_object = RunSelfFunction(should_raise=False)
+        weak_cyclic_object = weakref.ref(cyclic_object)
+        cyclic_object.thread.join()
+        del cyclic_object
+        self.assertEquals(None, weak_cyclic_object())
+
+        raising_cyclic_object = RunSelfFunction(should_raise=True)
+        weak_raising_cyclic_object = weakref.ref(raising_cyclic_object)
+        raising_cyclic_object.thread.join()
+        del raising_cyclic_object
+        self.assertEquals(None, weak_raising_cyclic_object())
+
 
 class ThreadingExceptionTests(unittest.TestCase):
     # A RuntimeError should be raised if Thread.start() is called

Modified: python/branches/trunk-math/Lib/test/test_tuple.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_tuple.py	(original)
+++ python/branches/trunk-math/Lib/test/test_tuple.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,3 @@
-import unittest
 from test import test_support, seq_tests
 
 class TupleTest(seq_tests.CommonTest):

Modified: python/branches/trunk-math/Lib/test/test_types.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_types.py	(original)
+++ python/branches/trunk-math/Lib/test/test_types.py	Thu Feb 28 21:09:17 2008
@@ -89,6 +89,29 @@
         if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
         else: self.fail('float() does not work properly')
 
+    def test_float_to_string(self):
+        def test(f, result):
+            self.assertEqual(f.__format__('e'), result)
+            self.assertEqual('%e' % f, result)
+
+        # test all 2 digit exponents, both with __format__ and with
+        #  '%' formatting
+        for i in range(-99, 100):
+            test(float('1.5e'+str(i)), '1.500000e{0:+03d}'.format(i))
+
+        # test some 3 digit exponents
+        self.assertEqual(1.5e100.__format__('e'), '1.500000e+100')
+        self.assertEqual('%e' % 1.5e100, '1.500000e+100')
+
+        self.assertEqual(1.5e101.__format__('e'), '1.500000e+101')
+        self.assertEqual('%e' % 1.5e101, '1.500000e+101')
+
+        self.assertEqual(1.5e-100.__format__('e'), '1.500000e-100')
+        self.assertEqual('%e' % 1.5e-100, '1.500000e-100')
+
+        self.assertEqual(1.5e-101.__format__('e'), '1.500000e-101')
+        self.assertEqual('%e' % 1.5e-101, '1.500000e-101')
+
     def test_normal_integers(self):
         # Ensure the first 256 integers are shared
         a = 256
@@ -266,6 +289,259 @@
         except TypeError: pass
         else: self.fail("char buffer (at C level) not working")
 
+    def test_int__format__(self):
+        def test(i, format_spec, result):
+            # just make sure I'm not accidentally checking longs
+            assert type(i) == int
+            assert type(format_spec) == str
+            self.assertEqual(i.__format__(format_spec), result)
+            self.assertEqual(i.__format__(unicode(format_spec)), result)
+
+        test(123456789, 'd', '123456789')
+        test(123456789, 'd', '123456789')
+
+        test(1, 'c', '\01')
+
+        # sign and aligning are interdependent
+        test(1, "-", '1')
+        test(-1, "-", '-1')
+        test(1, "-3", '  1')
+        test(-1, "-3", ' -1')
+        test(1, "+3", ' +1')
+        test(-1, "+3", ' -1')
+        test(1, " 3", '  1')
+        test(-1, " 3", ' -1')
+        test(1, " ", ' 1')
+        test(-1, " ", '-1')
+
+        # hex
+        test(3, "x", "3")
+        test(3, "X", "3")
+        test(1234, "x", "4d2")
+        test(-1234, "x", "-4d2")
+        test(1234, "8x", "     4d2")
+        test(-1234, "8x", "    -4d2")
+        test(1234, "x", "4d2")
+        test(-1234, "x", "-4d2")
+        test(-3, "x", "-3")
+        test(-3, "X", "-3")
+        test(int('be', 16), "x", "be")
+        test(int('be', 16), "X", "BE")
+        test(-int('be', 16), "x", "-be")
+        test(-int('be', 16), "X", "-BE")
+
+        # octal
+        test(3, "o", "3")
+        test(-3, "o", "-3")
+        test(65, "o", "101")
+        test(-65, "o", "-101")
+        test(1234, "o", "2322")
+        test(-1234, "o", "-2322")
+        test(1234, "-o", "2322")
+        test(-1234, "-o", "-2322")
+        test(1234, " o", " 2322")
+        test(-1234, " o", "-2322")
+        test(1234, "+o", "+2322")
+        test(-1234, "+o", "-2322")
+
+        # binary
+        test(3, "b", "11")
+        test(-3, "b", "-11")
+        test(1234, "b", "10011010010")
+        test(-1234, "b", "-10011010010")
+        test(1234, "-b", "10011010010")
+        test(-1234, "-b", "-10011010010")
+        test(1234, " b", " 10011010010")
+        test(-1234, " b", "-10011010010")
+        test(1234, "+b", "+10011010010")
+        test(-1234, "+b", "-10011010010")
+
+        # make sure these are errors
+
+        # precision disallowed
+        self.assertRaises(ValueError, 3 .__format__, "1.3")
+        # sign not allowed with 'c'
+        self.assertRaises(ValueError, 3 .__format__, "+c")
+        # format spec must be string
+        self.assertRaises(TypeError, 3 .__format__, None)
+        self.assertRaises(TypeError, 3 .__format__, 0)
+
+        # ensure that only int and float type specifiers work
+        for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
+                            [chr(x) for x in range(ord('A'), ord('Z')+1)]):
+            if not format_spec in 'bcdoxXeEfFgGn%':
+                self.assertRaises(ValueError, 0 .__format__, format_spec)
+                self.assertRaises(ValueError, 1 .__format__, format_spec)
+                self.assertRaises(ValueError, (-1) .__format__, format_spec)
+
+        # ensure that float type specifiers work; format converts
+        #  the int to a float
+        for format_spec in 'eEfFgGn%':
+            for value in [0, 1, -1, 100, -100, 1234567890, -1234567890]:
+                self.assertEqual(value.__format__(format_spec),
+                                 float(value).__format__(format_spec))
+
+    def test_long__format__(self):
+        def test(i, format_spec, result):
+            # make sure we're not accidentally checking ints
+            assert type(i) == long
+            assert type(format_spec) == str
+            self.assertEqual(i.__format__(format_spec), result)
+            self.assertEqual(i.__format__(unicode(format_spec)), result)
+
+        test(10**100, 'd', '1' + '0' * 100)
+        test(10**100+100, 'd', '1' + '0' * 97 + '100')
+
+        test(123456789L, 'd', '123456789')
+        test(123456789L, 'd', '123456789')
+
+        # sign and aligning are interdependent
+        test(1L, "-", '1')
+        test(-1L, "-", '-1')
+        test(1L, "-3", '  1')
+        test(-1L, "-3", ' -1')
+        test(1L, "+3", ' +1')
+        test(-1L, "+3", ' -1')
+        test(1L, " 3", '  1')
+        test(-1L, " 3", ' -1')
+        test(1L, " ", ' 1')
+        test(-1L, " ", '-1')
+
+        test(1L, 'c', '\01')
+
+        # hex
+        test(3L, "x", "3")
+        test(3L, "X", "3")
+        test(1234L, "x", "4d2")
+        test(-1234L, "x", "-4d2")
+        test(1234L, "8x", "     4d2")
+        test(-1234L, "8x", "    -4d2")
+        test(1234L, "x", "4d2")
+        test(-1234L, "x", "-4d2")
+        test(-3L, "x", "-3")
+        test(-3L, "X", "-3")
+        test(long('be', 16), "x", "be")
+        test(long('be', 16), "X", "BE")
+        test(-long('be', 16), "x", "-be")
+        test(-long('be', 16), "X", "-BE")
+
+        # octal
+        test(3L, "o", "3")
+        test(-3L, "o", "-3")
+        test(65L, "o", "101")
+        test(-65L, "o", "-101")
+        test(1234L, "o", "2322")
+        test(-1234L, "o", "-2322")
+        test(1234L, "-o", "2322")
+        test(-1234L, "-o", "-2322")
+        test(1234L, " o", " 2322")
+        test(-1234L, " o", "-2322")
+        test(1234L, "+o", "+2322")
+        test(-1234L, "+o", "-2322")
+
+        # binary
+        test(3L, "b", "11")
+        test(-3L, "b", "-11")
+        test(1234L, "b", "10011010010")
+        test(-1234L, "b", "-10011010010")
+        test(1234L, "-b", "10011010010")
+        test(-1234L, "-b", "-10011010010")
+        test(1234L, " b", " 10011010010")
+        test(-1234L, " b", "-10011010010")
+        test(1234L, "+b", "+10011010010")
+        test(-1234L, "+b", "-10011010010")
+
+        # make sure these are errors
+
+        # precision disallowed
+        self.assertRaises(ValueError, 3L .__format__, "1.3")
+        # sign not allowed with 'c'
+        self.assertRaises(ValueError, 3L .__format__, "+c")
+        # format spec must be string
+        self.assertRaises(TypeError, 3L .__format__, None)
+        self.assertRaises(TypeError, 3L .__format__, 0)
+
+        # ensure that only int and float type specifiers work
+        for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
+                            [chr(x) for x in range(ord('A'), ord('Z')+1)]):
+            if not format_spec in 'bcdoxXeEfFgGn%':
+                self.assertRaises(ValueError, 0L .__format__, format_spec)
+                self.assertRaises(ValueError, 1L .__format__, format_spec)
+                self.assertRaises(ValueError, (-1L) .__format__, format_spec)
+
+        # ensure that float type specifiers work; format converts
+        #  the long to a float
+        for format_spec in 'eEfFgGn%':
+            for value in [0L, 1L, -1L, 100L, -100L, 1234567890L, -1234567890L]:
+                self.assertEqual(value.__format__(format_spec),
+                                 float(value).__format__(format_spec))
+
+    def test_float__format__(self):
+        # these should be rewritten to use both format(x, spec) and
+        # x.__format__(spec)
+
+        def test(f, format_spec, result):
+            assert type(f) == float
+            assert type(format_spec) == str
+            self.assertEqual(f.__format__(format_spec), result)
+            self.assertEqual(f.__format__(unicode(format_spec)), result)
+
+        test(0.0, 'f', '0.000000')
+
+        # the default is 'g', except for empty format spec
+        test(0.0, '', '0.0')
+        test(0.01, '', '0.01')
+        test(0.01, 'g', '0.01')
+
+        test( 1.0, ' g', ' 1')
+        test(-1.0, ' g', '-1')
+        test( 1.0, '+g', '+1')
+        test(-1.0, '+g', '-1')
+        test(1.1234e200, 'g', '1.1234e+200')
+        test(1.1234e200, 'G', '1.1234E+200')
+
+
+        test(1.0, 'f', '1.000000')
+
+        test(-1.0, 'f', '-1.000000')
+
+        test( 1.0, ' f', ' 1.000000')
+        test(-1.0, ' f', '-1.000000')
+        test( 1.0, '+f', '+1.000000')
+        test(-1.0, '+f', '-1.000000')
+        test(1.1234e90, 'f', '1.1234e+90')
+        test(1.1234e90, 'F', '1.1234e+90')
+        test(1.1234e200, 'f', '1.1234e+200')
+        test(1.1234e200, 'F', '1.1234e+200')
+
+        test( 1.0, 'e', '1.000000e+00')
+        test(-1.0, 'e', '-1.000000e+00')
+        test( 1.0, 'E', '1.000000E+00')
+        test(-1.0, 'E', '-1.000000E+00')
+        test(1.1234e20, 'e', '1.123400e+20')
+        test(1.1234e20, 'E', '1.123400E+20')
+
+        # % formatting
+        test(-1.0, '%', '-100.000000%')
+
+        # format spec must be string
+        self.assertRaises(TypeError, 3.0.__format__, None)
+        self.assertRaises(TypeError, 3.0.__format__, 0)
+
+        # other format specifiers shouldn't work on floats,
+        #  in particular int specifiers
+        for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
+                            [chr(x) for x in range(ord('A'), ord('Z')+1)]):
+            if not format_spec in 'eEfFgGn%':
+                self.assertRaises(ValueError, format, 0.0, format_spec)
+                self.assertRaises(ValueError, format, 1.0, format_spec)
+                self.assertRaises(ValueError, format, -1.0, format_spec)
+                self.assertRaises(ValueError, format, 1e100, format_spec)
+                self.assertRaises(ValueError, format, -1e100, format_spec)
+                self.assertRaises(ValueError, format, 1e-100, format_spec)
+                self.assertRaises(ValueError, format, -1e-100, format_spec)
+
+
 def test_main():
     run_unittest(TypesTests)
 

Modified: python/branches/trunk-math/Lib/test/test_unicode.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_unicode.py	(original)
+++ python/branches/trunk-math/Lib/test/test_unicode.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
 
 """#"
-import unittest, sys, struct, codecs, new
+import sys, struct, codecs
 from test import test_support, string_tests
 
 # Error handling (bad decoder return)
@@ -825,6 +825,277 @@
             return
         self.assertRaises(OverflowError, u't\tt\t'.expandtabs, sys.maxint)
 
+    def test__format__(self):
+        def test(value, format, expected):
+            # test both with and without the trailing 's'
+            self.assertEqual(value.__format__(format), expected)
+            self.assertEqual(value.__format__(format + u's'), expected)
+
+        test(u'', u'', u'')
+        test(u'abc', u'', u'abc')
+        test(u'abc', u'.3', u'abc')
+        test(u'ab', u'.3', u'ab')
+        test(u'abcdef', u'.3', u'abc')
+        test(u'abcdef', u'.0', u'')
+        test(u'abc', u'3.3', u'abc')
+        test(u'abc', u'2.3', u'abc')
+        test(u'abc', u'2.2', u'ab')
+        test(u'abc', u'3.2', u'ab ')
+        test(u'result', u'x<0', u'result')
+        test(u'result', u'x<5', u'result')
+        test(u'result', u'x<6', u'result')
+        test(u'result', u'x<7', u'resultx')
+        test(u'result', u'x<8', u'resultxx')
+        test(u'result', u' <7', u'result ')
+        test(u'result', u'<7', u'result ')
+        test(u'result', u'>7', u' result')
+        test(u'result', u'>8', u'  result')
+        test(u'result', u'^8', u' result ')
+        test(u'result', u'^9', u' result  ')
+        test(u'result', u'^10', u'  result  ')
+        test(u'a', u'10000', u'a' + u' ' * 9999)
+        test(u'', u'10000', u' ' * 10000)
+        test(u'', u'10000000', u' ' * 10000000)
+
+        # test mixing unicode and str
+        self.assertEqual(u'abc'.__format__('s'), u'abc')
+        self.assertEqual(u'abc'.__format__('->10s'), u'-------abc')
+
+    def test_format(self):
+        self.assertEqual(u''.format(), u'')
+        self.assertEqual(u'a'.format(), u'a')
+        self.assertEqual(u'ab'.format(), u'ab')
+        self.assertEqual(u'a{{'.format(), u'a{')
+        self.assertEqual(u'a}}'.format(), u'a}')
+        self.assertEqual(u'{{b'.format(), u'{b')
+        self.assertEqual(u'}}b'.format(), u'}b')
+        self.assertEqual(u'a{{b'.format(), u'a{b')
+
+        # examples from the PEP:
+        import datetime
+        self.assertEqual(u"My name is {0}".format(u'Fred'), u"My name is Fred")
+        self.assertEqual(u"My name is {0[name]}".format(dict(name=u'Fred')),
+                         u"My name is Fred")
+        self.assertEqual(u"My name is {0} :-{{}}".format(u'Fred'),
+                         u"My name is Fred :-{}")
+
+        # datetime.__format__ doesn't work with unicode
+        #d = datetime.date(2007, 8, 18)
+        #self.assertEqual("The year is {0.year}".format(d),
+        #                 "The year is 2007")
+
+        # classes we'll use for testing
+        class C:
+            def __init__(self, x=100):
+                self._x = x
+            def __format__(self, spec):
+                return spec
+
+        class D:
+            def __init__(self, x):
+                self.x = x
+            def __format__(self, spec):
+                return str(self.x)
+
+        # class with __str__, but no __format__
+        class E:
+            def __init__(self, x):
+                self.x = x
+            def __str__(self):
+                return u'E(' + self.x + u')'
+
+        # class with __repr__, but no __format__ or __str__
+        class F:
+            def __init__(self, x):
+                self.x = x
+            def __repr__(self):
+                return u'F(' + self.x + u')'
+
+        # class with __format__ that forwards to string, for some format_spec's
+        class G:
+            def __init__(self, x):
+                self.x = x
+            def __str__(self):
+                return u"string is " + self.x
+            def __format__(self, format_spec):
+                if format_spec == 'd':
+                    return u'G(' + self.x + u')'
+                return object.__format__(self, format_spec)
+
+        # class that returns a bad type from __format__
+        class H:
+            def __format__(self, format_spec):
+                return 1.0
+
+        class I(datetime.date):
+            def __format__(self, format_spec):
+                return self.strftime(format_spec)
+
+        class J(int):
+            def __format__(self, format_spec):
+                return int.__format__(self * 2, format_spec)
+
+
+        self.assertEqual(u''.format(), u'')
+        self.assertEqual(u'abc'.format(), u'abc')
+        self.assertEqual(u'{0}'.format(u'abc'), u'abc')
+        self.assertEqual(u'{0:}'.format(u'abc'), u'abc')
+        self.assertEqual(u'X{0}'.format(u'abc'), u'Xabc')
+        self.assertEqual(u'{0}X'.format(u'abc'), u'abcX')
+        self.assertEqual(u'X{0}Y'.format(u'abc'), u'XabcY')
+        self.assertEqual(u'{1}'.format(1, u'abc'), u'abc')
+        self.assertEqual(u'X{1}'.format(1, u'abc'), u'Xabc')
+        self.assertEqual(u'{1}X'.format(1, u'abc'), u'abcX')
+        self.assertEqual(u'X{1}Y'.format(1, u'abc'), u'XabcY')
+        self.assertEqual(u'{0}'.format(-15), u'-15')
+        self.assertEqual(u'{0}{1}'.format(-15, u'abc'), u'-15abc')
+        self.assertEqual(u'{0}X{1}'.format(-15, u'abc'), u'-15Xabc')
+        self.assertEqual(u'{{'.format(), u'{')
+        self.assertEqual(u'}}'.format(), u'}')
+        self.assertEqual(u'{{}}'.format(), u'{}')
+        self.assertEqual(u'{{x}}'.format(), u'{x}')
+        self.assertEqual(u'{{{0}}}'.format(123), u'{123}')
+        self.assertEqual(u'{{{{0}}}}'.format(), u'{{0}}')
+        self.assertEqual(u'}}{{'.format(), u'}{')
+        self.assertEqual(u'}}x{{'.format(), u'}x{')
+
+        # weird field names
+        self.assertEqual(u"{0[foo-bar]}".format({u'foo-bar':u'baz'}), u'baz')
+        self.assertEqual(u"{0[foo bar]}".format({u'foo bar':u'baz'}), u'baz')
+        self.assertEqual(u"{0[ ]}".format({u' ':3}), u'3')
+
+        self.assertEqual(u'{foo._x}'.format(foo=C(20)), u'20')
+        self.assertEqual(u'{1}{0}'.format(D(10), D(20)), u'2010')
+        self.assertEqual(u'{0._x.x}'.format(C(D(u'abc'))), u'abc')
+        self.assertEqual(u'{0[0]}'.format([u'abc', u'def']), u'abc')
+        self.assertEqual(u'{0[1]}'.format([u'abc', u'def']), u'def')
+        self.assertEqual(u'{0[1][0]}'.format([u'abc', [u'def']]), u'def')
+        self.assertEqual(u'{0[1][0].x}'.format(['abc', [D(u'def')]]), u'def')
+
+        # strings
+        self.assertEqual(u'{0:.3s}'.format(u'abc'), u'abc')
+        self.assertEqual(u'{0:.3s}'.format(u'ab'), u'ab')
+        self.assertEqual(u'{0:.3s}'.format(u'abcdef'), u'abc')
+        self.assertEqual(u'{0:.0s}'.format(u'abcdef'), u'')
+        self.assertEqual(u'{0:3.3s}'.format(u'abc'), u'abc')
+        self.assertEqual(u'{0:2.3s}'.format(u'abc'), u'abc')
+        self.assertEqual(u'{0:2.2s}'.format(u'abc'), u'ab')
+        self.assertEqual(u'{0:3.2s}'.format(u'abc'), u'ab ')
+        self.assertEqual(u'{0:x<0s}'.format(u'result'), u'result')
+        self.assertEqual(u'{0:x<5s}'.format(u'result'), u'result')
+        self.assertEqual(u'{0:x<6s}'.format(u'result'), u'result')
+        self.assertEqual(u'{0:x<7s}'.format(u'result'), u'resultx')
+        self.assertEqual(u'{0:x<8s}'.format(u'result'), u'resultxx')
+        self.assertEqual(u'{0: <7s}'.format(u'result'), u'result ')
+        self.assertEqual(u'{0:<7s}'.format(u'result'), u'result ')
+        self.assertEqual(u'{0:>7s}'.format(u'result'), u' result')
+        self.assertEqual(u'{0:>8s}'.format(u'result'), u'  result')
+        self.assertEqual(u'{0:^8s}'.format(u'result'), u' result ')
+        self.assertEqual(u'{0:^9s}'.format(u'result'), u' result  ')
+        self.assertEqual(u'{0:^10s}'.format(u'result'), u'  result  ')
+        self.assertEqual(u'{0:10000}'.format(u'a'), u'a' + u' ' * 9999)
+        self.assertEqual(u'{0:10000}'.format(u''), u' ' * 10000)
+        self.assertEqual(u'{0:10000000}'.format(u''), u' ' * 10000000)
+
+        # format specifiers for user defined type
+        self.assertEqual(u'{0:abc}'.format(C()), u'abc')
+
+        # !r and !s coersions
+        self.assertEqual(u'{0!s}'.format(u'Hello'), u'Hello')
+        self.assertEqual(u'{0!s:}'.format(u'Hello'), u'Hello')
+        self.assertEqual(u'{0!s:15}'.format(u'Hello'), u'Hello          ')
+        self.assertEqual(u'{0!s:15s}'.format(u'Hello'), u'Hello          ')
+        self.assertEqual(u'{0!r}'.format(u'Hello'), u"u'Hello'")
+        self.assertEqual(u'{0!r:}'.format(u'Hello'), u"u'Hello'")
+        self.assertEqual(u'{0!r}'.format(F(u'Hello')), u'F(Hello)')
+
+        # test fallback to object.__format__
+        self.assertEqual(u'{0}'.format({}), u'{}')
+        self.assertEqual(u'{0}'.format([]), u'[]')
+        self.assertEqual(u'{0}'.format([1]), u'[1]')
+        self.assertEqual(u'{0}'.format(E(u'data')), u'E(data)')
+        self.assertEqual(u'{0:^10}'.format(E(u'data')), u' E(data)  ')
+        self.assertEqual(u'{0:^10s}'.format(E(u'data')), u' E(data)  ')
+        self.assertEqual(u'{0:d}'.format(G(u'data')), u'G(data)')
+        self.assertEqual(u'{0:>15s}'.format(G(u'data')), u' string is data')
+        self.assertEqual(u'{0!s}'.format(G(u'data')), u'string is data')
+
+        self.assertEqual("{0:date: %Y-%m-%d}".format(I(year=2007,
+                                                       month=8,
+                                                       day=27)),
+                         "date: 2007-08-27")
+
+        # test deriving from a builtin type and overriding __format__
+        self.assertEqual("{0}".format(J(10)), "20")
+
+
+        # string format specifiers
+        self.assertEqual('{0:}'.format('a'), 'a')
+
+        # computed format specifiers
+        self.assertEqual("{0:.{1}}".format('hello world', 5), 'hello')
+        self.assertEqual("{0:.{1}s}".format('hello world', 5), 'hello')
+        self.assertEqual("{0:.{precision}s}".format('hello world', precision=5), 'hello')
+        self.assertEqual("{0:{width}.{precision}s}".format('hello world', width=10, precision=5), 'hello     ')
+        self.assertEqual("{0:{width}.{precision}s}".format('hello world', width='10', precision='5'), 'hello     ')
+
+        # test various errors
+        self.assertRaises(ValueError, '{'.format)
+        self.assertRaises(ValueError, '}'.format)
+        self.assertRaises(ValueError, 'a{'.format)
+        self.assertRaises(ValueError, 'a}'.format)
+        self.assertRaises(ValueError, '{a'.format)
+        self.assertRaises(ValueError, '}a'.format)
+        self.assertRaises(IndexError, '{0}'.format)
+        self.assertRaises(IndexError, '{1}'.format, 'abc')
+        self.assertRaises(KeyError,   '{x}'.format)
+        self.assertRaises(ValueError, "}{".format)
+        self.assertRaises(ValueError, "{".format)
+        self.assertRaises(ValueError, "}".format)
+        self.assertRaises(ValueError, "abc{0:{}".format)
+        self.assertRaises(ValueError, "{0".format)
+        self.assertRaises(IndexError, "{0.}".format)
+        self.assertRaises(ValueError, "{0.}".format, 0)
+        self.assertRaises(IndexError, "{0[}".format)
+        self.assertRaises(ValueError, "{0[}".format, [])
+        self.assertRaises(KeyError,   "{0]}".format)
+        self.assertRaises(ValueError, "{0.[]}".format, 0)
+        self.assertRaises(ValueError, "{0..foo}".format, 0)
+        self.assertRaises(ValueError, "{0[0}".format, 0)
+        self.assertRaises(ValueError, "{0[0:foo}".format, 0)
+        self.assertRaises(KeyError,   "{c]}".format)
+        self.assertRaises(ValueError, "{{ {{{0}}".format, 0)
+        self.assertRaises(ValueError, "{0}}".format, 0)
+        self.assertRaises(KeyError,   "{foo}".format, bar=3)
+        self.assertRaises(ValueError, "{0!x}".format, 3)
+        self.assertRaises(ValueError, "{0!}".format, 0)
+        self.assertRaises(ValueError, "{0!rs}".format, 0)
+        self.assertRaises(ValueError, "{!}".format)
+        self.assertRaises(ValueError, "{:}".format)
+        self.assertRaises(ValueError, "{:s}".format)
+        self.assertRaises(ValueError, "{}".format)
+
+        # can't have a replacement on the field name portion
+        self.assertRaises(TypeError, '{0[{1}]}'.format, 'abcdefg', 4)
+
+        # exceed maximum recursion depth
+        self.assertRaises(ValueError, "{0:{1:{2}}}".format, 'abc', 's', '')
+        self.assertRaises(ValueError, "{0:{1:{2:{3:{4:{5:{6}}}}}}}".format,
+                          0, 1, 2, 3, 4, 5, 6, 7)
+
+        # string format spec errors
+        self.assertRaises(ValueError, "{0:-s}".format, '')
+        self.assertRaises(ValueError, format, "", "-")
+        self.assertRaises(ValueError, "{0:=s}".format, '')
+
+        # test combining string and unicode
+        self.assertEqual(u"foo{0}".format('bar'), u'foobar')
+        # This will try to convert the argument from unicode to str, which
+        #  will succeed
+        self.assertEqual("foo{0}".format(u'bar'), 'foobar')
+        # This will try to convert the argument from unicode to str, which
+        #  will fail
+        self.assertRaises(UnicodeEncodeError, "foo{0}".format, u'\u1000bar')
 
 def test_main():
     test_support.run_unittest(__name__)

Modified: python/branches/trunk-math/Lib/test/test_unpack.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_unpack.py	(original)
+++ python/branches/trunk-math/Lib/test/test_unpack.py	Thu Feb 28 21:09:17 2008
@@ -122,7 +122,6 @@
 __test__ = {'doctests' : doctests}
 
 def test_main(verbose=False):
-    import sys
     from test import test_support
     from test import test_unpack
     test_support.run_doctest(test_unpack, verbose)

Modified: python/branches/trunk-math/Lib/test/test_urllib.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_urllib.py	(original)
+++ python/branches/trunk-math/Lib/test/test_urllib.py	Thu Feb 28 21:09:17 2008
@@ -8,10 +8,6 @@
 import mimetools
 import tempfile
 import StringIO
-import ftplib
-import threading
-import socket
-import time
 
 def hexescape(char):
     """Escape char as RFC 2396 specifies"""

Modified: python/branches/trunk-math/Lib/test/test_urllib2.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_urllib2.py	(original)
+++ python/branches/trunk-math/Lib/test/test_urllib2.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,7 @@
 import unittest
 from test import test_support
 
-import os, socket
+import os
 import StringIO
 
 import urllib2
@@ -589,7 +589,7 @@
             self.assertEqual(int(headers["Content-length"]), len(data))
 
     def test_file(self):
-        import time, rfc822, socket
+        import rfc822, socket
         h = urllib2.FileHandler()
         o = h.parent = MockOpener()
 
@@ -993,7 +993,7 @@
     def _test_basic_auth(self, opener, auth_handler, auth_header,
                          realm, http_handler, password_manager,
                          request_url, protected_url):
-        import base64, httplib
+        import base64
         user, password = "wile", "coyote"
 
         # .add_password() fed through to password manager

Modified: python/branches/trunk-math/Lib/test/test_urllib2_localnet.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_urllib2_localnet.py	(original)
+++ python/branches/trunk-math/Lib/test/test_urllib2_localnet.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 #!/usr/bin/env python
 
-import sys
 import threading
 import urlparse
 import urllib2

Modified: python/branches/trunk-math/Lib/test/test_userdict.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_userdict.py	(original)
+++ python/branches/trunk-math/Lib/test/test_userdict.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # Check every path through every method of UserDict
 
-import unittest
 from test import test_support, mapping_tests
 import UserDict
 

Modified: python/branches/trunk-math/Lib/test/test_userlist.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_userlist.py	(original)
+++ python/branches/trunk-math/Lib/test/test_userlist.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Check every path through every method of UserList
 
 from UserList import UserList
-import unittest
 from test import test_support, list_tests
 
 class UserListTest(list_tests.CommonTest):

Modified: python/branches/trunk-math/Lib/test/test_userstring.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_userstring.py	(original)
+++ python/branches/trunk-math/Lib/test/test_userstring.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 # UserString is a wrapper around the native builtin string type.
 # UserString instances should behave similar to builtin string objects.
 
-import unittest
 import string
 from test import test_support, string_tests
 

Modified: python/branches/trunk-math/Lib/test/test_uu.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_uu.py	(original)
+++ python/branches/trunk-math/Lib/test/test_uu.py	Thu Feb 28 21:09:17 2008
@@ -8,7 +8,6 @@
 
 import sys, os, uu, cStringIO
 import uu
-from StringIO import StringIO
 
 plaintext = "The smooth-scaled python crept over the sleeping dog\n"
 

Modified: python/branches/trunk-math/Lib/test/test_whichdb.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_whichdb.py	(original)
+++ python/branches/trunk-math/Lib/test/test_whichdb.py	Thu Feb 28 21:09:17 2008
@@ -8,7 +8,6 @@
 import unittest
 import whichdb
 import anydbm
-import tempfile
 import glob
 
 _fname = test.test_support.TESTFN

Modified: python/branches/trunk-math/Lib/test/test_xml_etree.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_xml_etree.py	(original)
+++ python/branches/trunk-math/Lib/test/test_xml_etree.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,8 @@
 # all included components work as they should.  For a more extensive
 # test suite, see the selftest script in the ElementTree distribution.
 
-import doctest, sys
+import doctest
+import sys
 
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_xml_etree_c.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_xml_etree_c.py	(original)
+++ python/branches/trunk-math/Lib/test/test_xml_etree_c.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,7 @@
 # xml.etree test for cElementTree
 
-import doctest, sys
+import doctest
+import sys
 
 from test import test_support
 

Modified: python/branches/trunk-math/Lib/test/test_xmlrpc.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_xmlrpc.py	(original)
+++ python/branches/trunk-math/Lib/test/test_xmlrpc.py	Thu Feb 28 21:09:17 2008
@@ -33,10 +33,6 @@
                         (2005, 02, 10, 11, 41, 23, 0, 1, -1)),
           'datetime3': xmlrpclib.DateTime(
                         datetime.datetime(2005, 02, 10, 11, 41, 23)),
-          'datetime4': xmlrpclib.DateTime(
-                        datetime.date(2005, 02, 10)),
-          'datetime5': xmlrpclib.DateTime(
-                        datetime.time(11, 41, 23)),
           }]
 
 class XMLRPCTestCase(unittest.TestCase):
@@ -59,34 +55,14 @@
         (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
         self.assertEquals(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
 
-    def test_dump_bare_date(self):
-        # This checks that an unwrapped datetime.date object can be handled
-        # by the marshalling code.  This can't be done via test_dump_load()
-        # since the unmarshaller produces a datetime object
-        d = datetime.datetime(2005, 02, 10, 11, 41, 23).date()
-        s = xmlrpclib.dumps((d,))
-        (newd,), m = xmlrpclib.loads(s, use_datetime=1)
-        self.assertEquals(newd.date(), d)
-        self.assertEquals(newd.time(), datetime.time(0, 0, 0))
-        self.assertEquals(m, None)
-
-        (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
-        self.assertEquals(newdt, xmlrpclib.DateTime('20050210T00:00:00'))
-
-    def test_dump_bare_time(self):
-        # This checks that an unwrapped datetime.time object can be handled
-        # by the marshalling code.  This can't be done via test_dump_load()
-        # since the unmarshaller produces a datetime object
-        t = datetime.datetime(2005, 02, 10, 11, 41, 23).time()
-        s = xmlrpclib.dumps((t,))
-        (newt,), m = xmlrpclib.loads(s, use_datetime=1)
-        today = datetime.datetime.now().date().strftime("%Y%m%d")
-        self.assertEquals(newt.time(), t)
-        self.assertEquals(newt.date(), datetime.datetime.now().date())
-        self.assertEquals(m, None)
-
-        (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
-        self.assertEquals(newdt, xmlrpclib.DateTime('%sT11:41:23'%today))
+    def test_cmp_datetime_DateTime(self):
+        now = datetime.datetime.now()
+        dt = xmlrpclib.DateTime(now.timetuple())
+        self.assert_(dt == now)
+        self.assert_(now == dt)
+        then = now + datetime.timedelta(seconds=4)
+        self.assert_(then >= dt)
+        self.assert_(dt < then)
 
     def test_bug_1164912 (self):
         d = xmlrpclib.DateTime()
@@ -242,21 +218,6 @@
         t = xmlrpclib.DateTime(d)
         self.assertEqual(str(t), '20070102T03:04:05')
 
-    def test_datetime_date(self):
-        d = datetime.date(2007,9,8)
-        t = xmlrpclib.DateTime(d)
-        self.assertEqual(str(t), '20070908T00:00:00')
-
-    def test_datetime_time(self):
-        d = datetime.time(13,17,19)
-        # allow for date rollover by checking today's or tomorrow's dates
-        dd1 = datetime.datetime.now().date()
-        dd2 = dd1 + datetime.timedelta(days=1)
-        vals = (dd1.strftime('%Y%m%dT13:17:19'),
-                dd2.strftime('%Y%m%dT13:17:19'))
-        t = xmlrpclib.DateTime(d)
-        self.assertEqual(str(t) in vals, True)
-
     def test_repr(self):
         d = datetime.datetime(2007,1,2,3,4,5)
         t = xmlrpclib.DateTime(d)

Modified: python/branches/trunk-math/Lib/test/test_xpickle.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_xpickle.py	(original)
+++ python/branches/trunk-math/Lib/test/test_xpickle.py	Thu Feb 28 21:09:17 2008
@@ -5,7 +5,6 @@
 
 import pickle
 import cPickle
-import unittest
 
 from test import test_support
 from test.pickletester import AbstractPickleTests

Modified: python/branches/trunk-math/Lib/test/test_zipfile64.py
==============================================================================
--- python/branches/trunk-math/Lib/test/test_zipfile64.py	(original)
+++ python/branches/trunk-math/Lib/test/test_zipfile64.py	Thu Feb 28 21:09:17 2008
@@ -20,7 +20,6 @@
 import time
 import sys
 
-from StringIO import StringIO
 from tempfile import TemporaryFile
 
 from test.test_support import TESTFN, run_unittest

Modified: python/branches/trunk-math/Lib/threading.py
==============================================================================
--- python/branches/trunk-math/Lib/threading.py	(original)
+++ python/branches/trunk-math/Lib/threading.py	Thu Feb 28 21:09:17 2008
@@ -404,7 +404,7 @@
         self.__args = args
         self.__kwargs = kwargs
         self.__daemonic = self._set_daemon()
-        self.__started = False
+        self.__started = Event()
         self.__stopped = False
         self.__block = Condition(Lock())
         self.__initialized = True
@@ -419,7 +419,7 @@
     def __repr__(self):
         assert self.__initialized, "Thread.__init__() was not called"
         status = "initial"
-        if self.__started:
+        if self.__started.isSet():
             status = "started"
         if self.__stopped:
             status = "stopped"
@@ -430,7 +430,7 @@
     def start(self):
         if not self.__initialized:
             raise RuntimeError("thread.__init__() not called")
-        if self.__started:
+        if self.__started.isSet():
             raise RuntimeError("thread already started")
         if __debug__:
             self._note("%s.start(): starting thread", self)
@@ -438,12 +438,16 @@
         _limbo[self] = self
         _active_limbo_lock.release()
         _start_new_thread(self.__bootstrap, ())
-        self.__started = True
-        _sleep(0.000001)    # 1 usec, to let the thread run (Solaris hack)
+        self.__started.wait()
 
     def run(self):
-        if self.__target:
-            self.__target(*self.__args, **self.__kwargs)
+        try:
+            if self.__target:
+                self.__target(*self.__args, **self.__kwargs)
+        finally:
+            # Avoid a refcycle if the thread is running a function with
+            # an argument that has a member that points to the thread.
+            del self.__target, self.__args, self.__kwargs
 
     def __bootstrap(self):
         # Wrapper around the real bootstrap code that ignores
@@ -467,7 +471,7 @@
 
     def __bootstrap_inner(self):
         try:
-            self.__started = True
+            self.__started.set()
             _active_limbo_lock.acquire()
             _active[_get_ident()] = self
             del _limbo[self]
@@ -576,7 +580,7 @@
     def join(self, timeout=None):
         if not self.__initialized:
             raise RuntimeError("Thread.__init__() not called")
-        if not self.__started:
+        if not self.__started.isSet():
             raise RuntimeError("cannot join thread before it is started")
         if self is currentThread():
             raise RuntimeError("cannot join current thread")
@@ -616,7 +620,7 @@
 
     def isAlive(self):
         assert self.__initialized, "Thread.__init__() not called"
-        return self.__started and not self.__stopped
+        return self.__started.isSet() and not self.__stopped
 
     def isDaemon(self):
         assert self.__initialized, "Thread.__init__() not called"
@@ -625,7 +629,7 @@
     def setDaemon(self, daemonic):
         if not self.__initialized:
             raise RuntimeError("Thread.__init__() not called")
-        if self.__started:
+        if self.__started.isSet():
             raise RuntimeError("cannot set daemon status of active thread");
         self.__daemonic = daemonic
 
@@ -667,7 +671,7 @@
 
     def __init__(self):
         Thread.__init__(self, name="MainThread")
-        self._Thread__started = True
+        self._Thread__started.set()
         _active_limbo_lock.acquire()
         _active[_get_ident()] = self
         _active_limbo_lock.release()
@@ -713,7 +717,7 @@
         # instance is immortal, that's bad, so release this resource.
         del self._Thread__block
 
-        self._Thread__started = True
+        self._Thread__started.set()
         _active_limbo_lock.acquire()
         _active[_get_ident()] = self
         _active_limbo_lock.release()

Modified: python/branches/trunk-math/Lib/token.py
==============================================================================
--- python/branches/trunk-math/Lib/token.py	(original)
+++ python/branches/trunk-math/Lib/token.py	Thu Feb 28 21:09:17 2008
@@ -71,6 +71,7 @@
 for _name, _value in globals().items():
     if type(_value) is type(0):
         tok_name[_value] = _name
+del _name, _value
 
 
 def ISTERMINAL(x):

Modified: python/branches/trunk-math/Lib/trace.py
==============================================================================
--- python/branches/trunk-math/Lib/trace.py	(original)
+++ python/branches/trunk-math/Lib/trace.py	Thu Feb 28 21:09:17 2008
@@ -53,6 +53,7 @@
 import re
 import sys
 import threading
+import time
 import token
 import tokenize
 import types
@@ -98,6 +99,8 @@
                       with '>>>>>> '.
 -s, --summary         Write a brief summary on stdout for each file.
                       (Can only be used with --count or --report.)
+-g, --timing          Prefix each line with the time since the program started.
+                      Only used while tracing.
 
 Filters, may be repeated multiple times:
 --ignore-module=<mod> Ignore the given module(s) and its submodules
@@ -435,7 +438,8 @@
 
 class Trace:
     def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0,
-                 ignoremods=(), ignoredirs=(), infile=None, outfile=None):
+                 ignoremods=(), ignoredirs=(), infile=None, outfile=None,
+                 timing=False):
         """
         @param count true iff it should count number of times each
                      line is executed
@@ -451,6 +455,7 @@
         @param infile file from which to read stored counts to be
                      added into the results
         @param outfile file in which to write the results
+        @param timing true iff timing information be displayed
         """
         self.infile = infile
         self.outfile = outfile
@@ -463,6 +468,9 @@
         self._calledfuncs = {}
         self._callers = {}
         self._caller_cache = {}
+        self.start_time = None
+        if timing:
+            self.start_time = time.time()
         if countcallers:
             self.globaltrace = self.globaltrace_trackcallers
         elif countfuncs:
@@ -613,6 +621,8 @@
             key = filename, lineno
             self.counts[key] = self.counts.get(key, 0) + 1
 
+            if self.start_time:
+                print '%.2f' % (time.time() - self.start_time),
             bname = os.path.basename(filename)
             print "%s(%d): %s" % (bname, lineno,
                                   linecache.getline(filename, lineno)),
@@ -624,6 +634,8 @@
             filename = frame.f_code.co_filename
             lineno = frame.f_lineno
 
+            if self.start_time:
+                print '%.2f' % (time.time() - self.start_time),
             bname = os.path.basename(filename)
             print "%s(%d): %s" % (bname, lineno,
                                   linecache.getline(filename, lineno)),
@@ -653,13 +665,13 @@
     if argv is None:
         argv = sys.argv
     try:
-        opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:lT",
+        opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:lTg",
                                         ["help", "version", "trace", "count",
                                          "report", "no-report", "summary",
                                          "file=", "missing",
                                          "ignore-module=", "ignore-dir=",
                                          "coverdir=", "listfuncs",
-                                         "trackcalls"])
+                                         "trackcalls", "timing"])
 
     except getopt.error, msg:
         sys.stderr.write("%s: %s\n" % (sys.argv[0], msg))
@@ -679,6 +691,7 @@
     summary = 0
     listfuncs = False
     countcallers = False
+    timing = False
 
     for opt, val in opts:
         if opt == "--help":
@@ -697,6 +710,10 @@
             listfuncs = True
             continue
 
+        if opt == "-g" or opt == "--timing":
+            timing = True
+            continue
+
         if opt == "-t" or opt == "--trace":
             trace = 1
             continue
@@ -779,7 +796,7 @@
         t = Trace(count, trace, countfuncs=listfuncs,
                   countcallers=countcallers, ignoremods=ignore_modules,
                   ignoredirs=ignore_dirs, infile=counts_file,
-                  outfile=counts_file)
+                  outfile=counts_file, timing=timing)
         try:
             t.run('execfile(%r)' % (progname,))
         except IOError, err:

Modified: python/branches/trunk-math/Lib/xml/dom/minidom.py
==============================================================================
--- python/branches/trunk-math/Lib/xml/dom/minidom.py	(original)
+++ python/branches/trunk-math/Lib/xml/dom/minidom.py	Thu Feb 28 21:09:17 2008
@@ -203,6 +203,8 @@
                 L.append(child)
                 if child.nodeType == Node.ELEMENT_NODE:
                     child.normalize()
+        if L:
+            L[-1].nextSibling = None
         self.childNodes[:] = L
 
     def cloneNode(self, deep):

Modified: python/branches/trunk-math/Lib/xmlrpclib.py
==============================================================================
--- python/branches/trunk-math/Lib/xmlrpclib.py	(original)
+++ python/branches/trunk-math/Lib/xmlrpclib.py	Thu Feb 28 21:09:17 2008
@@ -357,13 +357,6 @@
             if datetime and isinstance(value, datetime.datetime):
                 self.value = value.strftime("%Y%m%dT%H:%M:%S")
                 return
-            if datetime and isinstance(value, datetime.date):
-                self.value = value.strftime("%Y%m%dT%H:%M:%S")
-                return
-            if datetime and isinstance(value, datetime.time):
-                today = datetime.datetime.now().strftime("%Y%m%d")
-                self.value = value.strftime(today+"T%H:%M:%S")
-                return
             if not isinstance(value, (TupleType, time.struct_time)):
                 if value == 0:
                     value = time.time()
@@ -371,10 +364,57 @@
             value = time.strftime("%Y%m%dT%H:%M:%S", value)
         self.value = value
 
-    def __cmp__(self, other):
+    def make_comparable(self, other):
         if isinstance(other, DateTime):
-            other = other.value
-        return cmp(self.value, other)
+            s = self.value
+            o = other.value
+        elif datetime and isinstance(other, datetime.datetime):
+            s = self.value
+            o = other.strftime("%Y%m%dT%H:%M:%S")
+        elif isinstance(other, (str, unicode)):
+            s = self.value
+            o = other
+        elif hasattr(other, "timetuple"):
+            s = self.timetuple()
+            o = other.timetuple()
+        else:
+            otype = (hasattr(other, "__class__")
+                     and other.__class__.__name__
+                     or type(other))
+            raise TypeError("Can't compare %s and %s" %
+                            (self.__class__.__name__, otype))
+        return s, o
+
+    def __lt__(self, other):
+        s, o = self.make_comparable(other)
+        return s < o
+
+    def __le__(self, other):
+        s, o = self.make_comparable(other)
+        return s <= o
+
+    def __gt__(self, other):
+        s, o = self.make_comparable(other)
+        return s > o
+
+    def __ge__(self, other):
+        s, o = self.make_comparable(other)
+        return s >= o
+
+    def __eq__(self, other):
+        s, o = self.make_comparable(other)
+        return s == o
+
+    def __ne__(self, other):
+        s, o = self.make_comparable(other)
+        return s != o
+
+    def timetuple(self):
+        return time.strptime(self.value, "%Y%m%dT%H:%M:%S")
+
+    def __cmp__(self, other):
+        s, o = self.make_comparable(other)
+        return cmp(s, o)
 
     ##
     # Get date/time value.
@@ -736,19 +776,6 @@
             write("</dateTime.iso8601></value>\n")
         dispatch[datetime.datetime] = dump_datetime
 
-        def dump_date(self, value, write):
-            write("<value><dateTime.iso8601>")
-            write(value.strftime("%Y%m%dT00:00:00"))
-            write("</dateTime.iso8601></value>\n")
-        dispatch[datetime.date] = dump_date
-
-        def dump_time(self, value, write):
-            write("<value><dateTime.iso8601>")
-            write(datetime.datetime.now().date().strftime("%Y%m%dT"))
-            write(value.strftime("%H:%M:%S"))
-            write("</dateTime.iso8601></value>\n")
-        dispatch[datetime.time] = dump_time
-
     def dump_instance(self, value, write):
         # check for special wrappers
         if value.__class__ in WRAPPERS:

Modified: python/branches/trunk-math/Mac/Demo/PICTbrowse/ICONbrowse.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/PICTbrowse/ICONbrowse.py	(original)
+++ python/branches/trunk-math/Mac/Demo/PICTbrowse/ICONbrowse.py	Thu Feb 28 21:09:17 2008
@@ -7,8 +7,6 @@
 from Carbon import Win
 from Carbon import Controls
 from Carbon import List
-import sys
-import struct
 from Carbon import Icn
 import macresource
 

Modified: python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse.py	(original)
+++ python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,6 @@
 from Carbon import Win
 from Carbon import Controls
 from Carbon import List
-import sys
 import struct
 import macresource
 

Modified: python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse2.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse2.py	(original)
+++ python/branches/trunk-math/Mac/Demo/PICTbrowse/PICTbrowse2.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,6 @@
 from Carbon import Win
 from Carbon import Controls
 from Carbon import List
-import sys
 import struct
 import macresource
 

Modified: python/branches/trunk-math/Mac/Demo/PICTbrowse/cicnbrowse.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/PICTbrowse/cicnbrowse.py	(original)
+++ python/branches/trunk-math/Mac/Demo/PICTbrowse/cicnbrowse.py	Thu Feb 28 21:09:17 2008
@@ -7,8 +7,6 @@
 from Carbon import Win
 from Carbon import Controls
 from Carbon import List
-import sys
-import struct
 from Carbon import Icn
 import macresource
 

Modified: python/branches/trunk-math/Mac/Demo/PICTbrowse/oldPICTbrowse.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/PICTbrowse/oldPICTbrowse.py	(original)
+++ python/branches/trunk-math/Mac/Demo/PICTbrowse/oldPICTbrowse.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,6 @@
 from Carbon import Qd
 from Carbon import Win
 from Carbon import List
-import sys
 import struct
 import macresource
 

Modified: python/branches/trunk-math/Mac/Demo/example1/dnslookup-1.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/example1/dnslookup-1.py	(original)
+++ python/branches/trunk-math/Mac/Demo/example1/dnslookup-1.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,6 @@
 import EasyDialogs
 from Carbon import Res
 from Carbon import Dlg
-import sys
 import socket
 import string
 import macresource

Modified: python/branches/trunk-math/Mac/Demo/example2/dnslookup-2.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/example2/dnslookup-2.py	(original)
+++ python/branches/trunk-math/Mac/Demo/example2/dnslookup-2.py	Thu Feb 28 21:09:17 2008
@@ -2,7 +2,6 @@
 import EasyDialogs
 from Carbon import Res
 from Carbon import Dlg
-import sys
 import socket
 import string
 import macresource

Modified: python/branches/trunk-math/Mac/Demo/imgbrowse/imgbrowse.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/imgbrowse/imgbrowse.py	(original)
+++ python/branches/trunk-math/Mac/Demo/imgbrowse/imgbrowse.py	Thu Feb 28 21:09:17 2008
@@ -7,11 +7,9 @@
 from Carbon import QuickDraw
 from Carbon import Win
 #ifrom Carbon mport List
-import sys
 import struct
 import img
 import imgformat
-import struct
 import mac_image
 
 

Modified: python/branches/trunk-math/Mac/Demo/imgbrowse/mac_image.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/imgbrowse/mac_image.py	(original)
+++ python/branches/trunk-math/Mac/Demo/imgbrowse/mac_image.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 """mac_image - Helper routines (hacks) for images"""
 import imgformat
 from Carbon import Qd
-import time
 import struct
 import MacOS
 

Modified: python/branches/trunk-math/Mac/Demo/sound/morse.py
==============================================================================
--- python/branches/trunk-math/Mac/Demo/sound/morse.py	(original)
+++ python/branches/trunk-math/Mac/Demo/sound/morse.py	Thu Feb 28 21:09:17 2008
@@ -1,4 +1,4 @@
-import sys, math, audiodev
+import sys, math
 
 DOT = 30
 DAH = 80

Modified: python/branches/trunk-math/Mac/Modules/ae/aescan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/ae/aescan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/ae/aescan.py	Thu Feb 28 21:09:17 2008
@@ -3,8 +3,6 @@
 # (Should learn how to tell the compiler to compile it as well.)
 
 import sys
-import os
-import string
 import MacOS
 
 from bgenlocations import TOOLBOXDIR, BGENDIR

Modified: python/branches/trunk-math/Mac/Modules/ah/ahscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/ah/ahscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/ah/ahscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner_OSX

Modified: python/branches/trunk-math/Mac/Modules/app/appscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/app/appscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/app/appscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/carbonevt/CarbonEvtscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/carbonevt/CarbonEvtscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/carbonevt/CarbonEvtscan.py	Thu Feb 28 21:09:17 2008
@@ -1,8 +1,6 @@
 # IBCarbonscan.py
 
 import sys
-import os
-import string
 import MacOS
 import sys
 

Modified: python/branches/trunk-math/Mac/Modules/cf/cfscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/cf/cfscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/cf/cfscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner_OSX

Modified: python/branches/trunk-math/Mac/Modules/cg/cgscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/cg/cgscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/cg/cgscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner_OSX

Modified: python/branches/trunk-math/Mac/Modules/cm/cmscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/cm/cmscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/cm/cmscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/ctl/ctlscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/ctl/ctlscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/ctl/ctlscan.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # Scan <Controls.h>, generating ctlgen.py.
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/dlg/dlgscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/dlg/dlgscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/dlg/dlgscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/drag/dragscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/drag/dragscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/drag/dragscan.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # Scan <Drag.h>, generating draggen.py.
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR, INCLUDEDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/evt/evtscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/evt/evtscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/evt/evtscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/file/filescan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/file/filescan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/file/filescan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner_OSX

Modified: python/branches/trunk-math/Mac/Modules/fm/fmscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/fm/fmscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/fm/fmscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/folder/folderscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/folder/folderscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/folder/folderscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner_OSX

Modified: python/branches/trunk-math/Mac/Modules/help/helpscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/help/helpscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/help/helpscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/ibcarbon/IBCarbonscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/ibcarbon/IBCarbonscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/ibcarbon/IBCarbonscan.py	Thu Feb 28 21:09:17 2008
@@ -1,8 +1,6 @@
 # IBCarbonscan.py
 
 import sys
-import os
-import string
 
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)

Modified: python/branches/trunk-math/Mac/Modules/icn/icnscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/icn/icnscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/icn/icnscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/launch/launchscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/launch/launchscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/launch/launchscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/list/listscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/list/listscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/list/listscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/menu/menuscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/menu/menuscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/menu/menuscan.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # Scan <Menus.h>, generating menugen.py.
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/mlte/mltescan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/mlte/mltescan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/mlte/mltescan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner_OSX

Modified: python/branches/trunk-math/Mac/Modules/osa/osascan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/osa/osascan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/osa/osascan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/qd/qdscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/qd/qdscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/qd/qdscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/qdoffs/qdoffsscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/qdoffs/qdoffsscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/qdoffs/qdoffsscan.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/qt/qtscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/qt/qtscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/qt/qtscan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/res/resscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/res/resscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/res/resscan.py	Thu Feb 28 21:09:17 2008
@@ -3,8 +3,6 @@
 # (Should learn how to tell the compiler to compile it as well.)
 
 import sys
-import os
-import string
 import MacOS
 
 from bgenlocations import TOOLBOXDIR, BGENDIR

Modified: python/branches/trunk-math/Mac/Modules/scrap/scrapscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/scrap/scrapscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/scrap/scrapscan.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,6 @@
 # generates a boilerplate to be edited by hand.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/snd/sndscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/snd/sndscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/snd/sndscan.py	Thu Feb 28 21:09:17 2008
@@ -3,7 +3,6 @@
 # (Should learn how to tell the compiler to compile it as well.)
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Mac/Modules/te/tescan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/te/tescan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/te/tescan.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 from scantools import Scanner

Modified: python/branches/trunk-math/Mac/Modules/win/winscan.py
==============================================================================
--- python/branches/trunk-math/Mac/Modules/win/winscan.py	(original)
+++ python/branches/trunk-math/Mac/Modules/win/winscan.py	Thu Feb 28 21:09:17 2008
@@ -1,6 +1,5 @@
 # Scan an Apple header file, generating a Python file of generator calls.
 import sys
-import os
 from bgenlocations import TOOLBOXDIR, BGENDIR
 sys.path.append(BGENDIR)
 

Modified: python/branches/trunk-math/Makefile.pre.in
==============================================================================
--- python/branches/trunk-math/Makefile.pre.in	(original)
+++ python/branches/trunk-math/Makefile.pre.in	Thu Feb 28 21:09:17 2008
@@ -282,6 +282,8 @@
 		Python/getopt.o \
 		Python/pystrcmp.o \
 		Python/pystrtod.o \
+		Python/formatter_unicode.o \
+		Python/formatter_string.o \
 		Python/$(DYNLOADFILE) \
 		$(LIBOBJS) \
 		$(MACHDEP_OBJS) \
@@ -516,6 +518,28 @@
 Objects/unicodectype.o:	$(srcdir)/Objects/unicodectype.c \
 				$(srcdir)/Objects/unicodetype_db.h
 
+STRINGLIB_HEADERS= \
+		$(srcdir)/Objects/stringlib/count.h \
+		$(srcdir)/Objects/stringlib/fastsearch.h \
+		$(srcdir)/Objects/stringlib/find.h \
+		$(srcdir)/Objects/stringlib/formatter.h \
+		$(srcdir)/Objects/stringlib/partition.h \
+		$(srcdir)/Objects/stringlib/stringdefs.h \
+		$(srcdir)/Objects/stringlib/string_format.h \
+		$(srcdir)/Objects/stringlib/unicodedefs.h
+
+Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
+				$(STRINGLIB_HEADERS)
+
+Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
+				$(STRINGLIB_HEADERS)
+
+Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
+				$(STRINGLIB_HEADERS)
+
+Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
+				$(STRINGLIB_HEADERS)
+
 ############################################################################
 # Header files
 

Modified: python/branches/trunk-math/Misc/ACKS
==============================================================================
--- python/branches/trunk-math/Misc/ACKS	(original)
+++ python/branches/trunk-math/Misc/ACKS	Thu Feb 28 21:09:17 2008
@@ -274,6 +274,7 @@
 Rycharde Hawkes
 Jochen Hayek
 Thomas Heller
+Malte Helmert
 Lance Finn Helsten
 Jonathan Hendry
 James Henstridge
@@ -704,6 +705,7 @@
 Cliff Wells
 Rickard Westman
 Jeff Wheeler
+Christopher White
 Mats Wichmann
 Truida Wiedijk
 Felix Wiemann

Modified: python/branches/trunk-math/Misc/BeOS-setup.py
==============================================================================
--- python/branches/trunk-math/Misc/BeOS-setup.py	(original)
+++ python/branches/trunk-math/Misc/BeOS-setup.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,7 @@
 
 __version__ = "special BeOS after 1.37"
 
-import sys, os, getopt
+import sys, os
 from distutils import sysconfig
 from distutils import text_file
 from distutils.errors import *

Modified: python/branches/trunk-math/Misc/HISTORY
==============================================================================
--- python/branches/trunk-math/Misc/HISTORY	(original)
+++ python/branches/trunk-math/Misc/HISTORY	Thu Feb 28 21:09:17 2008
@@ -3,11 +3,2150 @@
 
 This file contains the release messages for previous Python releases.
 As you read on you go back to the dark ages of Python's history.
+(Note: news about 2.5c2 and later 2.5 releases is in the Misc/NEWS
+file of the release25-maint branch.)
 
 
 ======================================================================
 
 
+What's New in Python 2.5 release candidate 1?
+=============================================
+
+*Release date: 17-AUG-2006*
+
+Core and builtins
+-----------------
+
+- Unicode objects will no longer raise an exception when being
+  compared equal or unequal to a string and a UnicodeDecodeError
+  exception occurs, e.g. as result of a decoding failure.
+
+  Instead, the equal (==) and unequal (!=) comparison operators will
+  now issue a UnicodeWarning and interpret the two objects as
+  unequal. The UnicodeWarning can be filtered as desired using
+  the warning framework, e.g. silenced completely, turned into an
+  exception, logged, etc.
+
+  Note that compare operators other than equal and unequal will still
+  raise UnicodeDecodeError exceptions as they've always done.
+
+- Fix segfault when doing string formatting on subclasses of long.
+
+- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
+  with new-style classes.
+
+- Fix bug related to __len__ functions returning negative values with
+  classic classes.
+
+- Patch #1538606, Fix __index__() clipping.  There were some problems
+  discovered with the API and how integers that didn't fit into Py_ssize_t
+  were handled.  This patch attempts to provide enough alternatives
+  to effectively use __index__.
+
+- Bug #1536021: __hash__ may now return long int; the final hash
+  value is obtained by invoking hash on the long int.
+
+- Bug #1536786: buffer comparison could emit a RuntimeWarning.
+
+- Bug #1535165: fixed a segfault in input() and raw_input() when
+  sys.stdin is closed.
+
+- On Windows, the PyErr_Warn function is now exported from
+  the Python dll again.
+
+- Bug #1191458: tracing over for loops now produces a line event
+  on each iteration.  Fixing this problem required changing the .pyc
+  magic number.  This means that .pyc files generated before 2.5c1
+  will be regenerated.
+
+- Bug #1333982: string/number constants were inappropriately stored
+  in the byte code and co_consts even if they were not used, ie
+  immediately popped off the stack.
+
+- Fixed a reference-counting problem in property().
+
+
+Library
+-------
+
+- Fix a bug in the ``compiler`` package that caused invalid code to be
+  generated for generator expressions.
+
+- The distutils version has been changed to 2.5.0. The change to
+  keep it programmatically in sync with the Python version running
+  the code (introduced in 2.5b3) has been reverted. It will continue
+  to be maintained manually as static string literal.
+
+- If the Python part of a ctypes callback function returns None,
+  and this cannot be converted to the required C type, an exception is
+  printed with PyErr_WriteUnraisable.  Before this change, the C
+  callback returned arbitrary values to the calling code.
+
+- The __repr__ method of a NULL ctypes.py_object() no longer raises
+  an exception.
+
+- uuid.UUID now has a bytes_le attribute. This returns the UUID in
+  little-endian byte order for Windows. In addition, uuid.py gained some
+  workarounds for clocks with low resolution, to stop the code yielding
+  duplicate UUIDs.
+
+- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
+  before raising SystemExit, allowing IDLE to honor quit() and exit().
+
+- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
+
+- Patch #1536071: trace.py should now find the full module name of a
+  file correctly even on Windows.
+
+- logging's atexit hook now runs even if the rest of the module has
+  already been cleaned up.
+
+- Bug #1112549, fix DoS attack on cgi.FieldStorage.
+
+- Bug #1531405, format_exception no longer raises an exception if
+  str(exception) raised an exception.
+
+- Fix a bug in the ``compiler`` package that caused invalid code to be
+  generated for nested functions.
+
+
+Extension Modules
+-----------------
+
+- Patch #1511317: don't crash on invalid hostname (alias) info.
+
+- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
+  raises the correct exceptions.
+
+- Patch # 1536908: enable building ctypes on OpenBSD/AMD64.  The
+  '-no-stack-protector' compiler flag for OpenBSD has been removed.
+
+- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
+  uses the _as_parameter_ attribute when objects are passed to foreign
+  function calls.  The ctypes version number was changed to 1.0.1.
+
+- Bug #1530559, struct.pack raises TypeError where it used to convert.
+  Passing float arguments to struct.pack when integers are expected
+  now triggers a DeprecationWarning.
+
+
+Tests
+-----
+
+- test_socketserver should now work on cygwin and not fail sporadically
+  on other platforms.
+
+- test_mailbox should now work on cygwin versions 2006-08-10 and later.
+
+- Bug #1535182: really test the xreadlines() method of bz2 objects.
+
+- test_threading now skips testing alternate thread stack sizes on
+  platforms that don't support changing thread stack size.
+
+
+Documentation
+-------------
+
+- Patch #1534922: unittest docs were corrected and enhanced.
+
+
+Build
+-----
+
+- Bug #1535502, build _hashlib on Windows, and use masm assembler
+  code in OpenSSL.
+
+- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
+
+- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
+
+
+C API
+-----
+
+- New API for Unicode rich comparisons: PyUnicode_RichCompare()
+
+- Bug #1069160.  Internal correctness changes were made to
+  ``PyThreadState_SetAsyncExc()``.  A test case was added, and
+  the documentation was changed to state that the return value
+  is always 1 (normal) or 0 (if the specified thread wasn't found).
+
+
+What's New in Python 2.5 beta 3?
+================================
+
+*Release date: 03-AUG-2006*
+
+Core and builtins
+-----------------
+
+- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
+  returned a long (see PEP 353).
+
+- Bug #1515471: string.replace() accepts character buffers again.
+
+- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
+  This provides the proper warning for struct.pack().
+  PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
+
+- Patch #1531113: Fix augmented assignment with yield expressions.
+  Also fix a SystemError when trying to assign to yield expressions.
+
+- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
+  with PEP 302.  This was fixed by adding an ``imp.NullImporter`` type that is
+  used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
+  excessive filesystem operations during imports.
+
+- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
+  operations on signed longs that are formally undefined by C.
+  Unfortunately, at least one compiler now cares about that, so complicated
+  the code to make that compiler happy again.
+
+- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
+
+- Patch #1232023: Stop including current directory in search
+  path on Windows.
+
+- Fix some potential crashes found with failmalloc.
+
+- Fix warnings reported by Klocwork's static analysis tool.
+
+- Bug #1512814, Fix incorrect lineno's when code within a function
+  had more than 255 blank lines.
+
+- Patch #1521179: Python now accepts the standard options ``--help`` and
+  ``--version`` as well as ``/?`` on Windows.
+
+- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
+  again.  Fixing this problem required changing the .pyc magic number.
+  This means that .pyc files generated before 2.5b3 will be regenerated.
+
+- Bug #1524317:  Compiling Python ``--without-threads`` failed.
+  The Python core compiles again, and, in a build without threads, the
+  new ``sys._current_frames()`` returns a dictionary with one entry,
+  mapping the faux "thread id" 0 to the current frame.
+
+- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
+
+
+Library
+-------
+
+- Fix #1693149.  Now you can pass several modules separated by
+  comma to trace.py in the same --ignore-module option.
+
+- Correction of patch #1455898: In the mbcs decoder, set final=False
+  for stream decoder, but final=True for the decode function.
+
+- os.urandom no longer masks unrelated exceptions like SystemExit or
+  KeyboardInterrupt.
+
+- Bug #1525866: Don't copy directory stat times in
+  shutil.copytree on Windows
+
+- Bug #1002398: The documentation for os.path.sameopenfile now correctly
+  refers to file descriptors, not file objects.
+
+- The renaming of the xml package to xmlcore, and the import hackery done
+  to make it appear at both names, has been removed.  Bug #1511497,
+  #1513611, and probably others.
+
+- Bug #1441397: The compiler module now recognizes module and function
+  docstrings correctly as it did in Python 2.4.
+
+- Bug #1529297:  The rewrite of doctest for Python 2.4 unintentionally
+  lost that tests are sorted by name before being run.  This rarely
+  matters for well-written tests, but can create baffling symptoms if
+  side effects from one test to the next affect outcomes.  ``DocTestFinder``
+  has been changed to sort the list of tests it returns.
+
+- The distutils version has been changed to 2.5.0, and is now kept
+  in sync with sys.version_info[:3].
+
+- Bug #978833: Really close underlying socket in _socketobject.close.
+
+- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
+  title().
+
+- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
+  to recursive calls and call it with the failing package name.
+
+- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
+
+- Patch #1515343: Fix printing of deprecated string exceptions with a
+  value in the traceback module.
+
+- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
+
+- Patch #1524429: Use repr() instead of backticks in Tkinter again.
+
+- Bug #1520914: Change time.strftime() to accept a zero for any position in its
+  argument tuple.  For arguments where zero is illegal, the value is forced to
+  the minimum value that is correct.  This is to support an undocumented but
+  common way people used  to fill in inconsequential information in the time
+  tuple pre-2.4.
+
+- Patch #1220874: Update the binhex module for Mach-O.
+
+- The email package has improved RFC 2231 support, specifically for
+  recognizing the difference between encoded (name*0*=<blah>) and non-encoded
+  (name*0=<blah>) parameter continuations.  This may change the types of
+  values returned from email.message.Message.get_param() and friends.
+  Specifically in some cases where non-encoded continuations were used,
+  get_param() used to return a 3-tuple of (None, None, string) whereas now it
+  will just return the string (since non-encoded continuations don't have
+  charset and language parts).
+
+  Also, whereas % values were decoded in all parameter continuations, they are
+  now only decoded in encoded parameter parts.
+
+- Bug #1517990: IDLE keybindings on MacOS X now work correctly
+
+- Bug #1517996: IDLE now longer shows the default Tk menu when a
+  path browser, class browser or debugger is the frontmost window on MacOS X
+
+- Patch #1520294: Support for getset and member descriptors in types.py,
+  inspect.py, and pydoc.py.  Specifically, this allows for querying the type
+  of an object against these built-in types and more importantly, for getting
+  their docstrings printed in the interactive interpreter's help() function.
+
+
+Extension Modules
+-----------------
+
+- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
+  a socket operation on a socket with a timeout, the exception will be
+  caught correctly.  Previously, the exception was not caught.
+
+- Patch #1529514: The _ctypes extension is now compiled on more
+  openbsd target platforms.
+
+- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
+  a memory leak, affecting pickles and deep copies.
+
+- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
+  Paul Eggert.
+
+- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
+
+- Patch #1521817: Index range checking on ctypes arrays containing
+  exactly one element enabled again.  This allows iterating over these
+  arrays, without the need to check the array size before.
+
+- Bug #1521375: When the code in ctypes.util.find_library was
+  run with root privileges, it could overwrite or delete
+  /dev/null in certain cases; this is now fixed.
+
+- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
+  default mode for loading shared libraries in ctypes.
+
+- Because of a misspelled preprocessor symbol, ctypes was always
+  compiled without thread support; this is now fixed.
+
+- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
+  methods now allow their database parameter to be None as the
+  sleepycat API allows.
+
+- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
+  bluetooth API compared with Linux and FreeBSD.
+
+Tests
+-----
+
+- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
+  how long the test file should take to play.  Now accepts taking 2.93 secs
+  (exact time) +/- 10% instead of the hard-coded 3.1 sec.
+
+- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
+  ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
+  run via ``regrtest.py``. Now they do.
+
+Build
+-----
+
+- Bug #1439538: Drop usage of test -e in configure as it is not portable.
+
+Mac
+---
+
+- PythonLauncher now works correctly when the path to the script contains
+  characters that are treated specially by the shell (such as quotes).
+
+- Bug #1527397: PythonLauncher now launches scripts with the working directory
+  set to the directory that contains the script instead of the user home
+  directory. That latter was an implementation accident and not what users
+  expect.
+
+
+What's New in Python 2.5 beta 2?
+================================
+
+*Release date: 11-JUL-2006*
+
+Core and builtins
+-----------------
+
+- Bug #1441486: The literal representation of -(sys.maxint - 1)
+  again evaluates to a int object, not a long.
+
+- Bug #1501934: The scope of global variables that are locally assigned
+  using augmented assignment is now correctly determined.
+
+- Bug #927248: Recursive method-wrapper objects can now safely
+  be released.
+
+- Bug #1417699: Reject locale-specific decimal point in float()
+  and atof().
+
+- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
+  omit a default "error" argument for NULL pointer.  This allows
+  the parser to take a codec from cjkcodecs again.
+
+- Bug #1519018: 'as' is now validated properly in import statements.
+
+- On 64 bit systems, int literals that use less than 64 bits are
+  now ints rather than longs.
+
+- Bug #1512814, Fix incorrect lineno's when code at module scope
+  started after line 256.
+
+- New function ``sys._current_frames()`` returns a dict mapping thread
+  id to topmost thread stack frame.  This is for expert use, and is
+  especially useful for debugging application deadlocks.  The functionality
+  was previously available in Fazal Majid's ``threadframe`` extension
+  module, but it wasn't possible to do this in a wholly threadsafe way from
+  an extension.
+
+Library
+-------
+
+- Bug #1257728: Mention Cygwin in distutils error message about a missing
+  VS 2003.
+
+- Patch #1519566: Update turtle demo, make begin_fill idempotent.
+
+- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
+  environment variable to be set in order to the SDK environment
+  for finding the compiler, include files, etc.
+
+- Bug #1515998: Properly generate logical ids for files in bdist_msi.
+
+- warnings.py now ignores ImportWarning by default
+
+- string.Template() now correctly handles tuple-values. Previously,
+  multi-value tuples would raise an exception and single-value tuples would
+  be treated as the value they contain, instead.
+
+- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
+  even if some data are received.
+
+- Bug #1267547: Put proper recursive setup.py call into the
+  spec file generated by bdist_rpm.
+
+- Bug #1514693: Update turtle's heading when switching between
+  degrees and radians.
+
+- Reimplement turtle.circle using a polyline, to allow correct
+  filling of arcs.
+
+- Bug #1514703: Only setup canvas window in turtle when the canvas
+  is created.
+
+- Bug #1513223: .close() of a _socketobj now releases the underlying
+  socket again, which then gets closed as it becomes unreferenced.
+
+- Bug #1504333: Make sgmllib support angle brackets in quoted
+  attribute values.
+
+- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
+  sgmllib ('[' and ']' were not accepted).
+
+- Fix a bug in the turtle module's end_fill function.
+
+- Bug #1510580: The 'warnings' module improperly required that a Warning
+  category be either a types.ClassType and a subclass of Warning.  The proper
+  check is just that it is a subclass with Warning as the documentation states.
+
+- The compiler module now correctly compiles the new try-except-finally
+  statement (bug #1509132).
+
+- The wsgiref package is now installed properly on Unix.
+
+- A bug was fixed in logging.config.fileConfig() which caused a crash on
+  shutdown when fileConfig() was called multiple times.
+
+- The sqlite3 module did cut off data from the SQLite database at the first
+  null character before sending it to a custom converter. This has been fixed
+  now.
+
+Extension Modules
+-----------------
+
+- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
+  means that select() on sockets > FD_SETSIZE (typically 1024) work again.
+  The patch makes sockets use poll() internally where available.
+
+- Assigning None to pointer type fields in ctypes structures possible
+  overwrote the wrong fields, this is fixed now.
+
+- Fixed a segfault in _ctypes when ctypes.wintypes were imported
+  on non-Windows platforms.
+
+- Bug #1518190: The ctypes.c_void_p constructor now accepts any
+  integer or long, without range checking.
+
+- Patch #1517790: It is now possible to use custom objects in the ctypes
+  foreign function argtypes sequence as long as they provide a from_param
+  method, no longer is it required that the object is a ctypes type.
+
+- The '_ctypes' extension module now works when Python is configured
+  with the --without-threads option.
+
+- Bug #1513646: os.access on Windows now correctly determines write
+  access, again.
+
+- Bug #1512695: cPickle.loads could crash if it was interrupted with
+  a KeyboardInterrupt.
+
+- Bug #1296433: parsing XML with a non-default encoding and
+  a CharacterDataHandler could crash the interpreter in pyexpat.
+
+- Patch #1516912: improve Modules support for OpenVMS.
+
+Build
+-----
+
+- Automate Windows build process for the Win64 SSL module.
+
+- 'configure' now detects the zlib library the same way as distutils.
+  Previously, the slight difference could cause compilation errors of the
+  'zlib' module on systems with more than one version of zlib.
+
+- The MSI compileall step was fixed to also support a TARGETDIR
+  with spaces in it.
+
+- Bug #1517388: sqlite3.dll is now installed on Windows independent
+  of Tcl/Tk.
+
+- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
+  trying to be installed even though it's empty.
+
+Tests
+-----
+
+- Call os.waitpid() at the end of tests that spawn child processes in order
+  to minimize resources (zombies).
+
+Documentation
+-------------
+
+- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
+  documentation for the warnings module.
+
+- Patch #1509163: MS Toolkit Compiler no longer available.
+
+- Patch #1504046: Add documentation for xml.etree.
+
+
+What's New in Python 2.5 beta 1?
+================================
+
+*Release date: 20-JUN-2006*
+
+Core and builtins
+-----------------
+
+- Patch #1507676: Error messages returned by invalid abstract object operations
+  (such as iterating over an integer) have been improved and now include the
+  type of the offending object to help with debugging.
+
+- Bug #992017: A classic class that defined a __coerce__() method that returned
+  its arguments swapped would infinitely recurse and segfault the interpreter.
+
+- Fix the socket tests so they can be run concurrently.
+
+- Removed 5 integers from C frame objects (PyFrameObject).
+  f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
+
+- Bug #532646: object.__call__() will continue looking for the __call__
+  attribute on objects until one without one is found.  This leads to recursion
+  when you take a class and set its __call__ attribute to an instance of the
+  class.  Originally fixed for classic classes, but this fix is for new-style.
+  Removes the infinite_rec_3 crasher.
+
+- The string and unicode methods startswith() and endswith() now accept
+  a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
+
+- Buffer objects, at the C level, never used the char buffer
+  implementation even when the char buffer for the wrapped object was
+  explicitly requested (originally returned the read or write buffer).
+  Now a TypeError is raised if the char buffer is not present but is
+  requested.
+
+- Patch #1346214: Statements like "if 0: suite" are now again optimized
+  away like they were in Python 2.4.
+
+- Builtin exceptions are now full-blown new-style classes instead of
+  instances pretending to be classes, which speeds up exception handling
+  by about 80% in comparison to 2.5a2.
+
+- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
+  Unicode 4.1.
+
+- Patch #921466: sys.path_importer_cache is now used to cache valid and
+  invalid file paths for the built-in import machinery which leads to
+  fewer open calls on startup.
+
+- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
+  of-2 bases.  The largest speedup is for inputs with about 1000 decimal
+  digits.  Conversion from non-power-of-2 bases remains quadratic-time in
+  the number of input digits (it was and remains linear-time for bases
+  2, 4, 8, 16 and 32).
+
+- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
+  when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
+  an integer close to ``sys.maxint``.  This was repaired by patch
+  #1335972, which also gives a nice speedup.
+
+- Patch #1337051: reduced size of frame objects.
+
+- PyErr_NewException now accepts a tuple of base classes as its
+  "base" parameter.
+
+- Patch #876206: function call speedup by retaining allocated frame
+  objects.
+
+- Bug #1462152: file() now checks more thoroughly for invalid mode
+  strings and removes a possible "U" before passing the mode to the
+  C library function.
+
+- Patch #1488312, Fix memory alignment problem on SPARC in unicode
+
+- Bug #1487966: Fix SystemError with conditional expression in assignment
+
+- WindowsError now has two error code attributes: errno, which carries
+  the error values from errno.h, and winerror, which carries the error
+  values from winerror.h. Previous versions put the winerror.h values
+  (from GetLastError()) into the errno attribute.
+
+- Patch #1475845: Raise IndentationError for unexpected indent.
+
+- Patch #1479181: split open() and file() from being aliases for each other.
+
+- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
+  methods were always silently ignored by dictionaries when comparing keys.
+  They are now passed through (except when using the C API function
+  ``PyDict_GetItem()``, whose semantics did not change).
+
+- Bug #1456209: In some obscure cases it was possible for a class with a
+  custom ``__eq__()`` method to confuse dict internals when class instances
+  were used as a dict's keys and the ``__eq__()`` method mutated the dict.
+  No, you don't have any code that did this ;-)
+
+Extension Modules
+-----------------
+
+- Bug #1295808: expat symbols should be namespaced in pyexpat
+
+- Patch #1462338: Upgrade pyexpat to expat 2.0.0
+
+- Change binascii.hexlify to accept a read-only buffer instead of only a char
+  buffer and actually follow its documentation.
+
+- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
+
+- Patch #1478788 (modified version): The functional extension module has
+  been renamed to _functools and a functools Python wrapper module added.
+  This provides a home for additional function related utilities that are
+  not specifically about functional programming. See PEP 309.
+
+- Patch #1493701: performance enhancements for struct module.
+
+- Patch #1490224: time.altzone is now set correctly on Cygwin.
+
+- Patch #1435422: zlib's compress and decompress objects now have a
+  copy() method.
+
+- Patch #1454481: thread stack size is now tunable at runtime for thread
+  enabled builds on Windows and systems with Posix threads support.
+
+- On Win32, os.listdir now supports arbitrarily-long Unicode path names
+  (up to the system limit of 32K characters).
+
+- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
+  As a result, these functions now raise WindowsError instead of OSError.
+
+- ``time.clock()`` on Win64 should use the high-performance Windows
+  ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
+  Windows platforms).
+
+- Calling Tk_Init twice is refused if the first call failed as that
+  may deadlock.
+
+- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
+  accept it without potentially using an uninitialized pointer.
+
+- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
+  assuming BerkeleyDB >= 4.0 and 4.4 respectively.  [pybsddb project SF
+  patch numbers 1494885 and 1494902]
+
+- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
+  [pybsddb project SF patch number 1466734]
+
+- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
+  parameter is supplied.  [SF pybsddb bug #1477863]
+
+- bsddb: the __len__ method of a DB object has been fixed to return correct
+  results.  It could previously incorrectly return 0 in some cases.
+  Fixes SF bug 1493322 (pybsddb bug 1184012).
+
+- bsddb: the bsddb.dbtables Modify method now raises the proper error and
+  aborts the db transaction safely when a modifier callback fails.
+  Fixes SF python patch/bug #1408584.
+
+- bsddb: multithreaded DB access using the simple bsddb module interface
+  now works reliably.  It has been updated to use automatic BerkeleyDB
+  deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
+  database calls that would previously deadlock. [SF python bug #775414]
+
+- Patch #1446489: add support for the ZIP64 extensions to zipfile.
+
+- Patch #1506645: add Python wrappers for the curses functions
+  is_term_resized, resize_term and resizeterm.
+
+Library
+-------
+
+- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
+  functions.
+
+- Patch #812986: Update turtle output even if not tracing.
+
+- Patch #1494750: Destroy master after deleting children in
+  Tkinter.BaseWidget.
+
+- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
+
+- Patch #763580: Add name and value arguments to Tkinter variable
+  classes.
+
+- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
+  mime.types file for determining MIME types.
+
+- Bug #1339007: Shelf objects now don't raise an exception in their
+  __del__ method when initialization failed.
+
+- Patch #1455898: The MBCS codec now supports the incremental mode for
+  double-byte encodings.
+
+- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
+  guarantee that adjacent triples in the return list always describe
+  non-adjacent blocks.  Previously, a pair of matching blocks could end
+  up being described by multiple adjacent triples that formed a partition
+  of the matching pair.
+
+- Bug #1498146: fix optparse to handle Unicode strings in option help,
+  description, and epilog.
+
+- Bug #1366250: minor optparse documentation error.
+
+- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
+  clarify docs.
+
+- The wsgiref package has been added to the standard library.
+
+- The functions update_wrapper() and wraps() have been added to the functools
+  module. These make it easier to copy relevant metadata from the original
+  function when writing wrapper functions.
+
+- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
+  ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
+
+- Patch #1359618: Speed up charmap encoder by using a trie structure
+  for lookup.
+
+- The functions in the ``pprint`` module now sort dictionaries by key
+  before computing the display.  Before 2.5, ``pprint`` sorted a dictionary
+  if and only if its display required more than one line, although that
+  wasn't documented.  The new behavior increases predictability; e.g.,
+  using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
+
+- Patch #1497027: try HTTP digest auth before basic auth in urllib2
+  (thanks for J. J. Lee).
+
+- Patch #1496206: improve urllib2 handling of passwords with respect to
+  default HTTP and HTTPS ports.
+
+- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
+
+- Patch #1281707: speed up gzip.readline.
+
+- Patch #1180296: Two new functions were added to the locale module:
+  format_string() to get the effect of  "format % items" but locale-aware,
+  and currency() to format a monetary number with currency sign.
+
+- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
+  and several features added, such as speed and geometry control.
+
+- Patch #1488881: add support for external file objects in bz2 compressed
+  tarfiles.
+
+- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
+  stdout arguments, making it possible to redirect input and output
+  for remote debugging.
+
+- Patch #1484695: Update the tarfile module to version 0.8. This fixes
+  a couple of issues, notably handling of long file names using the
+  GNU LONGNAME extension.
+
+- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
+  new flag when ``name`` is already the name of an option flag.
+
+- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
+  package.
+
+- Patch #1472854: make the rlcompleter.Completer class usable on non-
+  UNIX platforms.
+
+- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
+
+- Bug #1472827: correctly escape newlines and tabs in attribute values in
+  the saxutils.XMLGenerator class.
+
+
+Build
+-----
+
+- Bug #1502728: Correctly link against librt library on HP-UX.
+
+- OpenBSD 3.9 is supported now.
+
+- Patch #1492356: Port to Windows CE.
+
+- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
+
+- Patch #1471883: Add --enable-universalsdk.
+
+C API
+-----
+
+Tests
+-----
+
+Tools
+-----
+
+Documentation
+-------------
+
+
+
+What's New in Python 2.5 alpha 2?
+=================================
+
+*Release date: 27-APR-2006*
+
+Core and builtins
+-----------------
+
+- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
+  by converting these apis from macros into exported functions again:
+
+    PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
+    PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
+    PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
+    PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
+    PyRun_String Py_CompileString
+
+- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
+
+- All uses of PyStructSequence_InitType have been changed to initialize
+  the type objects only once, even if the interpreter is initialized
+  multiple times.
+
+- Bug #1454485, array.array('u') could crash the interpreter.  This was
+  due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
+  to unicode when it didn't make sense.  'u#' now requires a unicode string.
+
+- Py_UNICODE is unsigned.  It was always documented as unsigned, but
+  due to a bug had a signed value in previous versions.
+
+- Patch #837242: ``id()`` of any Python object always gives a positive
+  number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
+  ``PyLong_AsVoidPtr`` have been changed accordingly.  Note that it has
+  never been correct to implement a ``__hash()__`` method that returns the
+  ``id()`` of an object:
+
+      def __hash__(self):
+          return id(self)  # WRONG
+
+  because a hash result must be a (short) Python int but it was always
+  possible for ``id()`` to return a Python long.  However, because ``id()``
+  could return negative values before, on a 32-bit box an ``id()`` result
+  was always usable as a hash value before this patch.  That's no longer
+  necessarily so.
+
+- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
+  to load extension modules and now provides the dl module. As a result,
+  sys.setdlopenflags() now works correctly on these systems. (SF patch
+  #1454844)
+
+- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
+  involving generators that have paused outside of any ``try`` or ``with``
+  blocks.  (In 2.5a1, a paused generator that was part of a reference
+  cycle could not be garbage collected, regardless of whether it was
+  paused in a ``try`` or ``with`` block.)
+
+Extension Modules
+-----------------
+
+- Patch #1191065: Fix preprocessor problems on systems where recvfrom
+  is a macro.
+
+- Bug #1467952: os.listdir() now correctly raises an error if readdir()
+  fails with an error condition.
+
+- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
+
+- Bug #1117761: bsddb.*open() no longer raises an exception when using
+  the cachesize parameter.
+
+- Bug #1149413: bsddb.*open() no longer raises an exception when using
+  a temporary db (file=None) with the 'n' flag to truncate on open.
+
+- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
+  as older versions cause excessive test failures.
+
+- Patch #1062014: AF_UNIX sockets under Linux have a special
+  abstract namespace that is now fully supported.
+
+Library
+-------
+
+- Bug #1223937: subprocess.CalledProcessError reports the exit status
+  of the process using the returncode attribute, instead of
+  abusing errno.
+
+- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
+  a doctest to be skipped (the code is not run, and the expected output
+  or exception is ignored).
+
+- Fixed contextlib.nested to cope with exceptions being raised and
+  caught inside exit handlers.
+
+- Updated optparse module to Optik 1.5.1 (allow numeric constants in
+  hex, octal, or binary; add ``append_const`` action; keep going if
+  gettext cannot be imported; added ``OptionParser.destroy()`` method;
+  added ``epilog`` for better help generation).
+
+- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
+  called from a thread spawned as a side effect of importing a module.
+
+- The pydoc module now supports documenting packages contained in
+  .zip or .egg files.
+
+- The pkgutil module now has several new utility functions, such
+  as ``walk_packages()`` to support working with packages that are either
+  in the filesystem or zip files.
+
+- The mailbox module can now modify and delete messages from
+  mailboxes, in addition to simply reading them.  Thanks to Gregory
+  K. Johnson for writing the code, and to the 2005 Google Summer of
+  Code for funding his work.
+
+- The ``__del__`` method of class ``local`` in module ``_threading_local``
+  returned before accomplishing any of its intended cleanup.
+
+- Patch #790710: Add breakpoint command lists in pdb.
+
+- Patch #1063914: Add Tkinter.Misc.clipboard_get().
+
+- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
+
+- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
+  Windows. Bug #1469163.
+
+- The warnings, linecache, inspect, traceback, site, and doctest modules
+  were updated to work correctly with modules imported from zipfiles or
+  via other PEP 302 __loader__ objects.
+
+- Patch #1467770: Reduce usage of subprocess._active to processes which
+  the application hasn't waited on.
+
+- Patch #1462222: Fix Tix.Grid.
+
+- Fix exception when doing glob.glob('anything*/')
+
+- The pstats.Stats class accepts an optional stream keyword argument to
+  direct output to an alternate file-like object.
+
+Build
+-----
+
+- The Makefile now has a reindent target, which runs reindent.py on
+  the library.
+
+- Patch #1470875: Building Python with MS Free Compiler
+
+- Patch #1161914: Add a python-config script.
+
+- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
+  --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
+  specified. (Can be overridden by explicitly setting LINKCC.) Decouple
+  CXX from --with-cxx-main, see description in README.
+
+- Patch #1429775: Link extension modules with the shared libpython.
+
+- Fixed a libffi build problem on MIPS systems.
+
+- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
+  now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
+  and "%zu" for unsigned integers of type ``size_t``.
+
+Tests
+-----
+
+- test_contextlib now checks contextlib.nested can cope with exceptions
+  being raised and caught inside exit handlers.
+
+- test_cmd_line now checks operation of the -m and -c command switches
+
+- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
+  it separately and by hand.  It also wasn't cleaning up its changes to
+  the current Decimal context.
+
+- regrtest.py now has a -M option to run tests that test the new limits of
+  containers, on 64-bit architectures. Running these tests is only sensible
+  on 64-bit machines with more than two gigabytes of memory. The argument
+  passed is the maximum amount of memory for the tests to use.
+
+Tools
+-----
+
+- Added the Python benchmark suite pybench to the Tools/ directory;
+  contributed by Marc-Andre Lemburg.
+
+Documentation
+-------------
+
+- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
+
+- PEP 343: Added Context Types section to the library reference
+  and attempted to bring other PEP 343 related documentation into
+  line with the implementation and/or python-dev discussions.
+
+- Bug #1337990: clarified that ``doctest`` does not support examples
+  requiring both expected output and an exception.
+
+
+What's New in Python 2.5 alpha 1?
+=================================
+
+*Release date: 05-APR-2006*
+
+Core and builtins
+-----------------
+
+- PEP 338: -m command line switch now delegates to runpy.run_module
+  allowing it to support modules in packages and zipfiles
+
+- On Windows, .DLL is not an accepted file name extension for
+  extension modules anymore; extensions are only found if they
+  end in .PYD.
+
+- Bug #1421664: sys.stderr.encoding is now set to the same value as
+  sys.stdout.encoding.
+
+- __import__ accepts keyword arguments.
+
+- Patch #1460496: round() now accepts keyword arguments.
+
+- Fixed bug #1459029 - unicode reprs were double-escaped.
+
+- Patch #1396919: The system scope threads are reenabled on FreeBSD
+  5.4 and later versions.
+
+- Bug #1115379: Compiling a Unicode string with an encoding declaration
+  now gives a SyntaxError.
+
+- Previously, Python code had no easy way to access the contents of a
+  cell object. Now, a ``cell_contents`` attribute has been added
+  (closes patch #1170323).
+
+- Patch #1123430: Python's small-object allocator now returns an arena to
+  the system ``free()`` when all memory within an arena becomes unused
+  again.  Prior to Python 2.5, arenas (256KB chunks of memory) were never
+  freed.  Some applications will see a drop in virtual memory size now,
+  especially long-running applications that, from time to time, temporarily
+  use a large number of small objects.  Note that when Python returns an
+  arena to the platform C's ``free()``, there's no guarantee that the
+  platform C library will in turn return that memory to the operating system.
+  The effect of the patch is to stop making that impossible, and in tests it
+  appears to be effective at least on Microsoft C and gcc-based systems.
+  Thanks to Evan Jones for hard work and patience.
+
+- Patch #1434038: property() now uses the getter's docstring if there is
+  no "doc" argument given. This makes it possible to legitimately use
+  property() as a decorator to produce a read-only property.
+
+- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
+  nb_index slot to the PyNumberMethods struct.  The slot is consulted instead
+  of requiring an int or long in slicing and a few other contexts, enabling
+  other objects (e.g. Numeric Python's integers) to be used as slice indices.
+
+- Fixed various bugs reported by Coverity's Prevent tool.
+
+- PEP 352, patch #1104669: Make exceptions new-style objects.  Introduced the
+  new exception base class, BaseException, which has a new message attribute.
+  KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
+  Raising a string exception now raises a DeprecationWarning.
+
+- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
+  explicitly relative, using 'from .module import name' to mean 'from the same
+  package as this module is in. Imports without dots still default to the
+  old relative-then-absolute, unless 'from __future__ import
+  absolute_import' is used.
+
+- Properly check if 'warnings' raises an exception (usually when a filter set
+  to "error" is triggered) when raising a warning for raising string
+  exceptions.
+
+- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
+  The name was removed from Include/code.h.
+
+- PEP 308: conditional expressions were added: (x if cond else y).
+
+- Patch 1433928:
+  - The copy module now "copies" function objects (as atomic objects).
+  - dict.__getitem__ now looks for a __missing__ hook before raising
+    KeyError.
+
+- PEP 343: with statement implemented. Needs ``from __future__ import
+  with_statement``. Use of 'with' as a variable will generate a warning.
+  Use of 'as' as a variable will also generate a warning (unless it's
+  part of an import statement).
+  The following objects have __context__ methods:
+  - The built-in file type.
+  - The thread.LockType type.
+  - The following types defined by the threading module:
+    Lock, RLock, Condition, Semaphore, BoundedSemaphore.
+  - The decimal.Context class.
+
+- Fix the encodings package codec search function to only search
+  inside its own package. Fixes problem reported in patch #1433198.
+
+  Note: Codec packages should implement and register their own
+  codec search function. PEP 100 has the details.
+
+- PEP 353: Using ``Py_ssize_t`` as the index type.
+
+- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
+  info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
+  now allow Python to make use of memory blocks exceeding 2**32 bytes for
+  some purposes on 64-bit boxes.  A ``PYMALLOC_DEBUG`` build was limited
+  to 4-byte allocations before.
+
+- Patch #1400181, fix unicode string formatting to not use the locale.
+  This is how string objects work.  u'%f' could use , instead of .
+  for the decimal point.  Now both strings and unicode always use periods.
+
+- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
+  configure would break checking curses.h.
+
+- Bug #959576: The pwd module is now builtin. This allows Python to be
+  built on UNIX platforms without $HOME set.
+
+- Bug #1072182, fix some potential problems if characters are signed.
+
+- Bug #889500, fix line number on SyntaxWarning for global declarations.
+
+- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
+
+- Support for converting hex strings to floats no longer works.
+  This was not portable.  float('0x3') now raises a ValueError.
+
+- Patch #1382163: Expose Subversion revision number to Python.  New C API
+  function Py_GetBuildNumber().  New attribute sys.subversion.  Build number
+  is now displayed in interactive prompt banner.
+
+- Implementation of PEP 341 - Unification of try/except and try/finally.
+  "except" clauses can now be written together with a "finally" clause in
+  one try statement instead of two nested ones.  Patch #1355913.
+
+- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
+  now encodes backslash correctly.
+
+- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
+
+- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
+  and long longs.
+
+- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
+  It was possible for dlerror() to return a NULL pointer, so
+  it will now use a default error message in this case.
+
+- Replaced most Unicode charmap codecs with new ones using the
+  new Unicode translate string feature in the builtin charmap
+  codec; the codecs were created from the mapping tables available
+  at ftp.unicode.org and contain a few updates (e.g. the Mac OS
+  encodings now include a mapping for the Apple logo)
+
+- Added a few more codecs for Mac OS encodings
+
+- Sped up some Unicode operations.
+
+- A new AST parser implementation was completed. The abstract
+  syntax tree is available for read-only (non-compile) access
+  to Python code; an _ast module was added.
+
+- SF bug #1167751: fix incorrect code being produced for generator expressions.
+  The following code now raises a SyntaxError:  foo(a = i for i in range(10))
+
+- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
+
+- SF Bug #887946: fix segfault when redirecting stdin from a directory.
+  Provide a warning when a directory is passed on the command line.
+
+- Fix segfault with invalid coding.
+
+- SF bug #772896: unknown encoding results in MemoryError.
+
+- All iterators now have a Boolean value of True.  Formerly, some iterators
+  supported a __len__() method which evaluated to False when the iterator
+  was empty.
+
+- On 64-bit platforms, when __len__() returns a value that cannot be
+  represented as a C int, raise OverflowError.
+
+- test__locale is skipped on OS X < 10.4 (only partial locale support is
+  present).
+
+- SF bug #893549: parsing keyword arguments was broken with a few format
+  codes.
+
+- Changes donated by Elemental Security to make it work on AIX 5.3
+  with IBM's 64-bit compiler (SF patch #1284289).  This also closes SF
+  bug #105470: test_pwd fails on 64bit system (Opteron).
+
+- Changes donated by Elemental Security to make it work on HP-UX 11 on
+  Itanium2 with HP's 64-bit compiler (SF patch #1225212).
+
+- Disallow keyword arguments for type constructors that don't use them
+  (fixes bug #1119418).
+
+- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
+
+- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
+  exceptions that cause a function to exit.
+
+- The implementation of set() and frozenset() was revised to use its
+  own internal data structure.  Memory consumption is reduced by 1/3
+  and there are modest speed-ups as well.  The API is unchanged.
+
+- SF bug #1238681:  freed pointer is used in longobject.c:long_pow().
+
+- SF bug #1229429: PyObject_CallMethod failed to decrement some
+  reference counts in some error exit cases.
+
+- SF bug #1185883:  Python's small-object memory allocator took over
+  a block managed by the platform C library whenever a realloc specified
+  a small new size.  However, there's no portable way to know then how
+  much of the address space following the pointer is valid, so there's no
+  portable way to copy data from the C-managed block into Python's
+  small-object space without risking a memory fault.  Python's small-object
+  realloc now leaves such blocks under the control of the platform C
+  realloc.
+
+- SF bug #1232517: An overflow error was not detected properly when
+  attempting to convert a large float to an int in os.utime().
+
+- SF bug #1224347: hex longs now print with lowercase letters just
+  like their int counterparts.
+
+- SF bug #1163563: the original fix for bug #1010677 ("thread Module
+  Breaks PyGILState_Ensure()") broke badly in the case of multiple
+  interpreter states; back out that fix and do a better job (see
+  http://mail.python.org/pipermail/python-dev/2005-June/054258.html
+  for a longer write-up of the problem).
+
+- SF patch #1180995: marshal now uses a binary format by default when
+  serializing floats.
+
+- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
+  the routines that promise to produce IEEE 754 binary representations
+  of floats now simply copy bytes around.
+
+- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
+  278.
+
+- patch #1109424: int, long, float, complex, and unicode now check for the
+  proper magic slot for type conversions when subclassed.  Previously the
+  magic slot was ignored during conversion.  Semantics now match the way
+  subclasses of str always behaved.  int/long/float, conversion of an instance
+  to the base class has been moved to the proper nb_* magic slot and out of
+  PyNumber_*().
+  Thanks Walter D�rwald.
+
+- Descriptors defined in C with a PyGetSetDef structure, where the setter is
+  NULL, now raise an AttributeError when attempting to set or delete the
+  attribute.  Previously a TypeError was raised, but this was inconsistent
+  with the equivalent pure-Python implementation.
+
+- It is now safe to call PyGILState_Release() before
+  PyEval_InitThreads() (note that if there is reason to believe there
+  are multiple threads around you still must call PyEval_InitThreads()
+  before using the Python API; this fix is for extension modules that
+  have no way of knowing if Python is multi-threaded yet).
+
+- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
+  disabled caused a crash.
+
+- Bug #1165306: instancemethod_new allowed the creation of a method
+  with im_class == im_self == NULL, which caused a crash when called.
+
+- Move exception finalisation later in the shutdown process - this
+  fixes the crash seen in bug #1165761
+
+- Added two new builtins, any() and all().
+
+- Defining a class with empty parentheses is now allowed
+  (e.g., ``class C(): pass`` is no longer a syntax error).
+  Patch #1176012 added support to the 'parser' module and 'compiler' package
+  (thanks to logistix for that added support).
+
+- Patch #1115086: Support PY_LONGLONG in structmember.
+
+- Bug #1155938: new style classes did not check that __init__() was
+  returning None.
+
+- Patch #802188: Report characters after line continuation character
+  ('\') with a specific error message.
+
+- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
+
+- Bug #1124295: the __name__ attribute of file objects was
+  inadvertently made inaccessible in restricted mode.
+
+- Bug #1074011: closing sys.std{out,err} now causes a flush() and
+  an ferror() call.
+
+- min() and max() now support key= arguments with the same meaning as in
+  list.sort().
+
+- The peephole optimizer now performs simple constant folding in expressions:
+      (2+3) --> (5).
+
+- set and frozenset objects can now be marshalled.  SF #1098985.
+
+- Bug #1077106: Poor argument checking could cause memory corruption
+  in calls to os.read().
+
+- The parser did not complain about future statements in illegal
+  positions.  It once again reports a syntax error if a future
+  statement occurs after anything other than a doc string.
+
+- Change the %s format specifier for str objects so that it returns a
+  unicode instance if the argument is not an instance of basestring and
+  calling __str__ on the argument returns a unicode instance.
+
+- Patch #1413181:  changed ``PyThreadState_Delete()`` to forget about the
+  current thread state when the auto-GIL-state machinery knows about
+  it (since the thread state is being deleted, continuing to remember it
+  can't help, but can hurt if another thread happens to get created with
+  the same thread id).
+
+Extension Modules
+-----------------
+
+- Patch #1380952: fix SSL objects timing out on consecutive read()s
+
+- Patch #1309579: wait3 and wait4 were added to the posix module.
+
+- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
+  In addition, the existing ulaw code was updated.
+
+- RFE #567972: Socket objects' family, type and proto properties are
+  now exposed via new attributes.
+
+- Everything under lib-old was removed.  This includes the following modules:
+    Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
+    lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
+    util, whatsound, whrandom, zmod
+
+- The following modules were removed:  regsub, reconvert, regex, regex_syntax.
+
+- re and sre were swapped, so help(re) provides full help.  importing sre
+  is deprecated.  The undocumented re.engine variable no longer exists.
+
+- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
+  SS2 (single-shift 2) escape sequences correctly.
+
+- The unicodedata module was updated to the 4.1 version of the Unicode
+  database. The 3.2 version is still available as unicodedata.db_3_2_0
+  for applications that require this specific version (such as IDNA).
+
+- The timing module is no longer built by default.  It was deprecated
+  in PEP 4 in Python 2.0 or earlier.
+
+- Patch 1433928: Added a new type, defaultdict, to the collections module.
+  This uses the new __missing__ hook behavior added to dict (see above).
+
+- Bug #854823: socketmodule now builds on Sun platforms even when
+  INET_ADDRSTRLEN is not defined.
+
+- Patch #1393157: os.startfile() now has an optional argument to specify
+  a "command verb" to invoke on the file.
+
+- Bug #876637, prevent stack corruption when socket descriptor
+  is larger than FD_SETSIZE.
+
+- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
+  mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
+  mmap.mmap(0, size) should not be used on Windows for anonymous memory.
+
+- Patch #1422385: The nis module now supports access to domains other
+  than the system default domain.
+
+- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
+  are reported, the limit on path name lengths is removed, and stat reports
+  WindowsError now (instead of OSError).
+
+- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
+
+- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
+  before the env.
+
+- Patch #1103116: Basic AF_NETLINK support.
+
+- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
+
+- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
+  Also fix ungetmouse() which did not accept arguments properly.
+  The code now conforms to the documented signature.
+
+- Bug #1400115, Fix segfault when calling curses.panel.userptr()
+  without prior setting of the userptr.
+
+- Fix 64-bit problems in bsddb.
+
+- Patch #1365916: fix some unsafe 64-bit mmap methods.
+
+- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
+  problem on AIX.
+
+- Bug #869197: os.setgroups rejects long integer arguments
+
+- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
+
+- Bug #1344508, Fix UNIX mmap leaking file descriptors
+
+- Patch #1338314, Bug #1336623: fix tarfile so it can extract
+  REGTYPE directories from tarfiles written by old programs.
+
+- Patch #1407992, fixes broken bsddb module db associate when using
+  BerkeleyDB 3.3, 4.0 or 4.1.
+
+- Get bsddb module to build with BerkeleyDB version 4.4
+
+- Get bsddb module to build with BerkeleyDB version 3.2
+
+- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
+  but Python incorrectly assumes it is in UTF-8 format
+
+- Fix parse errors in the readline module when compiling without threads.
+
+- Patch #1288833: Removed thread lock from socket.getaddrinfo on
+  FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
+
+- Patches #1298449 and #1298499: Add some missing checks for error
+  returns in cStringIO.c.
+
+- Patch #1297028: fix segfault if call type on MultibyteCodec,
+  MultibyteStreamReader, or MultibyteStreamWriter
+
+- Fix memory leak in posix.access().
+
+- Patch #1213831: Fix typo in unicodedata._getcode.
+
+- Bug #1007046: os.startfile() did not accept unicode strings encoded in
+  the file system encoding.
+
+- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
+  platforms that don't have inet_aton().
+
+- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
+
+- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
+  line without newlines.
+
+- Bug #728515: mmap.resize() now resizes the file on Unix as it did
+  on Windows.
+
+- Patch #1180695: Add nanosecond stat resolution, and st_gen,
+  st_birthtime for FreeBSD.
+
+- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
+  the request code argument, which results in more C-like behaviour
+  for large or negative values.
+
+- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
+  implementation treated all integer values except 1 as false.
+
+- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
+
+- Patch #1212117: os.stat().st_flags is now accessible as a attribute
+  if available on the platform.
+
+- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
+  available on the platform.
+
+- Bug #1166660: The readline module could segfault if hook functions
+  were set in a different thread than that which called readline.
+
+- collections.deque objects now support a remove() method.
+
+- operator.itemgetter() and operator.attrgetter() now support retrieving
+  multiple fields.  This provides direct support for sorting on multiple
+  keys (primary, secondary, etc).
+
+- os.access now supports Unicode path names on non-Win32 systems.
+
+- Patches #925152, #1118602: Avoid reading after the end of the buffer
+  in pyexpat.GetInputContext.
+
+- Patches #749830, #1144555: allow UNIX mmap size to default to current
+  file size.
+
+- Added functional.partial().  See PEP309.
+
+- Patch #1093585: raise a ValueError for negative history items in readline.
+  {remove_history,replace_history}
+
+- The spwd module has been added, allowing access to the shadow password
+  database.
+
+- stat_float_times is now True.
+
+- array.array objects are now picklable.
+
+- the cPickle module no longer accepts the deprecated None option in the
+  args tuple returned by __reduce__().
+
+- itertools.islice() now accepts None for the start and step arguments.
+  This allows islice() to work more readily with slices:
+      islice(s.start, s.stop, s.step)
+
+- datetime.datetime() now has a strptime class method which can be used to
+  create datetime object using a string and format.
+
+- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
+  with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
+
+Library
+-------
+
+- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
+  been renamed to have only a single underscore prefix.  This was done to
+  make subclassing easier.
+
+- PEP 338: new module runpy defines a run_module function to support
+  executing modules which provide access to source code or a code object
+  via the PEP 302 import mechanisms.
+
+- The email module's parsedate_tz function now sets the daylight savings
+  flag to -1 (unknown) since it can't tell from the date whether it should
+  be set.
+
+- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
+  now sport attributes that provide access to the parts of the result.
+
+- Patch #1462498: sgmllib now handles entity and character references
+  in attribute values.
+
+- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
+  a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
+  later to build this - if you have an earlier version, the C extension
+  module will not be built.
+
+- Bug #1460340: ``random.sample(dict)`` failed in various ways.  Dicts
+  aren't officially supported here, and trying to use them will probably
+  raise an exception some day.  But dicts have been allowed, and "mostly
+  worked", so support for them won't go away without warning.
+
+- Bug #1445068: getpass.getpass() can now be given an explicit stream
+  argument to specify where to write the prompt.
+
+- Patch #1462313, bug #1443328: the pickle modules now can handle classes
+  that have __private names in their __slots__.
+
+- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
+
+- patch #1457316: "setup.py upload" now supports --identity to select the
+  key to be used for signing the uploaded code.
+
+- Queue.Queue objects now support .task_done() and .join() methods
+  to make it easier to monitor when daemon threads have completed
+  processing all enqueued tasks.  Patch #1455676.
+
+- popen2.Popen objects now preserve the command in a .cmd attribute.
+
+- Added the ctypes ffi package.
+
+- email 4.0 package now integrated.  This is largely the same as the email 3.0
+  package that was included in Python 2.3, except that PEP 8 module names are
+  now used (e.g. mail.message instead of email.Message).  The MIME classes
+  have been moved to a subpackage (e.g. email.mime.text instead of
+  email.MIMEText).  The old names are still supported for now.  Several
+  deprecated Message methods have been removed and lots of bugs have been
+  fixed.  More details can be found in the email package documentation.
+
+- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
+  (a subclass of tuple) that provides incremental decoders and encoders
+  (a way to use stateful codecs without the stream API). Python functions
+  codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
+  as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
+  have been added.
+
+- Patch #1359365: Calling next() on a closed StringIO.String object raises
+  a ValueError instead of a StopIteration now (like file and cString.String do).
+  cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
+  called before (like file and StringIO.StringIO do).
+
+- A regrtest option -w was added to re-run failed tests in verbose mode.
+
+- Patch #1446372: quit and exit can now be called from the interactive
+  interpreter to exit.
+
+- The function get_count() has been added to the gc module, and gc.collect()
+  grew an optional 'generation' argument.
+
+- A library msilib to generate Windows Installer files, and a distutils
+  command bdist_msi have been added.
+
+- PEP 343: new module contextlib.py defines decorator @contextmanager
+  and helpful context managers nested() and closing().
+
+- The compiler package now supports future imports after the module docstring.
+
+- Bug #1413790: zipfile now sanitizes absolute archive names that are
+  not allowed by the specs.
+
+- Patch #1215184: FileInput now can be given an opening hook which can
+  be used to control how files are opened.
+
+- Patch #1212287: fileinput.input() now has a mode parameter for
+  specifying the file mode input files should be opened with.
+
+- Patch #1215184: fileinput now has a fileno() function for getting the
+  current file number.
+
+- Patch #1349274: gettext.install() now optionally installs additional
+  translation functions other than _() in the builtin namespace.
+
+- Patch #1337756: fileinput now accepts Unicode filenames.
+
+- Patch #1373643: The chunk module can now read chunks larger than
+  two gigabytes.
+
+- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
+
+- Bug #1430298: It is now possible to send a mail with an empty
+  return address using smtplib.
+
+- Bug #1432260: The names of lambda functions are now properly displayed
+  in pydoc.
+
+- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
+  unless the system is Win32.
+
+- Patch #1349118: urllib now supports user:pass@ style proxy
+  specifications, raises IOErrors when proxies for unsupported protocols
+  are defined, and uses the https proxy on https redirections.
+
+- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
+
+- Bug #1407902: Add support for sftp:// URIs to urlparse.
+
+- Bug #1371247: Update Windows locale identifiers in locale.py.
+
+- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
+  any more.
+
+- Bug #1403410: The warnings module now doesn't get confused
+  when it can't find out the module name it generates a warning for.
+
+- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
+
+- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
+
+- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
+  LoadError as documented, instead of IOError.  For compatibility,
+  LoadError subclasses IOError.
+
+- Added the hashlib module.  It provides secure hash functions for MD5 and
+  SHA1, 224, 256, 384, and 512.  Note that recent developments make the
+  historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
+  In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
+  Ronald L. Rivest offered this advice for Python:
+
+      "The consensus of researchers in this area (at least as
+      expressed at the NIST Hash Function Workshop 10/31/05),
+      is that SHA-256 is a good choice for the time being, but
+      that research should continue, and other alternatives may
+      arise from this research.  The larger SHA's also seem OK."
+
+- Added a subset of Fredrik Lundh's ElementTree package.  Available
+  modules are xml.etree.ElementTree, xml.etree.ElementPath, and
+  xml.etree.ElementInclude, from ElementTree 1.2.6.
+
+- Patch #1162825: Support non-ASCII characters in IDLE window titles.
+
+- Bug #1365984: urllib now opens "data:" URLs again.
+
+- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
+  is raised within the method itself on a previous call (e.g., passing in an
+  illegal argument)
+
+- Bug #1340337: change time.strptime() to always return ValueError when there
+  is an error in the format string.
+
+- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
+
+- Bug #729103: pydoc.py: Fix docother() method to accept additional
+  "parent" argument.
+
+- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
+  for padding.
+
+- Bug #1296004: httplib.py: Limit maximal amount of data read from the
+  socket to avoid a MemoryError on Windows.
+
+- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
+  to get the correct encoding.
+
+- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
+  languages.
+
+- Patch #1268314: Cache lines in StreamReader.readlines for performance.
+
+- Bug #1290505: Fix clearing the regex cache for time.strptime().
+
+- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
+
+- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
+  functionality.
+
+- Bug #1163178: Make IDNA return an empty string when the input is empty.
+
+- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
+  separator and do not output trailing semicolon.
+
+- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
+  ContentTooShortException, when the actually downloaded size does not
+  match the Content-Length header.
+
+- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
+
+- Bug #1178484: Return complete lines from codec stream readers
+  even if there is an exception in later lines, resulting in
+  correct line numbers for decoding errors in source code.
+
+- Bug #1192315: Disallow negative arguments to clear() in pdb.
+
+- Patch #827386: Support absolute source paths in msvccompiler.py.
+
+- Patch #1105730: Apply the new implementation of commonprefix in posixpath
+  to ntpath, macpath, os2emxpath and riscospath.
+
+- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
+  __hasattr__ and __delattr__ methods on class Tk that were breaking
+  Tkdnd.
+
+- Bug #1015140: disambiguated the term "article id" in nntplib docs and
+  docstrings to either "article number" or "message id".
+
+- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
+  parameter, but uses the usual "kwargs=None".
+
+- textwrap now processes text chunks at O(n) speed instead of O(n**2).
+  Patch #1209527 (Contributed by Connelly).
+
+- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
+  to W3C name (404 -> 'Not Found'). RFE #1216944.
+
+- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
+  as this can cause problems with apps closing all file descriptors.
+
+- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
+  it can be missing in embedded interpreters
+
+- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
+
+- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
+  error messages.
+
+- Bug #1108948: Cookie.py produced invalid JavaScript code.
+
+- The tokenize module now detects and reports indentation errors.
+  Bug #1224621.
+
+- The tokenize module has a new untokenize() function to support a full
+  roundtrip from lexed tokens back to Python source code.  In addition,
+  the generate_tokens() function now accepts a callable argument that
+  terminates by raising StopIteration.
+
+- Bug #1196315: fix weakref.WeakValueDictionary constructor.
+
+- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
+  component of the path.
+
+- Patch #1120353: The xmlrpclib module provides better, more transparent,
+  support for datetime.{datetime,date,time} objects.  With use_datetime set
+  to True, applications shouldn't have to fiddle with the DateTime wrapper
+  class at all.
+
+- distutils.commands.upload was added to support uploading distribution
+  files to PyPI.
+
+- distutils.commands.register now encodes the data as UTF-8 before posting
+  them to PyPI.
+
+- decimal operator and comparison methods now return NotImplemented
+  instead of raising a TypeError when interacting with other types.  This
+  allows other classes to implement __radd__ style methods and have them
+  work as expected.
+
+- Bug #1163325:  Decimal infinities failed to hash.  Attempting to
+  hash a NaN raised an InvalidOperation instead of a TypeError.
+
+- Patch #918101: Add tarfile open mode r|* for auto-detection of the
+  stream compression; add, for symmetry reasons, r:* as a synonym of r.
+
+- Patch #1043890: Add extractall method to tarfile.
+
+- Patch #1075887: Don't require MSVC in distutils if there is nothing
+  to build.
+
+- Patch #1103407: Properly deal with tarfile iterators when untarring
+  symbolic links on Windows.
+
+- Patch #645894: Use getrusage for computing the time consumption in
+  profile.py if available.
+
+- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
+
+- Patch #1117454: Remove code to special-case cookies without values
+  in LWPCookieJar.
+
+- Patch #1117339: Add cookielib special name tests.
+
+- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
+
+- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
+
+- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
+
+- Patch #1104111: Alter setup.py --help and --help-commands.
+
+- Patch #1121234: Properly cleanup _exit and tkerror commands.
+
+- Patch #1049151: xdrlib now unpacks booleans as True or False.
+
+- Fixed bug in a NameError bug in cookielib.  Patch #1116583.
+
+- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001).  This
+  disables recursive traversal through instance attributes, which can
+  be exploited in various ways.
+
+- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
+  flags on the HTTP listening socket.
+
+- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
+  Fixed by reading the HTTP body in chunks instead of one big socket.read().
+
+- Patches #893642, #1039083: add allow_none, encoding arguments to
+  constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
+
+- Bug #1110478: Revert os.environ.update to do putenv again.
+
+- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
+
+- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
+
+- Enhancements to the csv module:
+
+  + Dialects are now validated by the underlying C code, better
+    reflecting its capabilities, and improving its compliance with
+    PEP 305.
+  + Dialect parameter parsing has been re-implemented to improve error
+    reporting.
+  + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
+    dictates.
+  + the parser now removes the escapechar prefix from escaped characters.
+  + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
+    types, rather than any object that can be represented as a numeric.
+  + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
+    to floats.
+  + reader now allows \r characters to be quoted (previously it only allowed
+    \n to be quoted).
+  + writer doublequote handling improved.
+  + Dialect classes passed to the module are no longer instantiated by
+    the module before being parsed (the former validation scheme required
+    this, but the mechanism was unreliable).
+  + The dialect registry now contains instances of the internal
+    C-coded dialect type, rather than references to python objects.
+  + the internal c-coded dialect type is now immutable.
+  + register_dialect now accepts the same keyword dialect specifications
+    as the reader and writer, allowing the user to register dialects
+    without first creating a dialect class.
+  + a configurable limit to the size of parsed fields has been added -
+    previously, an unmatched quote character could result in the entire
+    file being read into the field buffer before an error was reported.
+  + A new module method csv.field_size_limit() has been added that sets
+    the parser field size limit (returning the former limit). The initial
+    limit is 128kB.
+  + A line_num attribute has been added to the reader object, which tracks
+    the number of lines read from the source iterator. This is not
+    the same as the number of records returned, as records can span
+    multiple lines.
+  + reader and writer objects were not being registered with the cyclic-GC.
+    This has been fixed.
+
+- _DummyThread objects in the threading module now delete self.__block that is
+  inherited from _Thread since it uses up a lock allocated by 'thread'.  The
+  lock primitives tend to be limited in number and thus should not be wasted on
+  a _DummyThread object.  Fixes bug #1089632.
+
+- The imghdr module now detects Exif files.
+
+- StringIO.truncate() now correctly adjusts the size attribute.
+  (Bug #951915).
+
+- locale.py now uses an updated locale alias table (built using
+  Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
+  alias file); the encoding lookup was enhanced to use Python's
+  encoding alias table.
+
+- moved deprecated modules to Lib/lib-old:  whrandom, tzparse, statcache.
+
+- the pickle module no longer accepts the deprecated None option in the
+  args tuple returned by __reduce__().
+
+- optparse now optionally imports gettext.  This allows its use in setup.py.
+
+- the pickle module no longer uses the deprecated bin parameter.
+
+- the shelve module no longer uses the deprecated binary parameter.
+
+- the pstats module no longer uses the deprecated ignore() method.
+
+- the filecmp module no longer uses the deprecated use_statcache argument.
+
+- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
+  extended or overridden by subclasses.  Formerly, the subclassed method would
+  be ignored by the rest of the module.  (Bug #1078905).
+
+- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
+  the same meaning as in list.sort().
+
+- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
+  once when a size argument is given. This prevents a buffer overflow in the
+  tokenizer with very long source lines.
+
+- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
+  immediately after creating the object, without any intervening
+  ``.decompress()`` calls.
+
+- The reconvert.quote function can now emit triple-quoted strings.  The
+  reconvert module now has some simple documentation.
+
+- ``UserString.MutableString`` now supports negative indices in
+  ``__setitem__`` and ``__delitem__``
+
+- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
+  correctly.
+
+- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
+  ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
+  character even if the user has passed a size parameter to get a proper
+  line ending. Remove the special handling of a "\r\n" that has been split
+  between two lines.
+
+- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
+  about illegal code points. The codec now supports PEP 293 style error
+  handlers.
+
+- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
+  from the input stream, so that the output is a byte string in the correct
+  encoding instead of a unicode string.
+
+- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
+  considering it exactly like a '*'.
+
+- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
+  ``encodings.aliases``.
+
+- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
+
+- Patch #1413711: Certain patterns of differences were making difflib
+  touch the recursion limit.
+
+- Bug #947906: An object oriented interface has been added to the calendar
+  module. It's possible to generate HTML calendar now and the module can be
+  called as a script (e.g. via ``python -mcalendar``). Localized month and
+  weekday names can be ouput (even if an exotic encoding is used) using
+  special classes that use unicode.
+
+Build
+-----
+
+- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
+  by using -mieee gcc option.
+
+- Patch #1432345: Make python compile on DragonFly.
+
+- Build support for Win64-AMD64 was added.
+
+- Patch #1428494: Prefer linking against ncursesw over ncurses library.
+
+- Patch #881820: look for openpty and forkpty also in libbsd.
+
+- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
+  The zlib module is now builtin on Windows.
+
+- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
+
+- Bug #1189330: configure did not correctly determine the necessary
+  value of LINKCC if python was built with GCC 4.0.
+
+- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
+  vulnerability in zlib 1.2.1 and 1.2.2.
+
+- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
+  flags that change binary compatibility.  Changes were also made to
+  distutils.sysconfig to also use the environment variable when used during
+  compilation of the interpreter and of C extensions through distutils.
+
+- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
+  and linking has changed (prebinding is now deprecated, and libcc_dynamic
+  no longer exists). This configure patch makes things right.
+
+- Bug #1158607: Build with --disable-unicode again.
+
+- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
+  defined.  Discovered as a result of not being able to build on OS X.
+
+- setup.py now uses the directories specified in LDFLAGS using the -L option
+  and in CPPFLAGS using the -I option for adding library and include
+  directories, respectively, for compiling extension modules against.  This has
+  led to the core being compiled using the values in CPPFLAGS.  It also removes
+  the need for the special-casing of both DarwinPorts and Fink for darwin since
+  the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
+  ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
+  Fink, ``-I/opt/local/include`` for DarwinPorts).
+
+- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
+  to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
+  Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
+  Closes bug #1096244.  Thanks Gregory Bond.
+
+C API
+-----
+
+- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
+  ``PyObject_{Free, FREE}``.  They map to the system ``free()`` now.  If memory
+  is obtained via the ``PyObject_`` family, it must be released via the
+  ``PyObject_`` family, and likewise for the ``PyMem_`` family.  This has
+  always been officially true, but when Python's small-object allocator was
+  introduced, an attempt was made to cater to a few extension modules
+  discovered at the time that obtained memory via ``PyObject_New`` but
+  released it via ``PyMem_DEL``.  It's years later, and if such code still
+  exists it will fail now (probably with segfaults, but calling wrong
+  low-level memory management functions can yield many symptoms).
+
+- Added a C API for set and frozenset objects.
+
+- Removed PyRange_New().
+
+- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
+  mapping argument now. This string is used as a mapping table. Byte values
+  greater than the length of the string and 0xFFFE are treated as undefined
+  mappings.
+
+
+Tests
+-----
+
+- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
+
+- Patch #1276356: New resource "urlfetch" is implemented.  This enables
+  even impatient people to run tests that require remote files.
+
+
+Documentation
+-------------
+
+- Bug #1402224: Add warning to dl docs about crashes.
+
+- Bug #1396471: Document that Windows' ftell() can return invalid
+  values for text files with UNIX-style line endings.
+
+- Bug #1274828: Document os.path.splitunc().
+
+- Bug #1190204: Clarify which directories are searched by site.py.
+
+- Bug #1193849: Clarify os.path.expanduser() documentation.
+
+- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
+
+- Bug #755617: Document the effects of os.chown() on Windows.
+
+- Patch #1180012: The documentation for modulefinder is now in the library reference.
+
+- Patch #1213031: Document that os.chown() accepts argument values of -1.
+
+- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
+
+- Bug #1175022: Correct the example code for property().
+
+- Document the IterableUserDict class in the UserDict module.
+  Closes bug #1166582.
+
+- Remove all latent references for "Macintosh" that referred to semantics for
+  Mac OS 9 and change to reflect the state for OS X.
+  Closes patch #1095802.  Thanks Jack Jansen.
+
+Mac
+---
+
+
+New platforms
+-------------
+
+- FreeBSD 7 support is added.
+
+
+Tools/Demos
+-----------
+
+- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
+  directory for syntax highlighting in Vim.  Vim directory was added and placed
+  vimrc to it (was previous up a level).
+
+- Added two new files to Tools/scripts: pysource.py, which recursively
+  finds Python source files, and findnocoding.py, which finds Python
+  source files that need an encoding declaration.
+  Patch #784089, credits to Oleg Broytmann.
+
+- Bug #1072853: pindent.py used an uninitialized variable.
+
+- Patch #1177597: Correct Complex.__init__.
+
+- Fixed a display glitch in Pynche, which could cause the right arrow to
+  wiggle over by a pixel.
+
+
 What's New in Python 2.4 final?
 ===============================
 

Modified: python/branches/trunk-math/Misc/NEWS
==============================================================================
--- python/branches/trunk-math/Misc/NEWS	(original)
+++ python/branches/trunk-math/Misc/NEWS	Thu Feb 28 21:09:17 2008
@@ -22,6 +22,44 @@
 
 - Added methods is_inf, is_nan and is_integer to float type.
 
+- Issue #2051: pyc and pyo files are not longer created with permission 644. The
+  mode is now inherited from the py file.
+
+- Issue #2067: file.__exit__() now calls subclasses' close() method.
+
+- Patch #1759: Backport of PEP 3129 class decorators.
+
+- Issue #1881: An internal parser limit has been increased. Also see 
+  issue 215555 for a discussion.
+
+- Added the future_builtins module, which contains hex() and oct().
+  These are the PEP 3127 version of these functions, designed to be
+  compatible with the hex() and oct() builtins from Python 3.0.  They
+  differ slightly in their output formats from the existing, unchanged
+  Python 2.6 builtins.  The expected usage of the future_builtins
+  module is:
+    from future_builtins import hex, oct
+
+- Issue #1600: Modifed PyOS_ascii_formatd to use at most 2 digit
+  exponents for exponents with absolute value < 100.  Follows C99
+  standard.  This is a change on Windows, which would use 3 digits.
+  Also, added 'n' to the formats that PyOS_ascii_formatd understands,
+  so that any alterations it does to the resulting string will be
+  available in stringlib/formatter.h (for float.__format__).
+
+- Implemented PEP 3101, Advanced String Formatting.  This adds a new
+  builtin format(); a format() method for str and unicode; a
+  __format__() method to object, str, unicode, int, long, float, and
+  datetime; the class string.Formatter; and the C API
+  PyObject_Format().
+
+- Fixed several potential crashes, all caused by specially crafted __del__
+  methods exploiting objects in temporarily inconsistent state.
+
+- Issue #2115: Important speedup in setting __slot__ attributes.  Also 
+  prevent a possible crash: an Abstract Base Class would try to access a slot 
+  on a registered virtual subclass.
+
 - Fixed repr() and str() of complex numbers with infinity or nan as real or
   imaginary part.
 
@@ -129,10 +167,6 @@
 - Issue #1620: New property decorator syntax was modifying the decorator
   in place instead of creating a new decorator object.
 
-- Issue #1580: New free format floating point representation based on
-  "Floating-Point Printer Sample Code", by Robert G. Burger. For example
-  repr(11./5) now returns '2.2' instead of '2.2000000000000002'.
-
 - Issue #1538: Avoid copying string in split/rsplit if the split
   char is not found.
 
@@ -417,6 +451,29 @@
 Library
 -------
 
+- Add a timing parameter when using trace.Trace to print out timestamps.
+
+- #1627: httplib now ignores negative Content-Length headers.
+
+- #900744: If an invalid chunked-encoding header is sent by a server,
+  httplib will now raise IncompleteRead and close the connection instead
+  of raising ValueError.
+
+- #1492: The content type of BaseHTTPServer error messages can now be
+  overridden.
+
+- Issue 1781: ConfigParser now does not let you add the "default" section
+  (ignore-case)
+
+- Removed uses of dict.has_key() from distutils, and uses of
+  callable() from copy_reg.py, so the interpreter now starts up
+  without warnings when '-3' is given.  More work like this needs to
+  be done in the rest of the stdlib.
+
+- Issue #1916. Added isgenerator() and isgeneratorfunction() to inspect.py.
+
+- #1224: Fixed bad url parsing when path begins with double slash.
+
 - ctypes instances that are not or do not contain pointers can now be
   pickled.
 
@@ -620,6 +677,11 @@
 - itertools.count() is no longer bounded to LONG_MAX.  Formerly, it raised
   an OverflowError.  Now, automatically shifts from ints to longs.
 
+- Added itertools.product() which forms the Cartesian product of
+  the input iterables.
+
+- Added itertools.combinations().
+
 - Patch #1541463: optimize performance of cgi.FieldStorage operations.
 
 - Decimal is fully updated to the latest Decimal Specification (v1.66).
@@ -1042,14 +1104,14 @@
   written to disk after calling .flush() or .close(). (Patch by David
   Watson.)
 
-- Patch #1592250: Add elidge argument to Tkinter.Text.search.
+- Patch #1592250: Add elide argument to Tkinter.Text.search.
 
-- Patch #838546: Make terminal become controlling in pty.fork()
+- Patch #838546: Make terminal become controlling in pty.fork().
 
 - Patch #1351744: Add askyesnocancel helper for tkMessageBox.
 
 - Patch #1060577: Extract list of RPM files from spec file in
-  bdist_rpm
+  bdist_rpm.
 
 - Bug #1586613: fix zlib and bz2 codecs' incremental en/decoders.
 
@@ -1133,7 +1195,8 @@
 - idle: Honor the "Cancel" action in the save dialog (Debian bug #299092).
 
 - Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
-  first chunk fed to the decoder started with a BOM, but was longer than 3 bytes.
+  first chunk fed to the decoder started with a BOM, but was longer than 3
+  bytes.
 
 - The implementation of UnicodeError objects has been simplified (start and end
   attributes are now stored directly as Py_ssize_t members).
@@ -1148,10 +1211,20 @@
   does not claim to support starttls.  Adds the SMTP.ehlo_or_helo_if_needed()
   method.  Patch contributed by Bill Fenner.
 
+- Patch #1089358: Add signal.siginterrupt, a wrapper around siginterrupt(3).
 
 Extension Modules
 -----------------
 
+- Patch #1506171: added operator.methodcaller().
+
+- Patch #1826: operator.attrgetter() now supports dotted attribute paths.
+
+- Patch #1957: syslogmodule: Release GIL when calling syslog(3)
+
+- #2112: mmap.error is now a subclass of EnvironmentError and not a
+  direct EnvironmentError
+
 - Bug #2111: mmap segfaults when trying to write a block opened with PROT_READ
 
 - #2063: correct order of utime and stime in os.times() result on Windows.
@@ -1344,6 +1417,8 @@
 Tests
 -----
 
+- Refactor test_logging to use doctest.
+
 - Refactor test_profile and test_cprofile to use the same code to profile.
 
 - Make test_runpy reentrant by fixing _check_module to clear out any module
@@ -1379,6 +1454,11 @@
 Tools
 -----
 
+- Tools/scripts/reindent.py now creates the backup file using shutil.copy
+  to preserve user/group and permissions. Added also a --nobackup option
+  to not create the backup if the user is concerned regarding this.  Check
+  issue 1050828 for more details.
+
 - Tools/scripts/win_add2path.py was added. The simple script modifes the
   PATH environment var of the HKCU tree and adds the python bin and script
   directory.
@@ -1623,2143 +1703,6 @@
   lead to the deprecation of macostools.touched() as it relied solely on macfs
   and was a no-op under OS X.
 
-
-What's New in Python 2.5 release candidate 1?
-=============================================
-
-*Release date: 17-AUG-2006*
-
-Core and builtins
------------------
-
-- Unicode objects will no longer raise an exception when being
-  compared equal or unequal to a string and a UnicodeDecodeError
-  exception occurs, e.g. as result of a decoding failure.
-
-  Instead, the equal (==) and unequal (!=) comparison operators will
-  now issue a UnicodeWarning and interpret the two objects as
-  unequal. The UnicodeWarning can be filtered as desired using
-  the warning framework, e.g. silenced completely, turned into an
-  exception, logged, etc.
-
-  Note that compare operators other than equal and unequal will still
-  raise UnicodeDecodeError exceptions as they've always done.
-
-- Fix segfault when doing string formatting on subclasses of long.
-
-- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
-  with new-style classes.
-
-- Fix bug related to __len__ functions returning negative values with
-  classic classes.
-
-- Patch #1538606, Fix __index__() clipping.  There were some problems
-  discovered with the API and how integers that didn't fit into Py_ssize_t
-  were handled.  This patch attempts to provide enough alternatives
-  to effectively use __index__.
-
-- Bug #1536021: __hash__ may now return long int; the final hash
-  value is obtained by invoking hash on the long int.
-
-- Bug #1536786: buffer comparison could emit a RuntimeWarning.
-
-- Bug #1535165: fixed a segfault in input() and raw_input() when
-  sys.stdin is closed.
-
-- On Windows, the PyErr_Warn function is now exported from
-  the Python dll again.
-
-- Bug #1191458: tracing over for loops now produces a line event
-  on each iteration.  Fixing this problem required changing the .pyc
-  magic number.  This means that .pyc files generated before 2.5c1
-  will be regenerated.
-
-- Bug #1333982: string/number constants were inappropriately stored
-  in the byte code and co_consts even if they were not used, ie
-  immediately popped off the stack.
-
-- Fixed a reference-counting problem in property().
-
-
-Library
--------
-
-- Fix a bug in the ``compiler`` package that caused invalid code to be
-  generated for generator expressions.
-
-- The distutils version has been changed to 2.5.0. The change to
-  keep it programmatically in sync with the Python version running
-  the code (introduced in 2.5b3) has been reverted. It will continue
-  to be maintained manually as static string literal.
-
-- If the Python part of a ctypes callback function returns None,
-  and this cannot be converted to the required C type, an exception is
-  printed with PyErr_WriteUnraisable.  Before this change, the C
-  callback returned arbitrary values to the calling code.
-
-- The __repr__ method of a NULL ctypes.py_object() no longer raises
-  an exception.
-
-- uuid.UUID now has a bytes_le attribute. This returns the UUID in
-  little-endian byte order for Windows. In addition, uuid.py gained some
-  workarounds for clocks with low resolution, to stop the code yielding
-  duplicate UUIDs.
-
-- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
-  before raising SystemExit, allowing IDLE to honor quit() and exit().
-
-- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
-
-- Patch #1536071: trace.py should now find the full module name of a
-  file correctly even on Windows.
-
-- logging's atexit hook now runs even if the rest of the module has
-  already been cleaned up.
-
-- Bug #1112549, fix DoS attack on cgi.FieldStorage.
-
-- Bug #1531405, format_exception no longer raises an exception if
-  str(exception) raised an exception.
-
-- Fix a bug in the ``compiler`` package that caused invalid code to be
-  generated for nested functions.
-
-
-Extension Modules
------------------
-
-- Patch #1511317: don't crash on invalid hostname (alias) info.
-
-- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
-  raises the correct exceptions.
-
-- Patch # 1536908: enable building ctypes on OpenBSD/AMD64.  The
-  '-no-stack-protector' compiler flag for OpenBSD has been removed.
-
-- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
-  uses the _as_parameter_ attribute when objects are passed to foreign
-  function calls.  The ctypes version number was changed to 1.0.1.
-
-- Bug #1530559, struct.pack raises TypeError where it used to convert.
-  Passing float arguments to struct.pack when integers are expected
-  now triggers a DeprecationWarning.
-
-
-Tests
------
-
-- test_socketserver should now work on cygwin and not fail sporadically
-  on other platforms.
-
-- test_mailbox should now work on cygwin versions 2006-08-10 and later.
-
-- Bug #1535182: really test the xreadlines() method of bz2 objects.
-
-- test_threading now skips testing alternate thread stack sizes on
-  platforms that don't support changing thread stack size.
-
-
-Documentation
--------------
-
-- Patch #1534922: unittest docs were corrected and enhanced.
-
-
-Build
------
-
-- Bug #1535502, build _hashlib on Windows, and use masm assembler
-  code in OpenSSL.
-
-- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
-
-- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
-
-
-C API
------
-
-- New API for Unicode rich comparisons: PyUnicode_RichCompare()
-
-- Bug #1069160.  Internal correctness changes were made to
-  ``PyThreadState_SetAsyncExc()``.  A test case was added, and
-  the documentation was changed to state that the return value
-  is always 1 (normal) or 0 (if the specified thread wasn't found).
-
-
-What's New in Python 2.5 beta 3?
-================================
-
-*Release date: 03-AUG-2006*
-
-Core and builtins
------------------
-
-- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
-  returned a long (see PEP 353).
-
-- Bug #1515471: string.replace() accepts character buffers again.
-
-- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
-  This provides the proper warning for struct.pack().
-  PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
-
-- Patch #1531113: Fix augmented assignment with yield expressions.
-  Also fix a SystemError when trying to assign to yield expressions.
-
-- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
-  with PEP 302.  This was fixed by adding an ``imp.NullImporter`` type that is
-  used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
-  excessive filesystem operations during imports.
-
-- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
-  operations on signed longs that are formally undefined by C.
-  Unfortunately, at least one compiler now cares about that, so complicated
-  the code to make that compiler happy again.
-
-- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
-
-- Patch #1232023: Stop including current directory in search
-  path on Windows.
-
-- Fix some potential crashes found with failmalloc.
-
-- Fix warnings reported by Klocwork's static analysis tool.
-
-- Bug #1512814, Fix incorrect lineno's when code within a function
-  had more than 255 blank lines.
-
-- Patch #1521179: Python now accepts the standard options ``--help`` and
-  ``--version`` as well as ``/?`` on Windows.
-
-- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
-  again.  Fixing this problem required changing the .pyc magic number.
-  This means that .pyc files generated before 2.5b3 will be regenerated.
-
-- Bug #1524317:  Compiling Python ``--without-threads`` failed.
-  The Python core compiles again, and, in a build without threads, the
-  new ``sys._current_frames()`` returns a dictionary with one entry,
-  mapping the faux "thread id" 0 to the current frame.
-
-- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
-
-
-Library
--------
-
-- Fix #1693149.  Now you can pass several modules separated by
-  comma to trace.py in the same --ignore-module option.
-
-- Correction of patch #1455898: In the mbcs decoder, set final=False
-  for stream decoder, but final=True for the decode function.
-
-- os.urandom no longer masks unrelated exceptions like SystemExit or
-  KeyboardInterrupt.
-
-- Bug #1525866: Don't copy directory stat times in
-  shutil.copytree on Windows
-
-- Bug #1002398: The documentation for os.path.sameopenfile now correctly
-  refers to file descriptors, not file objects.
-
-- The renaming of the xml package to xmlcore, and the import hackery done
-  to make it appear at both names, has been removed.  Bug #1511497,
-  #1513611, and probably others.
-
-- Bug #1441397: The compiler module now recognizes module and function
-  docstrings correctly as it did in Python 2.4.
-
-- Bug #1529297:  The rewrite of doctest for Python 2.4 unintentionally
-  lost that tests are sorted by name before being run.  This rarely
-  matters for well-written tests, but can create baffling symptoms if
-  side effects from one test to the next affect outcomes.  ``DocTestFinder``
-  has been changed to sort the list of tests it returns.
-
-- The distutils version has been changed to 2.5.0, and is now kept
-  in sync with sys.version_info[:3].
-
-- Bug #978833: Really close underlying socket in _socketobject.close.
-
-- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
-  title().
-
-- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
-  to recursive calls and call it with the failing package name.
-
-- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
-
-- Patch #1515343: Fix printing of deprecated string exceptions with a
-  value in the traceback module.
-
-- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
-
-- Patch #1524429: Use repr() instead of backticks in Tkinter again.
-
-- Bug #1520914: Change time.strftime() to accept a zero for any position in its
-  argument tuple.  For arguments where zero is illegal, the value is forced to
-  the minimum value that is correct.  This is to support an undocumented but
-  common way people used  to fill in inconsequential information in the time
-  tuple pre-2.4.
-
-- Patch #1220874: Update the binhex module for Mach-O.
-
-- The email package has improved RFC 2231 support, specifically for
-  recognizing the difference between encoded (name*0*=<blah>) and non-encoded
-  (name*0=<blah>) parameter continuations.  This may change the types of
-  values returned from email.message.Message.get_param() and friends.
-  Specifically in some cases where non-encoded continuations were used,
-  get_param() used to return a 3-tuple of (None, None, string) whereas now it
-  will just return the string (since non-encoded continuations don't have
-  charset and language parts).
-
-  Also, whereas % values were decoded in all parameter continuations, they are
-  now only decoded in encoded parameter parts.
-
-- Bug #1517990: IDLE keybindings on MacOS X now work correctly
-
-- Bug #1517996: IDLE now longer shows the default Tk menu when a
-  path browser, class browser or debugger is the frontmost window on MacOS X
-
-- Patch #1520294: Support for getset and member descriptors in types.py,
-  inspect.py, and pydoc.py.  Specifically, this allows for querying the type
-  of an object against these built-in types and more importantly, for getting
-  their docstrings printed in the interactive interpreter's help() function.
-
-
-Extension Modules
------------------
-
-- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
-  a socket operation on a socket with a timeout, the exception will be
-  caught correctly.  Previously, the exception was not caught.
-
-- Patch #1529514: The _ctypes extension is now compiled on more
-  openbsd target platforms.
-
-- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
-  a memory leak, affecting pickles and deep copies.
-
-- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
-  Paul Eggert.
-
-- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
-
-- Patch #1521817: Index range checking on ctypes arrays containing
-  exactly one element enabled again.  This allows iterating over these
-  arrays, without the need to check the array size before.
-
-- Bug #1521375: When the code in ctypes.util.find_library was
-  run with root privileges, it could overwrite or delete
-  /dev/null in certain cases; this is now fixed.
-
-- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
-  default mode for loading shared libraries in ctypes.
-
-- Because of a misspelled preprocessor symbol, ctypes was always
-  compiled without thread support; this is now fixed.
-
-- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
-  methods now allow their database parameter to be None as the
-  sleepycat API allows.
-
-- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
-  bluetooth API compared with Linux and FreeBSD.
-
-Tests
------
-
-- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
-  how long the test file should take to play.  Now accepts taking 2.93 secs
-  (exact time) +/- 10% instead of the hard-coded 3.1 sec.
-
-- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
-  ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
-  run via ``regrtest.py``. Now they do.
-
-Build
------
-
-- Bug #1439538: Drop usage of test -e in configure as it is not portable.
-
-Mac
----
-
-- PythonLauncher now works correctly when the path to the script contains
-  characters that are treated specially by the shell (such as quotes).
-
-- Bug #1527397: PythonLauncher now launches scripts with the working directory
-  set to the directory that contains the script instead of the user home
-  directory. That latter was an implementation accident and not what users
-  expect.
-
-
-What's New in Python 2.5 beta 2?
-================================
-
-*Release date: 11-JUL-2006*
-
-Core and builtins
------------------
-
-- Bug #1441486: The literal representation of -(sys.maxint - 1)
-  again evaluates to a int object, not a long.
-
-- Bug #1501934: The scope of global variables that are locally assigned
-  using augmented assignment is now correctly determined.
-
-- Bug #927248: Recursive method-wrapper objects can now safely
-  be released.
-
-- Bug #1417699: Reject locale-specific decimal point in float()
-  and atof().
-
-- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
-  omit a default "error" argument for NULL pointer.  This allows
-  the parser to take a codec from cjkcodecs again.
-
-- Bug #1519018: 'as' is now validated properly in import statements.
-
-- On 64 bit systems, int literals that use less than 64 bits are
-  now ints rather than longs.
-
-- Bug #1512814, Fix incorrect lineno's when code at module scope
-  started after line 256.
-
-- New function ``sys._current_frames()`` returns a dict mapping thread
-  id to topmost thread stack frame.  This is for expert use, and is
-  especially useful for debugging application deadlocks.  The functionality
-  was previously available in Fazal Majid's ``threadframe`` extension
-  module, but it wasn't possible to do this in a wholly threadsafe way from
-  an extension.
-
-Library
--------
-
-- Bug #1257728: Mention Cygwin in distutils error message about a missing
-  VS 2003.
-
-- Patch #1519566: Update turtle demo, make begin_fill idempotent.
-
-- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
-  environment variable to be set in order to the SDK environment
-  for finding the compiler, include files, etc.
-
-- Bug #1515998: Properly generate logical ids for files in bdist_msi.
-
-- warnings.py now ignores ImportWarning by default
-
-- string.Template() now correctly handles tuple-values. Previously,
-  multi-value tuples would raise an exception and single-value tuples would
-  be treated as the value they contain, instead.
-
-- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
-  even if some data are received.
-
-- Bug #1267547: Put proper recursive setup.py call into the
-  spec file generated by bdist_rpm.
-
-- Bug #1514693: Update turtle's heading when switching between
-  degrees and radians.
-
-- Reimplement turtle.circle using a polyline, to allow correct
-  filling of arcs.
-
-- Bug #1514703: Only setup canvas window in turtle when the canvas
-  is created.
-
-- Bug #1513223: .close() of a _socketobj now releases the underlying
-  socket again, which then gets closed as it becomes unreferenced.
-
-- Bug #1504333: Make sgmllib support angle brackets in quoted
-  attribute values.
-
-- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
-  sgmllib ('[' and ']' were not accepted).
-
-- Fix a bug in the turtle module's end_fill function.
-
-- Bug #1510580: The 'warnings' module improperly required that a Warning
-  category be either a types.ClassType and a subclass of Warning.  The proper
-  check is just that it is a subclass with Warning as the documentation states.
-
-- The compiler module now correctly compiles the new try-except-finally
-  statement (bug #1509132).
-
-- The wsgiref package is now installed properly on Unix.
-
-- A bug was fixed in logging.config.fileConfig() which caused a crash on
-  shutdown when fileConfig() was called multiple times.
-
-- The sqlite3 module did cut off data from the SQLite database at the first
-  null character before sending it to a custom converter. This has been fixed
-  now.
-
-Extension Modules
------------------
-
-- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
-  means that select() on sockets > FD_SETSIZE (typically 1024) work again.
-  The patch makes sockets use poll() internally where available.
-
-- Assigning None to pointer type fields in ctypes structures possible
-  overwrote the wrong fields, this is fixed now.
-
-- Fixed a segfault in _ctypes when ctypes.wintypes were imported
-  on non-Windows platforms.
-
-- Bug #1518190: The ctypes.c_void_p constructor now accepts any
-  integer or long, without range checking.
-
-- Patch #1517790: It is now possible to use custom objects in the ctypes
-  foreign function argtypes sequence as long as they provide a from_param
-  method, no longer is it required that the object is a ctypes type.
-
-- The '_ctypes' extension module now works when Python is configured
-  with the --without-threads option.
-
-- Bug #1513646: os.access on Windows now correctly determines write
-  access, again.
-
-- Bug #1512695: cPickle.loads could crash if it was interrupted with
-  a KeyboardInterrupt.
-
-- Bug #1296433: parsing XML with a non-default encoding and
-  a CharacterDataHandler could crash the interpreter in pyexpat.
-
-- Patch #1516912: improve Modules support for OpenVMS.
-
-Build
------
-
-- Automate Windows build process for the Win64 SSL module.
-
-- 'configure' now detects the zlib library the same way as distutils.
-  Previously, the slight difference could cause compilation errors of the
-  'zlib' module on systems with more than one version of zlib.
-
-- The MSI compileall step was fixed to also support a TARGETDIR
-  with spaces in it.
-
-- Bug #1517388: sqlite3.dll is now installed on Windows independent
-  of Tcl/Tk.
-
-- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
-  trying to be installed even though it's empty.
-
-Tests
------
-
-- Call os.waitpid() at the end of tests that spawn child processes in order
-  to minimize resources (zombies).
-
-Documentation
--------------
-
-- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
-  documentation for the warnings module.
-
-- Patch #1509163: MS Toolkit Compiler no longer available.
-
-- Patch #1504046: Add documentation for xml.etree.
-
-
-What's New in Python 2.5 beta 1?
-================================
-
-*Release date: 20-JUN-2006*
-
-Core and builtins
------------------
-
-- Patch #1507676: Error messages returned by invalid abstract object operations
-  (such as iterating over an integer) have been improved and now include the
-  type of the offending object to help with debugging.
-
-- Bug #992017: A classic class that defined a __coerce__() method that returned
-  its arguments swapped would infinitely recurse and segfault the interpreter.
-
-- Fix the socket tests so they can be run concurrently.
-
-- Removed 5 integers from C frame objects (PyFrameObject).
-  f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
-
-- Bug #532646: object.__call__() will continue looking for the __call__
-  attribute on objects until one without one is found.  This leads to recursion
-  when you take a class and set its __call__ attribute to an instance of the
-  class.  Originally fixed for classic classes, but this fix is for new-style.
-  Removes the infinite_rec_3 crasher.
-
-- The string and unicode methods startswith() and endswith() now accept
-  a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
-
-- Buffer objects, at the C level, never used the char buffer
-  implementation even when the char buffer for the wrapped object was
-  explicitly requested (originally returned the read or write buffer).
-  Now a TypeError is raised if the char buffer is not present but is
-  requested.
-
-- Patch #1346214: Statements like "if 0: suite" are now again optimized
-  away like they were in Python 2.4.
-
-- Builtin exceptions are now full-blown new-style classes instead of
-  instances pretending to be classes, which speeds up exception handling
-  by about 80% in comparison to 2.5a2.
-
-- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
-  Unicode 4.1.
-
-- Patch #921466: sys.path_importer_cache is now used to cache valid and
-  invalid file paths for the built-in import machinery which leads to
-  fewer open calls on startup.
-
-- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
-  of-2 bases.  The largest speedup is for inputs with about 1000 decimal
-  digits.  Conversion from non-power-of-2 bases remains quadratic-time in
-  the number of input digits (it was and remains linear-time for bases
-  2, 4, 8, 16 and 32).
-
-- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
-  when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
-  an integer close to ``sys.maxint``.  This was repaired by patch
-  #1335972, which also gives a nice speedup.
-
-- Patch #1337051: reduced size of frame objects.
-
-- PyErr_NewException now accepts a tuple of base classes as its
-  "base" parameter.
-
-- Patch #876206: function call speedup by retaining allocated frame
-  objects.
-
-- Bug #1462152: file() now checks more thoroughly for invalid mode
-  strings and removes a possible "U" before passing the mode to the
-  C library function.
-
-- Patch #1488312, Fix memory alignment problem on SPARC in unicode
-
-- Bug #1487966: Fix SystemError with conditional expression in assignment
-
-- WindowsError now has two error code attributes: errno, which carries
-  the error values from errno.h, and winerror, which carries the error
-  values from winerror.h. Previous versions put the winerror.h values
-  (from GetLastError()) into the errno attribute.
-
-- Patch #1475845: Raise IndentationError for unexpected indent.
-
-- Patch #1479181: split open() and file() from being aliases for each other.
-
-- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
-  methods were always silently ignored by dictionaries when comparing keys.
-  They are now passed through (except when using the C API function
-  ``PyDict_GetItem()``, whose semantics did not change).
-
-- Bug #1456209: In some obscure cases it was possible for a class with a
-  custom ``__eq__()`` method to confuse dict internals when class instances
-  were used as a dict's keys and the ``__eq__()`` method mutated the dict.
-  No, you don't have any code that did this ;-)
-
-Extension Modules
------------------
-
-- Bug #1295808: expat symbols should be namespaced in pyexpat
-
-- Patch #1462338: Upgrade pyexpat to expat 2.0.0
-
-- Change binascii.hexlify to accept a read-only buffer instead of only a char
-  buffer and actually follow its documentation.
-
-- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
-
-- Patch #1478788 (modified version): The functional extension module has
-  been renamed to _functools and a functools Python wrapper module added.
-  This provides a home for additional function related utilities that are
-  not specifically about functional programming. See PEP 309.
-
-- Patch #1493701: performance enhancements for struct module.
-
-- Patch #1490224: time.altzone is now set correctly on Cygwin.
-
-- Patch #1435422: zlib's compress and decompress objects now have a
-  copy() method.
-
-- Patch #1454481: thread stack size is now tunable at runtime for thread
-  enabled builds on Windows and systems with Posix threads support.
-
-- On Win32, os.listdir now supports arbitrarily-long Unicode path names
-  (up to the system limit of 32K characters).
-
-- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
-  As a result, these functions now raise WindowsError instead of OSError.
-
-- ``time.clock()`` on Win64 should use the high-performance Windows
-  ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
-  Windows platforms).
-
-- Calling Tk_Init twice is refused if the first call failed as that
-  may deadlock.
-
-- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
-  accept it without potentially using an uninitialized pointer.
-
-- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
-  assuming BerkeleyDB >= 4.0 and 4.4 respectively.  [pybsddb project SF
-  patch numbers 1494885 and 1494902]
-
-- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
-  [pybsddb project SF patch number 1466734]
-
-- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
-  parameter is supplied.  [SF pybsddb bug #1477863]
-
-- bsddb: the __len__ method of a DB object has been fixed to return correct
-  results.  It could previously incorrectly return 0 in some cases.
-  Fixes SF bug 1493322 (pybsddb bug 1184012).
-
-- bsddb: the bsddb.dbtables Modify method now raises the proper error and
-  aborts the db transaction safely when a modifier callback fails.
-  Fixes SF python patch/bug #1408584.
-
-- bsddb: multithreaded DB access using the simple bsddb module interface
-  now works reliably.  It has been updated to use automatic BerkeleyDB
-  deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
-  database calls that would previously deadlock. [SF python bug #775414]
-
-- Patch #1446489: add support for the ZIP64 extensions to zipfile.
-
-- Patch #1506645: add Python wrappers for the curses functions
-  is_term_resized, resize_term and resizeterm.
-
-Library
--------
-
-- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
-  functions.
-
-- Patch #812986: Update turtle output even if not tracing.
-
-- Patch #1494750: Destroy master after deleting children in
-  Tkinter.BaseWidget.
-
-- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
-
-- Patch #763580: Add name and value arguments to Tkinter variable
-  classes.
-
-- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
-  mime.types file for determining MIME types.
-
-- Bug #1339007: Shelf objects now don't raise an exception in their
-  __del__ method when initialization failed.
-
-- Patch #1455898: The MBCS codec now supports the incremental mode for
-  double-byte encodings.
-
-- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
-  guarantee that adjacent triples in the return list always describe
-  non-adjacent blocks.  Previously, a pair of matching blocks could end
-  up being described by multiple adjacent triples that formed a partition
-  of the matching pair.
-
-- Bug #1498146: fix optparse to handle Unicode strings in option help,
-  description, and epilog.
-
-- Bug #1366250: minor optparse documentation error.
-
-- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
-  clarify docs.
-
-- The wsgiref package has been added to the standard library.
-
-- The functions update_wrapper() and wraps() have been added to the functools
-  module. These make it easier to copy relevant metadata from the original
-  function when writing wrapper functions.
-
-- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
-  ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
-
-- Patch #1359618: Speed up charmap encoder by using a trie structure
-  for lookup.
-
-- The functions in the ``pprint`` module now sort dictionaries by key
-  before computing the display.  Before 2.5, ``pprint`` sorted a dictionary
-  if and only if its display required more than one line, although that
-  wasn't documented.  The new behavior increases predictability; e.g.,
-  using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
-
-- Patch #1497027: try HTTP digest auth before basic auth in urllib2
-  (thanks for J. J. Lee).
-
-- Patch #1496206: improve urllib2 handling of passwords with respect to
-  default HTTP and HTTPS ports.
-
-- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
-
-- Patch #1281707: speed up gzip.readline.
-
-- Patch #1180296: Two new functions were added to the locale module:
-  format_string() to get the effect of  "format % items" but locale-aware,
-  and currency() to format a monetary number with currency sign.
-
-- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
-  and several features added, such as speed and geometry control.
-
-- Patch #1488881: add support for external file objects in bz2 compressed
-  tarfiles.
-
-- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
-  stdout arguments, making it possible to redirect input and output
-  for remote debugging.
-
-- Patch #1484695: Update the tarfile module to version 0.8. This fixes
-  a couple of issues, notably handling of long file names using the
-  GNU LONGNAME extension.
-
-- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
-  new flag when ``name`` is already the name of an option flag.
-
-- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
-  package.
-
-- Patch #1472854: make the rlcompleter.Completer class usable on non-
-  UNIX platforms.
-
-- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
-
-- Bug #1472827: correctly escape newlines and tabs in attribute values in
-  the saxutils.XMLGenerator class.
-
-
-Build
------
-
-- Bug #1502728: Correctly link against librt library on HP-UX.
-
-- OpenBSD 3.9 is supported now.
-
-- Patch #1492356: Port to Windows CE.
-
-- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
-
-- Patch #1471883: Add --enable-universalsdk.
-
-C API
------
-
-Tests
------
-
-Tools
------
-
-Documentation
--------------
-
-
-
-What's New in Python 2.5 alpha 2?
-=================================
-
-*Release date: 27-APR-2006*
-
-Core and builtins
------------------
-
-- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
-  by converting these apis from macros into exported functions again:
-
-    PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
-    PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
-    PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
-    PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
-    PyRun_String Py_CompileString
-
-- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
-
-- All uses of PyStructSequence_InitType have been changed to initialize
-  the type objects only once, even if the interpreter is initialized
-  multiple times.
-
-- Bug #1454485, array.array('u') could crash the interpreter.  This was
-  due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
-  to unicode when it didn't make sense.  'u#' now requires a unicode string.
-
-- Py_UNICODE is unsigned.  It was always documented as unsigned, but
-  due to a bug had a signed value in previous versions.
-
-- Patch #837242: ``id()`` of any Python object always gives a positive
-  number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
-  ``PyLong_AsVoidPtr`` have been changed accordingly.  Note that it has
-  never been correct to implement a ``__hash()__`` method that returns the
-  ``id()`` of an object:
-
-      def __hash__(self):
-          return id(self)  # WRONG
-
-  because a hash result must be a (short) Python int but it was always
-  possible for ``id()`` to return a Python long.  However, because ``id()``
-  could return negative values before, on a 32-bit box an ``id()`` result
-  was always usable as a hash value before this patch.  That's no longer
-  necessarily so.
-
-- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
-  to load extension modules and now provides the dl module. As a result,
-  sys.setdlopenflags() now works correctly on these systems. (SF patch
-  #1454844)
-
-- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
-  involving generators that have paused outside of any ``try`` or ``with``
-  blocks.  (In 2.5a1, a paused generator that was part of a reference
-  cycle could not be garbage collected, regardless of whether it was
-  paused in a ``try`` or ``with`` block.)
-
-Extension Modules
------------------
-
-- Patch #1191065: Fix preprocessor problems on systems where recvfrom
-  is a macro.
-
-- Bug #1467952: os.listdir() now correctly raises an error if readdir()
-  fails with an error condition.
-
-- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
-
-- Bug #1117761: bsddb.*open() no longer raises an exception when using
-  the cachesize parameter.
-
-- Bug #1149413: bsddb.*open() no longer raises an exception when using
-  a temporary db (file=None) with the 'n' flag to truncate on open.
-
-- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
-  as older versions cause excessive test failures.
-
-- Patch #1062014: AF_UNIX sockets under Linux have a special
-  abstract namespace that is now fully supported.
-
-Library
--------
-
-- Bug #1223937: subprocess.CalledProcessError reports the exit status
-  of the process using the returncode attribute, instead of
-  abusing errno.
-
-- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
-  a doctest to be skipped (the code is not run, and the expected output
-  or exception is ignored).
-
-- Fixed contextlib.nested to cope with exceptions being raised and
-  caught inside exit handlers.
-
-- Updated optparse module to Optik 1.5.1 (allow numeric constants in
-  hex, octal, or binary; add ``append_const`` action; keep going if
-  gettext cannot be imported; added ``OptionParser.destroy()`` method;
-  added ``epilog`` for better help generation).
-
-- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
-  called from a thread spawned as a side effect of importing a module.
-
-- The pydoc module now supports documenting packages contained in
-  .zip or .egg files.
-
-- The pkgutil module now has several new utility functions, such
-  as ``walk_packages()`` to support working with packages that are either
-  in the filesystem or zip files.
-
-- The mailbox module can now modify and delete messages from
-  mailboxes, in addition to simply reading them.  Thanks to Gregory
-  K. Johnson for writing the code, and to the 2005 Google Summer of
-  Code for funding his work.
-
-- The ``__del__`` method of class ``local`` in module ``_threading_local``
-  returned before accomplishing any of its intended cleanup.
-
-- Patch #790710: Add breakpoint command lists in pdb.
-
-- Patch #1063914: Add Tkinter.Misc.clipboard_get().
-
-- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
-
-- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
-  Windows. Bug #1469163.
-
-- The warnings, linecache, inspect, traceback, site, and doctest modules
-  were updated to work correctly with modules imported from zipfiles or
-  via other PEP 302 __loader__ objects.
-
-- Patch #1467770: Reduce usage of subprocess._active to processes which
-  the application hasn't waited on.
-
-- Patch #1462222: Fix Tix.Grid.
-
-- Fix exception when doing glob.glob('anything*/')
-
-- The pstats.Stats class accepts an optional stream keyword argument to
-  direct output to an alternate file-like object.
-
-Build
------
-
-- The Makefile now has a reindent target, which runs reindent.py on
-  the library.
-
-- Patch #1470875: Building Python with MS Free Compiler
-
-- Patch #1161914: Add a python-config script.
-
-- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
-  --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
-  specified. (Can be overridden by explicitly setting LINKCC.) Decouple
-  CXX from --with-cxx-main, see description in README.
-
-- Patch #1429775: Link extension modules with the shared libpython.
-
-- Fixed a libffi build problem on MIPS systems.
-
-- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
-  now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
-  and "%zu" for unsigned integers of type ``size_t``.
-
-Tests
------
-
-- test_contextlib now checks contextlib.nested can cope with exceptions
-  being raised and caught inside exit handlers.
-
-- test_cmd_line now checks operation of the -m and -c command switches
-
-- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
-  it separately and by hand.  It also wasn't cleaning up its changes to
-  the current Decimal context.
-
-- regrtest.py now has a -M option to run tests that test the new limits of
-  containers, on 64-bit architectures. Running these tests is only sensible
-  on 64-bit machines with more than two gigabytes of memory. The argument
-  passed is the maximum amount of memory for the tests to use.
-
-Tools
------
-
-- Added the Python benchmark suite pybench to the Tools/ directory;
-  contributed by Marc-Andre Lemburg.
-
-Documentation
--------------
-
-- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
-
-- PEP 343: Added Context Types section to the library reference
-  and attempted to bring other PEP 343 related documentation into
-  line with the implementation and/or python-dev discussions.
-
-- Bug #1337990: clarified that ``doctest`` does not support examples
-  requiring both expected output and an exception.
-
-
-What's New in Python 2.5 alpha 1?
-=================================
-
-*Release date: 05-APR-2006*
-
-Core and builtins
------------------
-
-- PEP 338: -m command line switch now delegates to runpy.run_module
-  allowing it to support modules in packages and zipfiles
-
-- On Windows, .DLL is not an accepted file name extension for
-  extension modules anymore; extensions are only found if they
-  end in .PYD.
-
-- Bug #1421664: sys.stderr.encoding is now set to the same value as
-  sys.stdout.encoding.
-
-- __import__ accepts keyword arguments.
-
-- Patch #1460496: round() now accepts keyword arguments.
-
-- Fixed bug #1459029 - unicode reprs were double-escaped.
-
-- Patch #1396919: The system scope threads are reenabled on FreeBSD
-  5.4 and later versions.
-
-- Bug #1115379: Compiling a Unicode string with an encoding declaration
-  now gives a SyntaxError.
-
-- Previously, Python code had no easy way to access the contents of a
-  cell object. Now, a ``cell_contents`` attribute has been added
-  (closes patch #1170323).
-
-- Patch #1123430: Python's small-object allocator now returns an arena to
-  the system ``free()`` when all memory within an arena becomes unused
-  again.  Prior to Python 2.5, arenas (256KB chunks of memory) were never
-  freed.  Some applications will see a drop in virtual memory size now,
-  especially long-running applications that, from time to time, temporarily
-  use a large number of small objects.  Note that when Python returns an
-  arena to the platform C's ``free()``, there's no guarantee that the
-  platform C library will in turn return that memory to the operating system.
-  The effect of the patch is to stop making that impossible, and in tests it
-  appears to be effective at least on Microsoft C and gcc-based systems.
-  Thanks to Evan Jones for hard work and patience.
-
-- Patch #1434038: property() now uses the getter's docstring if there is
-  no "doc" argument given. This makes it possible to legitimately use
-  property() as a decorator to produce a read-only property.
-
-- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
-  nb_index slot to the PyNumberMethods struct.  The slot is consulted instead
-  of requiring an int or long in slicing and a few other contexts, enabling
-  other objects (e.g. Numeric Python's integers) to be used as slice indices.
-
-- Fixed various bugs reported by Coverity's Prevent tool.
-
-- PEP 352, patch #1104669: Make exceptions new-style objects.  Introduced the
-  new exception base class, BaseException, which has a new message attribute.
-  KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
-  Raising a string exception now raises a DeprecationWarning.
-
-- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
-  explicitly relative, using 'from .module import name' to mean 'from the same
-  package as this module is in. Imports without dots still default to the
-  old relative-then-absolute, unless 'from __future__ import
-  absolute_import' is used.
-
-- Properly check if 'warnings' raises an exception (usually when a filter set
-  to "error" is triggered) when raising a warning for raising string
-  exceptions.
-
-- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
-  The name was removed from Include/code.h.
-
-- PEP 308: conditional expressions were added: (x if cond else y).
-
-- Patch 1433928:
-  - The copy module now "copies" function objects (as atomic objects).
-  - dict.__getitem__ now looks for a __missing__ hook before raising
-    KeyError.
-
-- PEP 343: with statement implemented. Needs ``from __future__ import
-  with_statement``. Use of 'with' as a variable will generate a warning.
-  Use of 'as' as a variable will also generate a warning (unless it's
-  part of an import statement).
-  The following objects have __context__ methods:
-  - The built-in file type.
-  - The thread.LockType type.
-  - The following types defined by the threading module:
-    Lock, RLock, Condition, Semaphore, BoundedSemaphore.
-  - The decimal.Context class.
-
-- Fix the encodings package codec search function to only search
-  inside its own package. Fixes problem reported in patch #1433198.
-
-  Note: Codec packages should implement and register their own
-  codec search function. PEP 100 has the details.
-
-- PEP 353: Using ``Py_ssize_t`` as the index type.
-
-- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
-  info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
-  now allow Python to make use of memory blocks exceeding 2**32 bytes for
-  some purposes on 64-bit boxes.  A ``PYMALLOC_DEBUG`` build was limited
-  to 4-byte allocations before.
-
-- Patch #1400181, fix unicode string formatting to not use the locale.
-  This is how string objects work.  u'%f' could use , instead of .
-  for the decimal point.  Now both strings and unicode always use periods.
-
-- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
-  configure would break checking curses.h.
-
-- Bug #959576: The pwd module is now builtin. This allows Python to be
-  built on UNIX platforms without $HOME set.
-
-- Bug #1072182, fix some potential problems if characters are signed.
-
-- Bug #889500, fix line number on SyntaxWarning for global declarations.
-
-- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
-
-- Support for converting hex strings to floats no longer works.
-  This was not portable.  float('0x3') now raises a ValueError.
-
-- Patch #1382163: Expose Subversion revision number to Python.  New C API
-  function Py_GetBuildNumber().  New attribute sys.subversion.  Build number
-  is now displayed in interactive prompt banner.
-
-- Implementation of PEP 341 - Unification of try/except and try/finally.
-  "except" clauses can now be written together with a "finally" clause in
-  one try statement instead of two nested ones.  Patch #1355913.
-
-- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
-  now encodes backslash correctly.
-
-- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
-
-- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
-  and long longs.
-
-- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
-  It was possible for dlerror() to return a NULL pointer, so
-  it will now use a default error message in this case.
-
-- Replaced most Unicode charmap codecs with new ones using the
-  new Unicode translate string feature in the builtin charmap
-  codec; the codecs were created from the mapping tables available
-  at ftp.unicode.org and contain a few updates (e.g. the Mac OS
-  encodings now include a mapping for the Apple logo)
-
-- Added a few more codecs for Mac OS encodings
-
-- Sped up some Unicode operations.
-
-- A new AST parser implementation was completed. The abstract
-  syntax tree is available for read-only (non-compile) access
-  to Python code; an _ast module was added.
-
-- SF bug #1167751: fix incorrect code being produced for generator expressions.
-  The following code now raises a SyntaxError:  foo(a = i for i in range(10))
-
-- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
-
-- SF Bug #887946: fix segfault when redirecting stdin from a directory.
-  Provide a warning when a directory is passed on the command line.
-
-- Fix segfault with invalid coding.
-
-- SF bug #772896: unknown encoding results in MemoryError.
-
-- All iterators now have a Boolean value of True.  Formerly, some iterators
-  supported a __len__() method which evaluated to False when the iterator
-  was empty.
-
-- On 64-bit platforms, when __len__() returns a value that cannot be
-  represented as a C int, raise OverflowError.
-
-- test__locale is skipped on OS X < 10.4 (only partial locale support is
-  present).
-
-- SF bug #893549: parsing keyword arguments was broken with a few format
-  codes.
-
-- Changes donated by Elemental Security to make it work on AIX 5.3
-  with IBM's 64-bit compiler (SF patch #1284289).  This also closes SF
-  bug #105470: test_pwd fails on 64bit system (Opteron).
-
-- Changes donated by Elemental Security to make it work on HP-UX 11 on
-  Itanium2 with HP's 64-bit compiler (SF patch #1225212).
-
-- Disallow keyword arguments for type constructors that don't use them
-  (fixes bug #1119418).
-
-- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
-
-- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
-  exceptions that cause a function to exit.
-
-- The implementation of set() and frozenset() was revised to use its
-  own internal data structure.  Memory consumption is reduced by 1/3
-  and there are modest speed-ups as well.  The API is unchanged.
-
-- SF bug #1238681:  freed pointer is used in longobject.c:long_pow().
-
-- SF bug #1229429: PyObject_CallMethod failed to decrement some
-  reference counts in some error exit cases.
-
-- SF bug #1185883:  Python's small-object memory allocator took over
-  a block managed by the platform C library whenever a realloc specified
-  a small new size.  However, there's no portable way to know then how
-  much of the address space following the pointer is valid, so there's no
-  portable way to copy data from the C-managed block into Python's
-  small-object space without risking a memory fault.  Python's small-object
-  realloc now leaves such blocks under the control of the platform C
-  realloc.
-
-- SF bug #1232517: An overflow error was not detected properly when
-  attempting to convert a large float to an int in os.utime().
-
-- SF bug #1224347: hex longs now print with lowercase letters just
-  like their int counterparts.
-
-- SF bug #1163563: the original fix for bug #1010677 ("thread Module
-  Breaks PyGILState_Ensure()") broke badly in the case of multiple
-  interpreter states; back out that fix and do a better job (see
-  http://mail.python.org/pipermail/python-dev/2005-June/054258.html
-  for a longer write-up of the problem).
-
-- SF patch #1180995: marshal now uses a binary format by default when
-  serializing floats.
-
-- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
-  the routines that promise to produce IEEE 754 binary representations
-  of floats now simply copy bytes around.
-
-- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
-  278.
-
-- patch #1109424: int, long, float, complex, and unicode now check for the
-  proper magic slot for type conversions when subclassed.  Previously the
-  magic slot was ignored during conversion.  Semantics now match the way
-  subclasses of str always behaved.  int/long/float, conversion of an instance
-  to the base class has been moved to the proper nb_* magic slot and out of
-  PyNumber_*().
-  Thanks Walter D�rwald.
-
-- Descriptors defined in C with a PyGetSetDef structure, where the setter is
-  NULL, now raise an AttributeError when attempting to set or delete the
-  attribute.  Previously a TypeError was raised, but this was inconsistent
-  with the equivalent pure-Python implementation.
-
-- It is now safe to call PyGILState_Release() before
-  PyEval_InitThreads() (note that if there is reason to believe there
-  are multiple threads around you still must call PyEval_InitThreads()
-  before using the Python API; this fix is for extension modules that
-  have no way of knowing if Python is multi-threaded yet).
-
-- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
-  disabled caused a crash.
-
-- Bug #1165306: instancemethod_new allowed the creation of a method
-  with im_class == im_self == NULL, which caused a crash when called.
-
-- Move exception finalisation later in the shutdown process - this
-  fixes the crash seen in bug #1165761
-
-- Added two new builtins, any() and all().
-
-- Defining a class with empty parentheses is now allowed
-  (e.g., ``class C(): pass`` is no longer a syntax error).
-  Patch #1176012 added support to the 'parser' module and 'compiler' package
-  (thanks to logistix for that added support).
-
-- Patch #1115086: Support PY_LONGLONG in structmember.
-
-- Bug #1155938: new style classes did not check that __init__() was
-  returning None.
-
-- Patch #802188: Report characters after line continuation character
-  ('\') with a specific error message.
-
-- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
-
-- Bug #1124295: the __name__ attribute of file objects was
-  inadvertently made inaccessible in restricted mode.
-
-- Bug #1074011: closing sys.std{out,err} now causes a flush() and
-  an ferror() call.
-
-- min() and max() now support key= arguments with the same meaning as in
-  list.sort().
-
-- The peephole optimizer now performs simple constant folding in expressions:
-      (2+3) --> (5).
-
-- set and frozenset objects can now be marshalled.  SF #1098985.
-
-- Bug #1077106: Poor argument checking could cause memory corruption
-  in calls to os.read().
-
-- The parser did not complain about future statements in illegal
-  positions.  It once again reports a syntax error if a future
-  statement occurs after anything other than a doc string.
-
-- Change the %s format specifier for str objects so that it returns a
-  unicode instance if the argument is not an instance of basestring and
-  calling __str__ on the argument returns a unicode instance.
-
-- Patch #1413181:  changed ``PyThreadState_Delete()`` to forget about the
-  current thread state when the auto-GIL-state machinery knows about
-  it (since the thread state is being deleted, continuing to remember it
-  can't help, but can hurt if another thread happens to get created with
-  the same thread id).
-
-Extension Modules
------------------
-
-- Patch #1380952: fix SSL objects timing out on consecutive read()s
-
-- Patch #1309579: wait3 and wait4 were added to the posix module.
-
-- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
-  In addition, the existing ulaw code was updated.
-
-- RFE #567972: Socket objects' family, type and proto properties are
-  now exposed via new attributes.
-
-- Everything under lib-old was removed.  This includes the following modules:
-    Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
-    lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
-    util, whatsound, whrandom, zmod
-
-- The following modules were removed:  regsub, reconvert, regex, regex_syntax.
-
-- re and sre were swapped, so help(re) provides full help.  importing sre
-  is deprecated.  The undocumented re.engine variable no longer exists.
-
-- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
-  SS2 (single-shift 2) escape sequences correctly.
-
-- The unicodedata module was updated to the 4.1 version of the Unicode
-  database. The 3.2 version is still available as unicodedata.db_3_2_0
-  for applications that require this specific version (such as IDNA).
-
-- The timing module is no longer built by default.  It was deprecated
-  in PEP 4 in Python 2.0 or earlier.
-
-- Patch 1433928: Added a new type, defaultdict, to the collections module.
-  This uses the new __missing__ hook behavior added to dict (see above).
-
-- Bug #854823: socketmodule now builds on Sun platforms even when
-  INET_ADDRSTRLEN is not defined.
-
-- Patch #1393157: os.startfile() now has an optional argument to specify
-  a "command verb" to invoke on the file.
-
-- Bug #876637, prevent stack corruption when socket descriptor
-  is larger than FD_SETSIZE.
-
-- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
-  mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
-  mmap.mmap(0, size) should not be used on Windows for anonymous memory.
-
-- Patch #1422385: The nis module now supports access to domains other
-  than the system default domain.
-
-- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
-  are reported, the limit on path name lengths is removed, and stat reports
-  WindowsError now (instead of OSError).
-
-- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
-
-- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
-  before the env.
-
-- Patch #1103116: Basic AF_NETLINK support.
-
-- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
-
-- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
-  Also fix ungetmouse() which did not accept arguments properly.
-  The code now conforms to the documented signature.
-
-- Bug #1400115, Fix segfault when calling curses.panel.userptr()
-  without prior setting of the userptr.
-
-- Fix 64-bit problems in bsddb.
-
-- Patch #1365916: fix some unsafe 64-bit mmap methods.
-
-- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
-  problem on AIX.
-
-- Bug #869197: os.setgroups rejects long integer arguments
-
-- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
-
-- Bug #1344508, Fix UNIX mmap leaking file descriptors
-
-- Patch #1338314, Bug #1336623: fix tarfile so it can extract
-  REGTYPE directories from tarfiles written by old programs.
-
-- Patch #1407992, fixes broken bsddb module db associate when using
-  BerkeleyDB 3.3, 4.0 or 4.1.
-
-- Get bsddb module to build with BerkeleyDB version 4.4
-
-- Get bsddb module to build with BerkeleyDB version 3.2
-
-- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
-  but Python incorrectly assumes it is in UTF-8 format
-
-- Fix parse errors in the readline module when compiling without threads.
-
-- Patch #1288833: Removed thread lock from socket.getaddrinfo on
-  FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
-
-- Patches #1298449 and #1298499: Add some missing checks for error
-  returns in cStringIO.c.
-
-- Patch #1297028: fix segfault if call type on MultibyteCodec,
-  MultibyteStreamReader, or MultibyteStreamWriter
-
-- Fix memory leak in posix.access().
-
-- Patch #1213831: Fix typo in unicodedata._getcode.
-
-- Bug #1007046: os.startfile() did not accept unicode strings encoded in
-  the file system encoding.
-
-- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
-  platforms that don't have inet_aton().
-
-- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
-
-- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
-  line without newlines.
-
-- Bug #728515: mmap.resize() now resizes the file on Unix as it did
-  on Windows.
-
-- Patch #1180695: Add nanosecond stat resolution, and st_gen,
-  st_birthtime for FreeBSD.
-
-- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
-  the request code argument, which results in more C-like behaviour
-  for large or negative values.
-
-- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
-  implementation treated all integer values except 1 as false.
-
-- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
-
-- Patch #1212117: os.stat().st_flags is now accessible as a attribute
-  if available on the platform.
-
-- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
-  available on the platform.
-
-- Bug #1166660: The readline module could segfault if hook functions
-  were set in a different thread than that which called readline.
-
-- collections.deque objects now support a remove() method.
-
-- operator.itemgetter() and operator.attrgetter() now support retrieving
-  multiple fields.  This provides direct support for sorting on multiple
-  keys (primary, secondary, etc).
-
-- os.access now supports Unicode path names on non-Win32 systems.
-
-- Patches #925152, #1118602: Avoid reading after the end of the buffer
-  in pyexpat.GetInputContext.
-
-- Patches #749830, #1144555: allow UNIX mmap size to default to current
-  file size.
-
-- Added functional.partial().  See PEP309.
-
-- Patch #1093585: raise a ValueError for negative history items in readline.
-  {remove_history,replace_history}
-
-- The spwd module has been added, allowing access to the shadow password
-  database.
-
-- stat_float_times is now True.
-
-- array.array objects are now picklable.
-
-- the cPickle module no longer accepts the deprecated None option in the
-  args tuple returned by __reduce__().
-
-- itertools.islice() now accepts None for the start and step arguments.
-  This allows islice() to work more readily with slices:
-      islice(s.start, s.stop, s.step)
-
-- datetime.datetime() now has a strptime class method which can be used to
-  create datetime object using a string and format.
-
-- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
-  with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
-
-Library
--------
-
-- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
-  been renamed to have only a single underscore prefix.  This was done to
-  make subclassing easier.
-
-- PEP 338: new module runpy defines a run_module function to support
-  executing modules which provide access to source code or a code object
-  via the PEP 302 import mechanisms.
-
-- The email module's parsedate_tz function now sets the daylight savings
-  flag to -1 (unknown) since it can't tell from the date whether it should
-  be set.
-
-- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
-  now sport attributes that provide access to the parts of the result.
-
-- Patch #1462498: sgmllib now handles entity and character references
-  in attribute values.
-
-- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
-  a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
-  later to build this - if you have an earlier version, the C extension
-  module will not be built.
-
-- Bug #1460340: ``random.sample(dict)`` failed in various ways.  Dicts
-  aren't officially supported here, and trying to use them will probably
-  raise an exception some day.  But dicts have been allowed, and "mostly
-  worked", so support for them won't go away without warning.
-
-- Bug #1445068: getpass.getpass() can now be given an explicit stream
-  argument to specify where to write the prompt.
-
-- Patch #1462313, bug #1443328: the pickle modules now can handle classes
-  that have __private names in their __slots__.
-
-- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
-
-- patch #1457316: "setup.py upload" now supports --identity to select the
-  key to be used for signing the uploaded code.
-
-- Queue.Queue objects now support .task_done() and .join() methods
-  to make it easier to monitor when daemon threads have completed
-  processing all enqueued tasks.  Patch #1455676.
-
-- popen2.Popen objects now preserve the command in a .cmd attribute.
-
-- Added the ctypes ffi package.
-
-- email 4.0 package now integrated.  This is largely the same as the email 3.0
-  package that was included in Python 2.3, except that PEP 8 module names are
-  now used (e.g. mail.message instead of email.Message).  The MIME classes
-  have been moved to a subpackage (e.g. email.mime.text instead of
-  email.MIMEText).  The old names are still supported for now.  Several
-  deprecated Message methods have been removed and lots of bugs have been
-  fixed.  More details can be found in the email package documentation.
-
-- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
-  (a subclass of tuple) that provides incremental decoders and encoders
-  (a way to use stateful codecs without the stream API). Python functions
-  codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
-  as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
-  have been added.
-
-- Patch #1359365: Calling next() on a closed StringIO.String object raises
-  a ValueError instead of a StopIteration now (like file and cString.String do).
-  cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
-  called before (like file and StringIO.StringIO do).
-
-- A regrtest option -w was added to re-run failed tests in verbose mode.
-
-- Patch #1446372: quit and exit can now be called from the interactive
-  interpreter to exit.
-
-- The function get_count() has been added to the gc module, and gc.collect()
-  grew an optional 'generation' argument.
-
-- A library msilib to generate Windows Installer files, and a distutils
-  command bdist_msi have been added.
-
-- PEP 343: new module contextlib.py defines decorator @contextmanager
-  and helpful context managers nested() and closing().
-
-- The compiler package now supports future imports after the module docstring.
-
-- Bug #1413790: zipfile now sanitizes absolute archive names that are
-  not allowed by the specs.
-
-- Patch #1215184: FileInput now can be given an opening hook which can
-  be used to control how files are opened.
-
-- Patch #1212287: fileinput.input() now has a mode parameter for
-  specifying the file mode input files should be opened with.
-
-- Patch #1215184: fileinput now has a fileno() function for getting the
-  current file number.
-
-- Patch #1349274: gettext.install() now optionally installs additional
-  translation functions other than _() in the builtin namespace.
-
-- Patch #1337756: fileinput now accepts Unicode filenames.
-
-- Patch #1373643: The chunk module can now read chunks larger than
-  two gigabytes.
-
-- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
-
-- Bug #1430298: It is now possible to send a mail with an empty
-  return address using smtplib.
-
-- Bug #1432260: The names of lambda functions are now properly displayed
-  in pydoc.
-
-- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
-  unless the system is Win32.
-
-- Patch #1349118: urllib now supports user:pass@ style proxy
-  specifications, raises IOErrors when proxies for unsupported protocols
-  are defined, and uses the https proxy on https redirections.
-
-- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
-
-- Bug #1407902: Add support for sftp:// URIs to urlparse.
-
-- Bug #1371247: Update Windows locale identifiers in locale.py.
-
-- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
-  any more.
-
-- Bug #1403410: The warnings module now doesn't get confused
-  when it can't find out the module name it generates a warning for.
-
-- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
-
-- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
-
-- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
-  LoadError as documented, instead of IOError.  For compatibility,
-  LoadError subclasses IOError.
-
-- Added the hashlib module.  It provides secure hash functions for MD5 and
-  SHA1, 224, 256, 384, and 512.  Note that recent developments make the
-  historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
-  In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
-  Ronald L. Rivest offered this advice for Python:
-
-      "The consensus of researchers in this area (at least as
-      expressed at the NIST Hash Function Workshop 10/31/05),
-      is that SHA-256 is a good choice for the time being, but
-      that research should continue, and other alternatives may
-      arise from this research.  The larger SHA's also seem OK."
-
-- Added a subset of Fredrik Lundh's ElementTree package.  Available
-  modules are xml.etree.ElementTree, xml.etree.ElementPath, and
-  xml.etree.ElementInclude, from ElementTree 1.2.6.
-
-- Patch #1162825: Support non-ASCII characters in IDLE window titles.
-
-- Bug #1365984: urllib now opens "data:" URLs again.
-
-- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
-  is raised within the method itself on a previous call (e.g., passing in an
-  illegal argument)
-
-- Bug #1340337: change time.strptime() to always return ValueError when there
-  is an error in the format string.
-
-- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
-
-- Bug #729103: pydoc.py: Fix docother() method to accept additional
-  "parent" argument.
-
-- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
-  for padding.
-
-- Bug #1296004: httplib.py: Limit maximal amount of data read from the
-  socket to avoid a MemoryError on Windows.
-
-- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
-  to get the correct encoding.
-
-- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
-  languages.
-
-- Patch #1268314: Cache lines in StreamReader.readlines for performance.
-
-- Bug #1290505: Fix clearing the regex cache for time.strptime().
-
-- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
-
-- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
-  functionality.
-
-- Bug #1163178: Make IDNA return an empty string when the input is empty.
-
-- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
-  separator and do not output trailing semicolon.
-
-- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
-  ContentTooShortException, when the actually downloaded size does not
-  match the Content-Length header.
-
-- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
-
-- Bug #1178484: Return complete lines from codec stream readers
-  even if there is an exception in later lines, resulting in
-  correct line numbers for decoding errors in source code.
-
-- Bug #1192315: Disallow negative arguments to clear() in pdb.
-
-- Patch #827386: Support absolute source paths in msvccompiler.py.
-
-- Patch #1105730: Apply the new implementation of commonprefix in posixpath
-  to ntpath, macpath, os2emxpath and riscospath.
-
-- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
-  __hasattr__ and __delattr__ methods on class Tk that were breaking
-  Tkdnd.
-
-- Bug #1015140: disambiguated the term "article id" in nntplib docs and
-  docstrings to either "article number" or "message id".
-
-- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
-  parameter, but uses the usual "kwargs=None".
-
-- textwrap now processes text chunks at O(n) speed instead of O(n**2).
-  Patch #1209527 (Contributed by Connelly).
-
-- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
-  to W3C name (404 -> 'Not Found'). RFE #1216944.
-
-- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
-  as this can cause problems with apps closing all file descriptors.
-
-- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
-  it can be missing in embedded interpreters
-
-- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
-
-- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
-  error messages.
-
-- Bug #1108948: Cookie.py produced invalid JavaScript code.
-
-- The tokenize module now detects and reports indentation errors.
-  Bug #1224621.
-
-- The tokenize module has a new untokenize() function to support a full
-  roundtrip from lexed tokens back to Python source code.  In addition,
-  the generate_tokens() function now accepts a callable argument that
-  terminates by raising StopIteration.
-
-- Bug #1196315: fix weakref.WeakValueDictionary constructor.
-
-- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
-  component of the path.
-
-- Patch #1120353: The xmlrpclib module provides better, more transparent,
-  support for datetime.{datetime,date,time} objects.  With use_datetime set
-  to True, applications shouldn't have to fiddle with the DateTime wrapper
-  class at all.
-
-- distutils.commands.upload was added to support uploading distribution
-  files to PyPI.
-
-- distutils.commands.register now encodes the data as UTF-8 before posting
-  them to PyPI.
-
-- decimal operator and comparison methods now return NotImplemented
-  instead of raising a TypeError when interacting with other types.  This
-  allows other classes to implement __radd__ style methods and have them
-  work as expected.
-
-- Bug #1163325:  Decimal infinities failed to hash.  Attempting to
-  hash a NaN raised an InvalidOperation instead of a TypeError.
-
-- Patch #918101: Add tarfile open mode r|* for auto-detection of the
-  stream compression; add, for symmetry reasons, r:* as a synonym of r.
-
-- Patch #1043890: Add extractall method to tarfile.
-
-- Patch #1075887: Don't require MSVC in distutils if there is nothing
-  to build.
-
-- Patch #1103407: Properly deal with tarfile iterators when untarring
-  symbolic links on Windows.
-
-- Patch #645894: Use getrusage for computing the time consumption in
-  profile.py if available.
-
-- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
-
-- Patch #1117454: Remove code to special-case cookies without values
-  in LWPCookieJar.
-
-- Patch #1117339: Add cookielib special name tests.
-
-- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
-
-- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
-
-- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
-
-- Patch #1104111: Alter setup.py --help and --help-commands.
-
-- Patch #1121234: Properly cleanup _exit and tkerror commands.
-
-- Patch #1049151: xdrlib now unpacks booleans as True or False.
-
-- Fixed bug in a NameError bug in cookielib.  Patch #1116583.
-
-- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001).  This
-  disables recursive traversal through instance attributes, which can
-  be exploited in various ways.
-
-- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
-  flags on the HTTP listening socket.
-
-- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
-  Fixed by reading the HTTP body in chunks instead of one big socket.read().
-
-- Patches #893642, #1039083: add allow_none, encoding arguments to
-  constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
-
-- Bug #1110478: Revert os.environ.update to do putenv again.
-
-- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
-
-- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
-
-- Enhancements to the csv module:
-
-  + Dialects are now validated by the underlying C code, better
-    reflecting its capabilities, and improving its compliance with
-    PEP 305.
-  + Dialect parameter parsing has been re-implemented to improve error
-    reporting.
-  + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
-    dictates.
-  + the parser now removes the escapechar prefix from escaped characters.
-  + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
-    types, rather than any object that can be represented as a numeric.
-  + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
-    to floats.
-  + reader now allows \r characters to be quoted (previously it only allowed
-    \n to be quoted).
-  + writer doublequote handling improved.
-  + Dialect classes passed to the module are no longer instantiated by
-    the module before being parsed (the former validation scheme required
-    this, but the mechanism was unreliable).
-  + The dialect registry now contains instances of the internal
-    C-coded dialect type, rather than references to python objects.
-  + the internal c-coded dialect type is now immutable.
-  + register_dialect now accepts the same keyword dialect specifications
-    as the reader and writer, allowing the user to register dialects
-    without first creating a dialect class.
-  + a configurable limit to the size of parsed fields has been added -
-    previously, an unmatched quote character could result in the entire
-    file being read into the field buffer before an error was reported.
-  + A new module method csv.field_size_limit() has been added that sets
-    the parser field size limit (returning the former limit). The initial
-    limit is 128kB.
-  + A line_num attribute has been added to the reader object, which tracks
-    the number of lines read from the source iterator. This is not
-    the same as the number of records returned, as records can span
-    multiple lines.
-  + reader and writer objects were not being registered with the cyclic-GC.
-    This has been fixed.
-
-- _DummyThread objects in the threading module now delete self.__block that is
-  inherited from _Thread since it uses up a lock allocated by 'thread'.  The
-  lock primitives tend to be limited in number and thus should not be wasted on
-  a _DummyThread object.  Fixes bug #1089632.
-
-- The imghdr module now detects Exif files.
-
-- StringIO.truncate() now correctly adjusts the size attribute.
-  (Bug #951915).
-
-- locale.py now uses an updated locale alias table (built using
-  Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
-  alias file); the encoding lookup was enhanced to use Python's
-  encoding alias table.
-
-- moved deprecated modules to Lib/lib-old:  whrandom, tzparse, statcache.
-
-- the pickle module no longer accepts the deprecated None option in the
-  args tuple returned by __reduce__().
-
-- optparse now optionally imports gettext.  This allows its use in setup.py.
-
-- the pickle module no longer uses the deprecated bin parameter.
-
-- the shelve module no longer uses the deprecated binary parameter.
-
-- the pstats module no longer uses the deprecated ignore() method.
-
-- the filecmp module no longer uses the deprecated use_statcache argument.
-
-- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
-  extended or overridden by subclasses.  Formerly, the subclassed method would
-  be ignored by the rest of the module.  (Bug #1078905).
-
-- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
-  the same meaning as in list.sort().
-
-- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
-  once when a size argument is given. This prevents a buffer overflow in the
-  tokenizer with very long source lines.
-
-- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
-  immediately after creating the object, without any intervening
-  ``.decompress()`` calls.
-
-- The reconvert.quote function can now emit triple-quoted strings.  The
-  reconvert module now has some simple documentation.
-
-- ``UserString.MutableString`` now supports negative indices in
-  ``__setitem__`` and ``__delitem__``
-
-- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
-  correctly.
-
-- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
-  ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
-  character even if the user has passed a size parameter to get a proper
-  line ending. Remove the special handling of a "\r\n" that has been split
-  between two lines.
-
-- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
-  about illegal code points. The codec now supports PEP 293 style error
-  handlers.
-
-- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
-  from the input stream, so that the output is a byte string in the correct
-  encoding instead of a unicode string.
-
-- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
-  considering it exactly like a '*'.
-
-- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
-  ``encodings.aliases``.
-
-- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
-
-- Patch #1413711: Certain patterns of differences were making difflib
-  touch the recursion limit.
-
-- Bug #947906: An object oriented interface has been added to the calendar
-  module. It's possible to generate HTML calendar now and the module can be
-  called as a script (e.g. via ``python -mcalendar``). Localized month and
-  weekday names can be ouput (even if an exotic encoding is used) using
-  special classes that use unicode.
-
-Build
------
-
-- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
-  by using -mieee gcc option.
-
-- Patch #1432345: Make python compile on DragonFly.
-
-- Build support for Win64-AMD64 was added.
-
-- Patch #1428494: Prefer linking against ncursesw over ncurses library.
-
-- Patch #881820: look for openpty and forkpty also in libbsd.
-
-- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
-  The zlib module is now builtin on Windows.
-
-- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
-
-- Bug #1189330: configure did not correctly determine the necessary
-  value of LINKCC if python was built with GCC 4.0.
-
-- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
-  vulnerability in zlib 1.2.1 and 1.2.2.
-
-- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
-  flags that change binary compatibility.  Changes were also made to
-  distutils.sysconfig to also use the environment variable when used during
-  compilation of the interpreter and of C extensions through distutils.
-
-- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
-  and linking has changed (prebinding is now deprecated, and libcc_dynamic
-  no longer exists). This configure patch makes things right.
-
-- Bug #1158607: Build with --disable-unicode again.
-
-- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
-  defined.  Discovered as a result of not being able to build on OS X.
-
-- setup.py now uses the directories specified in LDFLAGS using the -L option
-  and in CPPFLAGS using the -I option for adding library and include
-  directories, respectively, for compiling extension modules against.  This has
-  led to the core being compiled using the values in CPPFLAGS.  It also removes
-  the need for the special-casing of both DarwinPorts and Fink for darwin since
-  the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
-  ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
-  Fink, ``-I/opt/local/include`` for DarwinPorts).
-
-- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
-  to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
-  Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
-  Closes bug #1096244.  Thanks Gregory Bond.
-
-C API
------
-
-- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
-  ``PyObject_{Free, FREE}``.  They map to the system ``free()`` now.  If memory
-  is obtained via the ``PyObject_`` family, it must be released via the
-  ``PyObject_`` family, and likewise for the ``PyMem_`` family.  This has
-  always been officially true, but when Python's small-object allocator was
-  introduced, an attempt was made to cater to a few extension modules
-  discovered at the time that obtained memory via ``PyObject_New`` but
-  released it via ``PyMem_DEL``.  It's years later, and if such code still
-  exists it will fail now (probably with segfaults, but calling wrong
-  low-level memory management functions can yield many symptoms).
-
-- Added a C API for set and frozenset objects.
-
-- Removed PyRange_New().
-
-- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
-  mapping argument now. This string is used as a mapping table. Byte values
-  greater than the length of the string and 0xFFFE are treated as undefined
-  mappings.
-
-
-Tests
------
-
-- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
-
-- Patch #1276356: New resource "urlfetch" is implemented.  This enables
-  even impatient people to run tests that require remote files.
-
-
-Documentation
--------------
-
-- Bug #1402224: Add warning to dl docs about crashes.
-
-- Bug #1396471: Document that Windows' ftell() can return invalid
-  values for text files with UNIX-style line endings.
-
-- Bug #1274828: Document os.path.splitunc().
-
-- Bug #1190204: Clarify which directories are searched by site.py.
-
-- Bug #1193849: Clarify os.path.expanduser() documentation.
-
-- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
-
-- Bug #755617: Document the effects of os.chown() on Windows.
-
-- Patch #1180012: The documentation for modulefinder is now in the library reference.
-
-- Patch #1213031: Document that os.chown() accepts argument values of -1.
-
-- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
-
-- Bug #1175022: Correct the example code for property().
-
-- Document the IterableUserDict class in the UserDict module.
-  Closes bug #1166582.
-
-- Remove all latent references for "Macintosh" that referred to semantics for
-  Mac OS 9 and change to reflect the state for OS X.
-  Closes patch #1095802.  Thanks Jack Jansen.
-
-Mac
----
-
-
-New platforms
--------------
-
-- FreeBSD 7 support is added.
-
-
-Tools/Demos
------------
-
-- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
-  directory for syntax highlighting in Vim.  Vim directory was added and placed
-  vimrc to it (was previous up a level).
-
-- Added two new files to Tools/scripts: pysource.py, which recursively
-  finds Python source files, and findnocoding.py, which finds Python
-  source files that need an encoding declaration.
-  Patch #784089, credits to Oleg Broytmann.
-
-- Bug #1072853: pindent.py used an uninitialized variable.
-
-- Patch #1177597: Correct Complex.__init__.
-
-- Fixed a display glitch in Pynche, which could cause the right arrow to
-  wiggle over by a pixel.
-
 ----
 
 **(For information about older versions, consult the HISTORY file.)**

Modified: python/branches/trunk-math/Misc/cheatsheet
==============================================================================
--- python/branches/trunk-math/Misc/cheatsheet	(original)
+++ python/branches/trunk-math/Misc/cheatsheet	Thu Feb 28 21:09:17 2008
@@ -565,8 +565,8 @@
 i          Signed integer decimal.
 o          Unsigned octal.
 u          Unsigned decimal.
-x          Unsigned hexidecimal (lowercase).
-X          Unsigned hexidecimal (uppercase).
+x          Unsigned hexadecimal (lowercase).
+X          Unsigned hexadecimal (uppercase).
 e          Floating point exponential format (lowercase).
 E          Floating point exponential format (uppercase).
 f          Floating point decimal format.

Modified: python/branches/trunk-math/Modules/_ctypes/_ctypes_test.c
==============================================================================
--- python/branches/trunk-math/Modules/_ctypes/_ctypes_test.c	(original)
+++ python/branches/trunk-math/Modules/_ctypes/_ctypes_test.c	Thu Feb 28 21:09:17 2008
@@ -411,7 +411,7 @@
 	return 0;
 }
 
-PyMethodDef module_methods[] = {
+static PyMethodDef module_methods[] = {
 /*	{"get_last_tf_arg_s", get_last_tf_arg_s, METH_NOARGS},
 	{"get_last_tf_arg_u", get_last_tf_arg_u, METH_NOARGS},
 */

Modified: python/branches/trunk-math/Modules/_ctypes/libffi/configure
==============================================================================
--- python/branches/trunk-math/Modules/_ctypes/libffi/configure	(original)
+++ python/branches/trunk-math/Modules/_ctypes/libffi/configure	Thu Feb 28 21:09:17 2008
@@ -1,27 +1,56 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for libffi 2.1.
+# Generated by GNU Autoconf 2.61 for libffi 2.1.
 #
 # Report bugs to <http://gcc.gnu.org/bugs.html>.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -31,8 +60,43 @@
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -46,18 +110,19 @@
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -65,157 +130,388 @@
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
 fi
 
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
+  case $as_dir in
 	 /*)
-	   if ("$as_dir/$as_base" -c '
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf at gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+  chmod +x "$as_me.lineno" ||
     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -224,7 +520,28 @@
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -233,39 +550,27 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
 
+exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME='libffi'
 PACKAGE_TARNAME='libffi'
@@ -276,42 +581,112 @@
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC ac_ct_CC EXEEXT OBJEXT CFLAGS CPP CPPFLAGS EGREP ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR MKTARGET LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+CPP
+GREP
+EGREP
+ALLOCA
+HAVE_LONG_DOUBLE
+TARGET
+TARGETDIR
+MKTARGET
+LIBOBJS
+LTLIBOBJS'
 ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CPP
+CPPFLAGS'
+
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -338,34 +713,48 @@
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -387,33 +776,45 @@
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -440,6 +841,12 @@
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -464,13 +871,16 @@
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -535,6 +945,16 @@
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -587,24 +1007,20 @@
   -with-* | --with-*)
     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -635,8 +1051,7 @@
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
@@ -656,27 +1071,19 @@
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
   case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -703,64 +1110,78 @@
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$0" : 'X\(//\)[^/]' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-  fi
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-
-#
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
 # Report the --help message.
 #
 if test "$ac_init_help" = "long"; then
@@ -787,9 +1208,6 @@
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
 			  [$ac_default_prefix]
@@ -807,15 +1225,22 @@
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/libffi]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -838,8 +1263,9 @@
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
 
 Use these variables to override the choices made by `configure' or to help
@@ -847,120 +1273,86 @@
 
 Report bugs to <http://gcc.gnu.org/bugs.html>.
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd "$ac_popdir"
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 libffi configure 2.1
-generated by GNU Autoconf 2.59
+generated by GNU Autoconf 2.61
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by libffi $as_me 2.1, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -979,7 +1371,7 @@
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -993,6 +1385,7 @@
   test -z "$as_dir" && as_dir=.
   echo "PATH: $as_dir"
 done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1014,7 +1407,6 @@
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1025,7 +1417,7 @@
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    *\'*)
       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
@@ -1047,9 +1439,7 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
@@ -1060,8 +1450,8 @@
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
@@ -1074,20 +1464,34 @@
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
     cat <<\_ASBOX
@@ -1098,22 +1502,28 @@
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1125,26 +1535,24 @@
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1175,14 +1583,17 @@
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
   if test -r "$ac_site_file"; then
     { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1198,8 +1609,8 @@
     { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
@@ -1211,12 +1622,11 @@
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
       { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1241,8 +1651,7 @@
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1259,12 +1668,6 @@
    { (exit 1); exit 1; }; }
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
 
 
 
@@ -1289,110 +1692,165 @@
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-          ac_config_headers="$ac_config_headers fficonfig.h"
+ac_config_headers="$ac_config_headers fficonfig.h"
 
 
 ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
 
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
 if test "${ac_cv_target+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
-  ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
 
 
 # The aliases save the names the user supplied, while $host etc.
@@ -1413,8 +1871,8 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1427,32 +1885,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1465,36 +1925,51 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1507,74 +1982,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
 
+  fi
 fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1588,7 +2023,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -1599,6 +2034,7 @@
   fi
 done
 done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -1616,22 +2052,23 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1644,36 +2081,38 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1686,29 +2125,45 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
@@ -1721,21 +2176,35 @@
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -1760,47 +2229,77 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-	;;
-    conftest.$ac_ext )
-	# This is the source file.
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
@@ -1812,19 +2311,21 @@
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
 
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -1843,22 +2344,27 @@
     fi
   fi
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
@@ -1869,9 +2375,8 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
@@ -1885,14 +2390,14 @@
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1912,14 +2417,20 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -1937,12 +2448,12 @@
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1965,49 +2476,49 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2023,37 +2534,118 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2069,12 +2661,12 @@
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2108,12 +2700,17 @@
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2128,201 +2725,57 @@
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2339,8 +2792,8 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2374,24 +2827,22 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -2400,9 +2851,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2412,24 +2864,22 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -2440,6 +2890,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -2457,8 +2908,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -2481,24 +2932,22 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -2507,9 +2956,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2519,24 +2969,22 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -2547,6 +2995,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -2569,23 +3018,170 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2609,34 +3205,31 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+	ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -2692,6 +3285,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -2711,18 +3305,27 @@
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -2735,12 +3338,14 @@
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -2763,9 +3368,9 @@
 		  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -2779,37 +3384,35 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+	eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -2824,18 +3427,19 @@
 for ac_header in sys/mman.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -2846,40 +3450,37 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -2888,24 +3489,22 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -2913,9 +3512,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -2939,25 +3539,24 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------- ##
 ## Report this to http://gcc.gnu.org/bugs.html ##
 ## ------------------------------------------- ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -2973,9 +3572,9 @@
 for ac_func in mmap
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -3001,67 +3600,60 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -3072,17 +3664,17 @@
 
 
 if test "${ac_cv_header_sys_mman_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for sys/mman.h" >&5
-echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for sys/mman.h" >&5
+echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_mman_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking sys/mman.h usability" >&5
-echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking sys/mman.h usability" >&5
+echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3093,40 +3685,37 @@
 #include <sys/mman.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking sys/mman.h presence" >&5
-echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking sys/mman.h presence" >&5
+echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3135,24 +3724,22 @@
 /* end confdefs.h.  */
 #include <sys/mman.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -3160,9 +3747,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -3186,25 +3774,23 @@
 echo "$as_me: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
+    ( cat <<\_ASBOX
 ## ------------------------------------------- ##
 ## Report this to http://gcc.gnu.org/bugs.html ##
 ## ------------------------------------------- ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for sys/mman.h" >&5
-echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for sys/mman.h" >&5
+echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_mman_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_sys_mman_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; }
 
 fi
 if test $ac_cv_header_sys_mman_h = yes; then
@@ -3214,8 +3800,8 @@
 fi
 
 
-echo "$as_me:$LINENO: checking for mmap" >&5
-echo $ECHO_N "checking for mmap... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for mmap" >&5
+echo $ECHO_N "checking for mmap... $ECHO_C" >&6; }
 if test "${ac_cv_func_mmap+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3242,67 +3828,59 @@
 
 #undef mmap
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char mmap ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_mmap) || defined (__stub___mmap)
+#if defined __stub_mmap || defined __stub___mmap
 choke me
-#else
-char (*f) () = mmap;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != mmap;
+return mmap ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_mmap=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_mmap=no
+	ac_cv_func_mmap=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5
-echo "${ECHO_T}$ac_cv_func_mmap" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5
+echo "${ECHO_T}$ac_cv_func_mmap" >&6; }
 if test $ac_cv_func_mmap = yes; then
   libffi_func_mmap=yes
 else
@@ -3315,8 +3893,8 @@
    ac_cv_func_mmap_dev_zero=no
    ac_cv_func_mmap_anon=no
 else
-   echo "$as_me:$LINENO: checking whether read-only mmap of a plain file works" >&5
-echo $ECHO_N "checking whether read-only mmap of a plain file works... $ECHO_C" >&6
+   { echo "$as_me:$LINENO: checking whether read-only mmap of a plain file works" >&5
+echo $ECHO_N "checking whether read-only mmap of a plain file works... $ECHO_C" >&6; }
 if test "${ac_cv_func_mmap_file+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3332,10 +3910,10 @@
 	ac_cv_func_mmap_file=yes;;
    esac
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_file" >&6
-   echo "$as_me:$LINENO: checking whether mmap from /dev/zero works" >&5
-echo $ECHO_N "checking whether mmap from /dev/zero works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_file" >&6; }
+   { echo "$as_me:$LINENO: checking whether mmap from /dev/zero works" >&5
+echo $ECHO_N "checking whether mmap from /dev/zero works... $ECHO_C" >&6; }
 if test "${ac_cv_func_mmap_dev_zero+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3356,12 +3934,12 @@
 	ac_cv_func_mmap_dev_zero=yes;;
    esac
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_dev_zero" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_dev_zero" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_dev_zero" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_dev_zero" >&6; }
 
    # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
-   echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5
-echo $ECHO_N "checking for MAP_ANON(YMOUS)... $ECHO_C" >&6
+   { echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5
+echo $ECHO_N "checking for MAP_ANON(YMOUS)... $ECHO_C" >&6; }
 if test "${ac_cv_decl_map_anon+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3388,43 +3966,40 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_decl_map_anon=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_decl_map_anon=no
+	ac_cv_decl_map_anon=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_decl_map_anon" >&5
-echo "${ECHO_T}$ac_cv_decl_map_anon" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_decl_map_anon" >&5
+echo "${ECHO_T}$ac_cv_decl_map_anon" >&6; }
 
    if test $ac_cv_decl_map_anon = no; then
      ac_cv_func_mmap_anon=no
    else
-     echo "$as_me:$LINENO: checking whether mmap with MAP_ANON(YMOUS) works" >&5
-echo $ECHO_N "checking whether mmap with MAP_ANON(YMOUS) works... $ECHO_C" >&6
+     { echo "$as_me:$LINENO: checking whether mmap with MAP_ANON(YMOUS) works" >&5
+echo $ECHO_N "checking whether mmap with MAP_ANON(YMOUS) works... $ECHO_C" >&6; }
 if test "${ac_cv_func_mmap_anon+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3440,8 +4015,8 @@
 	ac_cv_func_mmap_anon=yes;;
    esac
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_anon" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_anon" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_anon" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_anon" >&6; }
    fi
 fi
 
@@ -3536,8 +4111,8 @@
   *) ;;
 esac
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3561,34 +4136,31 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+	ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -3644,6 +4216,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -3663,18 +4236,27 @@
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3687,12 +4269,14 @@
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -3705,9 +4289,9 @@
 for ac_func in memcpy
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -3733,67 +4317,60 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -3804,8 +4381,8 @@
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
 if test "${ac_cv_working_alloca_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3820,43 +4397,42 @@
 main ()
 {
 char *p = (char *) alloca (2 * sizeof (int));
+			  if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_working_alloca_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_working_alloca_h=no
+	ac_cv_working_alloca_h=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
 if test $ac_cv_working_alloca_h = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -3865,8 +4441,8 @@
 
 fi
 
-echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
 if test "${ac_cv_func_alloca_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3883,7 +4459,7 @@
 #  include <malloc.h>
 #  define alloca _alloca
 # else
-#  if HAVE_ALLOCA_H
+#  ifdef HAVE_ALLOCA_H
 #   include <alloca.h>
 #  else
 #   ifdef _AIX
@@ -3901,43 +4477,42 @@
 main ()
 {
 char *p = (char *) alloca (1);
+				    if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_alloca_works=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_alloca_works=no
+	ac_cv_func_alloca_works=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
 
 if test $ac_cv_func_alloca_works = yes; then
 
@@ -3951,15 +4526,15 @@
 # contain a buggy version.  If you still want to use their alloca,
 # use ar to extract alloca.o from them instead of compiling alloca.c.
 
-ALLOCA=alloca.$ac_objext
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
 cat >>confdefs.h <<\_ACEOF
 #define C_ALLOCA 1
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
 if test "${ac_cv_os_cray+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3969,7 +4544,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if defined(CRAY) && ! defined(CRAY2)
+#if defined CRAY && ! defined CRAY2
 webecray
 #else
 wenotbecray
@@ -3985,14 +4560,14 @@
 rm -f conftest*
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6; }
 if test $ac_cv_os_cray = yes; then
   for ac_func in _getb67 GETB67 getb67; do
     as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4018,67 +4593,60 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -4091,8 +4659,8 @@
   done
 fi
 
-echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
 if test "${ac_cv_c_stack_direction+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4105,6 +4673,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
 int
 find_stack_direction ()
 {
@@ -4122,17 +4691,26 @@
 int
 main ()
 {
-  exit (find_stack_direction () < 0);
+  return find_stack_direction () < 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4145,11 +4723,13 @@
 ( exit $ac_status )
 ac_cv_c_stack_direction=-1
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define STACK_DIRECTION $ac_cv_c_stack_direction
@@ -4159,8 +4739,8 @@
 fi
 
 
-echo "$as_me:$LINENO: checking for double" >&5
-echo $ECHO_N "checking for double... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for double" >&5
+echo $ECHO_N "checking for double... $ECHO_C" >&6; }
 if test "${ac_cv_type_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4171,60 +4751,57 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+typedef double ac__type_new_;
 int
 main ()
 {
-if ((double *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (double))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_double=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_double=no
+	ac_cv_type_double=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
-echo "${ECHO_T}$ac_cv_type_double" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
+echo "${ECHO_T}$ac_cv_type_double" >&6; }
 
-echo "$as_me:$LINENO: checking size of double" >&5
-echo $ECHO_N "checking size of double... $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of double" >&5
+echo $ECHO_N "checking size of double... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_double" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -4234,10 +4811,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (double))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -4245,26 +4823,22 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -4274,10 +4848,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (double))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -4285,55 +4860,53 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (double))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -4341,26 +4914,22 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -4370,10 +4939,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (double))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -4381,49 +4951,48 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -4434,10 +5003,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (double))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -4445,49 +5015,45 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_double=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double), 77
+'') if test "$ac_cv_type_double" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double), 77
+echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_double=0
+   fi ;;
 esac
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
-   { (exit 1); exit 1; }; }
-else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4495,8 +5061,9 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-long longval () { return (long) (sizeof (double)); }
-unsigned long ulongval () { return (long) (sizeof (double)); }
+   typedef double ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -4505,35 +5072,44 @@
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (double))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (double))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (double))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4544,29 +5120,32 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (double), 77
+if test "$ac_cv_type_double" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double), 77
+echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_double=0
+   fi
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
-else
-  ac_cv_sizeof_double=0
-fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_double" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
+echo "${ECHO_T}$ac_cv_sizeof_double" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_DOUBLE $ac_cv_sizeof_double
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for long double" >&5
-echo $ECHO_N "checking for long double... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for long double" >&5
+echo $ECHO_N "checking for long double... $ECHO_C" >&6; }
 if test "${ac_cv_type_long_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4577,60 +5156,57 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+typedef long double ac__type_new_;
 int
 main ()
 {
-if ((long double *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (long double))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_long_double=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long_double=no
+	ac_cv_type_long_double=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
-echo "${ECHO_T}$ac_cv_type_long_double" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
+echo "${ECHO_T}$ac_cv_type_long_double" >&6; }
 
-echo "$as_me:$LINENO: checking size of long double" >&5
-echo $ECHO_N "checking size of long double... $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long double" >&5
+echo $ECHO_N "checking size of long double... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_long_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long_double" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -4640,10 +5216,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long double))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -4651,26 +5228,22 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -4680,10 +5253,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long double))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -4691,55 +5265,53 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long double))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -4747,26 +5319,22 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -4776,10 +5344,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long double))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -4787,49 +5356,48 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -4840,10 +5408,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long double))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -4851,49 +5420,45 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_long_double=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double), 77
+'') if test "$ac_cv_type_long_double" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double), 77
+echo "$as_me: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_double=0
+   fi ;;
 esac
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
-   { (exit 1); exit 1; }; }
-else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4901,8 +5466,9 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-long longval () { return (long) (sizeof (long double)); }
-unsigned long ulongval () { return (long) (sizeof (long double)); }
+   typedef long double ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -4911,35 +5477,44 @@
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (long double))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (long double))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long double))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4950,22 +5525,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long double), 77
+if test "$ac_cv_type_long_double" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double), 77
+echo "$as_me: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_double=0
+   fi
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
-else
-  ac_cv_sizeof_long_double=0
-fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
 _ACEOF
@@ -4986,171 +5564,163 @@
 fi
 
 
-echo "$as_me:$LINENO: checking for _Bool support" >&5
-echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6
-have_c99_bool=no
+{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
 
 int
 main ()
 {
-_Bool x; x = (_Bool)0;
+#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+	&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+ bogus endian macros
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_C99_BOOL 1
-_ACEOF
-
-  have_c99_bool=yes
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $have_c99_bool" >&5
-echo "${ECHO_T}$have_c99_bool" >&6
-if test "$have_c99_bool" = yes ; then
-echo "$as_me:$LINENO: checking for _Bool" >&5
-echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
-if test "${ac_cv_type__Bool+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <sys/types.h>
+#include <sys/param.h>
+
 int
 main ()
 {
-if ((_Bool *) 0)
-  return 0;
-if (sizeof (_Bool))
-  return 0;
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type__Bool=yes
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type__Bool=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+	ac_cv_c_bigendian=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-echo "${ECHO_T}$ac_cv_type__Bool" >&6
 
-echo "$as_me:$LINENO: checking size of _Bool" >&5
-echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6
-if test "${ac_cv_sizeof__Bool+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  if test "$ac_cv_type__Bool" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (_Bool))) >= 0)];
-test_array [0] = 0
-
+ _ascii (); _ebcdic ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5160,652 +5730,200 @@
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (_Bool))) <= $ac_mid)];
-test_array [0] = 0
+
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long int l;
+    char c[sizeof (long int)];
+  } u;
+  u.l = 1;
+  return u.c[sizeof (long int) - 1] == 1;
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  ac_cv_c_bigendian=no
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+( exit $ac_status )
+ac_cv_c_bigendian=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
+case $ac_cv_c_bigendian in
+  yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
+
+
+
+
+if test x$TARGET = xSPARC; then
+    { echo "$as_me:$LINENO: checking assembler and linker support unaligned pc related relocs" >&5
+echo $ECHO_N "checking assembler and linker support unaligned pc related relocs... $ECHO_C" >&6; }
+if test "${libffi_cv_as_sparc_ua_pcrel+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	save_CFLAGS="$CFLAGS"
+	save_LDFLAGS="$LDFLAGS"
+	CFLAGS="$CFLAGS -fpic"
+	LDFLAGS="$LDFLAGS -shared"
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (_Bool))) < 0)];
-test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  libffi_cv_as_sparc_ua_pcrel=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	libffi_cv_as_sparc_ua_pcrel=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+	CFLAGS="$save_CFLAGS"
+	LDFLAGS="$save_LDFLAGS"
+fi
+{ echo "$as_me:$LINENO: result: $libffi_cv_as_sparc_ua_pcrel" >&5
+echo "${ECHO_T}$libffi_cv_as_sparc_ua_pcrel" >&6; }
+    if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_SPARC_UA_PCREL 1
+_ACEOF
+
+    fi
+
+    { echo "$as_me:$LINENO: checking assembler .register pseudo-op support" >&5
+echo $ECHO_N "checking assembler .register pseudo-op support... $ECHO_C" >&6; }
+if test "${libffi_cv_as_register_pseudo_op+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       libffi_cv_as_register_pseudo_op=unknown
+       # Check if we have .register
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+asm (".register %g2, #scratch");
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (_Bool))) >= $ac_mid)];
-test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  libffi_cv_as_register_pseudo_op=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	libffi_cv_as_register_pseudo_op=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (_Bool))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof__Bool=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (_Bool), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (_Bool)); }
-unsigned long ulongval () { return (long) (sizeof (_Bool)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (_Bool))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (_Bool))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (_Bool))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof__Bool=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (_Bool), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof__Bool=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5
-echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF__BOOL $ac_cv_sizeof__Bool
-_ACEOF
-
-
-fi
-
-echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
-if test "${ac_cv_c_bigendian+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
-
-int
-main ()
-{
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_c_bigendian=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-# It does not; compile a test program.
-if test "$cross_compiling" = yes; then
-  # try to guess the endianness by grepping values into an object file
-  ac_cv_c_bigendian=unknown
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-int
-main ()
-{
- _ascii (); _ebcdic ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
-  ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-  if test "$ac_cv_c_bigendian" = unknown; then
-    ac_cv_c_bigendian=no
-  else
-    # finding both strings is unlikely to happen, but who knows?
-    ac_cv_c_bigendian=unknown
-  fi
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-int
-main ()
-{
-  /* Are we little or big endian?  From Harbison&Steele.  */
-  union
-  {
-    long l;
-    char c[sizeof (long)];
-  } u;
-  u.l = 1;
-  exit (u.c[sizeof (long) - 1] == 1);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=no
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-case $ac_cv_c_bigendian in
-  yes)
-
-cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
-  no)
-     ;;
-  *)
-    { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-
-
-
-
-
-if test x$TARGET = xSPARC; then
-    echo "$as_me:$LINENO: checking assembler and linker support unaligned pc related relocs" >&5
-echo $ECHO_N "checking assembler and linker support unaligned pc related relocs... $ECHO_C" >&6
-if test "${libffi_cv_as_sparc_ua_pcrel+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-	save_CFLAGS="$CFLAGS"
-	save_LDFLAGS="$LDFLAGS"
-	CFLAGS="$CFLAGS -fpic"
-	LDFLAGS="$LDFLAGS -shared"
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  libffi_cv_as_sparc_ua_pcrel=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-libffi_cv_as_sparc_ua_pcrel=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-	CFLAGS="$save_CFLAGS"
-	LDFLAGS="$save_LDFLAGS"
-fi
-echo "$as_me:$LINENO: result: $libffi_cv_as_sparc_ua_pcrel" >&5
-echo "${ECHO_T}$libffi_cv_as_sparc_ua_pcrel" >&6
-    if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AS_SPARC_UA_PCREL 1
-_ACEOF
-
-    fi
-
-    echo "$as_me:$LINENO: checking assembler .register pseudo-op support" >&5
-echo $ECHO_N "checking assembler .register pseudo-op support... $ECHO_C" >&6
-if test "${libffi_cv_as_register_pseudo_op+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-       libffi_cv_as_register_pseudo_op=unknown
-       # Check if we have .register
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-asm (".register %g2, #scratch");
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  libffi_cv_as_register_pseudo_op=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-libffi_cv_as_register_pseudo_op=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $libffi_cv_as_register_pseudo_op" >&5
-echo "${ECHO_T}$libffi_cv_as_register_pseudo_op" >&6
+{ echo "$as_me:$LINENO: result: $libffi_cv_as_register_pseudo_op" >&5
+echo "${ECHO_T}$libffi_cv_as_register_pseudo_op" >&6; }
     if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5815,8 +5933,8 @@
     fi
 fi
 
-echo "$as_me:$LINENO: checking whether .eh_frame section should be read-only" >&5
-echo $ECHO_N "checking whether .eh_frame section should be read-only... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether .eh_frame section should be read-only" >&5
+echo $ECHO_N "checking whether .eh_frame section should be read-only... $ECHO_C" >&6; }
 if test "${libffi_cv_ro_eh_frame+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5834,8 +5952,8 @@
 	rm -f conftest.*
 
 fi
-echo "$as_me:$LINENO: result: $libffi_cv_ro_eh_frame" >&5
-echo "${ECHO_T}$libffi_cv_ro_eh_frame" >&6
+{ echo "$as_me:$LINENO: result: $libffi_cv_ro_eh_frame" >&5
+echo "${ECHO_T}$libffi_cv_ro_eh_frame" >&6; }
 if test "x$libffi_cv_ro_eh_frame" = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5855,8 +5973,8 @@
 
 fi
 
-echo "$as_me:$LINENO: checking for __attribute__((visibility(\"hidden\")))" >&5
-echo $ECHO_N "checking for __attribute__((visibility(\"hidden\")))... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for __attribute__((visibility(\"hidden\")))" >&5
+echo $ECHO_N "checking for __attribute__((visibility(\"hidden\")))... $ECHO_C" >&6; }
 if test "${libffi_cv_hidden_visibility_attribute+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5876,8 +5994,8 @@
 	rm -f conftest.*
 
 fi
-echo "$as_me:$LINENO: result: $libffi_cv_hidden_visibility_attribute" >&5
-echo "${ECHO_T}$libffi_cv_hidden_visibility_attribute" >&6
+{ echo "$as_me:$LINENO: result: $libffi_cv_hidden_visibility_attribute" >&5
+echo "${ECHO_T}$libffi_cv_hidden_visibility_attribute" >&6; }
 if test $libffi_cv_hidden_visibility_attribute = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5901,9 +6019,9 @@
 _ACEOF
 
 
-          ac_config_commands="$ac_config_commands include"
+ac_config_commands="$ac_config_commands include"
 
-          ac_config_commands="$ac_config_commands src"
+ac_config_commands="$ac_config_commands src"
 
 
 TARGETINCDIR=$TARGETDIR
@@ -5914,12 +6032,12 @@
 esac
 
 
-          ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETINCDIR/ffitarget.h"
+ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETINCDIR/ffitarget.h"
 
-          ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
+ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
 
 
-                    ac_config_files="$ac_config_files include/ffi.h fficonfig.py"
+ac_config_files="$ac_config_files include/ffi.h fficonfig.py"
 
 
 cat >confcache <<\_ACEOF
@@ -5940,39 +6058,58 @@
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
+      ;; #(
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    echo "not updating unwritable cache $cache_file"
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -5981,32 +6118,18 @@
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -6037,17 +6160,45 @@
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -6057,8 +6208,43 @@
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -6072,18 +6258,19 @@
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -6091,159 +6278,120 @@
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
+# CDPATH.
+$as_unset CDPATH
 
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -6252,7 +6400,28 @@
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -6261,31 +6430,14 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
 This file was extended by libffi $as_me 2.1, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -6293,30 +6445,21 @@
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 # Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_links="$ac_config_links"
+config_commands="$ac_config_commands"
 
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -6324,7 +6467,7 @@
 Usage: $0 [OPTIONS] [FILE]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
+  -V, --version    print version number and configuration settings, then exit
   -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
@@ -6346,18 +6489,20 @@
 $config_commands
 
 Report bugs to <bug-autoconf at gnu.org>."
-_ACEOF
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 libffi config.status 2.1
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -6368,39 +6513,24 @@
 do
   case $1 in
   --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
@@ -6410,18 +6540,24 @@
     $ac_shift
     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -6437,41 +6573,53 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 #
-# INIT-COMMANDS section.
+# INIT-COMMANDS
 #
-
 TARGETDIR="$TARGETDIR"
 
 _ACEOF
 
-
-
 cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "include/ffi.h" ) CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
-  "fficonfig.py" ) CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
-  "include/ffitarget.h" ) CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETINCDIR/ffitarget.h" ;;
-  "include/ffi_common.h" ) CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
-  "include" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;;
-  "src" ) CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;;
-  "fficonfig.h" ) CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;;
+  case $ac_config_target in
+    "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;;
+    "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;;
+    "src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;;
+    "include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETINCDIR/ffitarget.h" ;;
+    "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
+    "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
+    "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
+
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -6484,308 +6632,376 @@
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
 } ||
 {
    echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
 #
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
 #
 
 # No need to generate the scripts if there are no CONFIG_FILES.
 # This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at target@,$target,;t t
-s, at target_cpu@,$target_cpu,;t t
-s, at target_vendor@,$target_vendor,;t t
-s, at target_os@,$target_os,;t t
-s, at CC@,$CC,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at CPP@,$CPP,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at EGREP@,$EGREP,;t t
-s, at ALLOCA@,$ALLOCA,;t t
-s, at HAVE_LONG_DOUBLE@,$HAVE_LONG_DOUBLE,;t t
-s, at TARGET@,$TARGET,;t t
-s, at TARGETDIR@,$TARGETDIR,;t t
-s, at MKTARGET@,$MKTARGET,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+ALLOCA!$ALLOCA$ac_delim
+HAVE_LONG_DOUBLE!$HAVE_LONG_DOUBLE$ac_delim
+TARGET!$TARGET$ac_delim
+TARGETDIR!$TARGETDIR$ac_delim
+MKTARGET!$MKTARGET$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 66; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
 
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
 _ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
 cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
   esac
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
   ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+_ACEOF
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
 _ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
 $extrasub
@@ -6793,511 +7009,173 @@
 cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
 
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  rm -f "$tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
   esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
 
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
 
-# This sed command replaces #undef with comments.  This is necessary, for
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
 
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+while :
 do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
   rm -f conftest.defines
   mv conftest.tail conftest.defines
 done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
+rm -f conftest.defines conftest.tail
 
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
       rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      mv "$tmp/config.h" $ac_file
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    echo "/* $configure_input  */"
+    cat "$ac_result"
   fi
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_LINKS section.
-#
-
-for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  rm -f "$tmp/out12"
+ ;;
+  :L)
+  #
+  # CONFIG_LINK
+  #
 
-  { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5
-echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;}
+  { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5
+echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;}
 
-  if test ! -r $srcdir/$ac_source; then
+  if test ! -r "$srcdir/$ac_source"; then
     { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5
 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;}
    { (exit 1); exit 1; }; }
   fi
-  rm -f $ac_dest
-
-  # Make relative symlinks.
-  ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_dest" : 'X\(//\)[^/]' \| \
-	 X"$ac_dest" : 'X\(//\)$' \| \
-	 X"$ac_dest" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dest_dir"
-  else
-    as_dir="$ac_dest_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dest_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dest_dir";;
-*)
-  case "$ac_dest_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dest_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
+  rm -f "$ac_file"
 
+  # Try a relative symlink, then a hard link, then a copy.
   case $srcdir in
   [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;;
-      *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
+      *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;;
   esac
-
-  # Try a symlink, then a hard link, then a copy.
-  ln -s $ac_rel_source $ac_dest 2>/dev/null ||
-    ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
-    cp -p $srcdir/$ac_source $ac_dest ||
-    { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5
-echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;}
+  ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+    ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null ||
+    cp -p "$srcdir/$ac_source" "$ac_file" ||
+    { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5
+echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;}
    { (exit 1); exit 1; }; }
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_dest" : 'X\(//\)[^/]' \| \
-	 X"$ac_dest" : 'X\(//\)$' \| \
-	 X"$ac_dest" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
+ ;;
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
 
 
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    include ) test -d include || mkdir include ;;
-    src )
+  case $ac_file$ac_mode in
+    "include":C) test -d include || mkdir include ;;
+    "src":C)
 test -d src || mkdir src
 test -d src/$TARGETDIR || mkdir src/$TARGETDIR
  ;;
+
   esac
-done
-_ACEOF
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
 { (exit 0); exit 0; }
 _ACEOF

Modified: python/branches/trunk-math/Modules/_ctypes/libffi/configure.ac
==============================================================================
--- python/branches/trunk-math/Modules/_ctypes/libffi/configure.ac	(original)
+++ python/branches/trunk-math/Modules/_ctypes/libffi/configure.ac	Thu Feb 28 21:09:17 2008
@@ -106,17 +106,6 @@
 fi
 AC_SUBST(HAVE_LONG_DOUBLE)
 
-AC_MSG_CHECKING(for _Bool support)
-have_c99_bool=no
-AC_TRY_COMPILE([], [_Bool x; x = (_Bool)0;], [
-  AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.]) 
-  have_c99_bool=yes
-])
-AC_MSG_RESULT($have_c99_bool)
-if test "$have_c99_bool" = yes ; then
-AC_CHECK_SIZEOF(_Bool, 1)
-fi
-
 AC_C_BIGENDIAN
 AH_VERBATIM([WORDS_BIGENDIAN],
 [

Modified: python/branches/trunk-math/Modules/_ctypes/libffi/fficonfig.h.in
==============================================================================
--- python/branches/trunk-math/Modules/_ctypes/libffi/fficonfig.h.in	(original)
+++ python/branches/trunk-math/Modules/_ctypes/libffi/fficonfig.h.in	Thu Feb 28 21:09:17 2008
@@ -28,9 +28,6 @@
    */
 #undef HAVE_AS_SPARC_UA_PCREL
 
-/* Define this if you have the type _Bool. */
-#undef HAVE_C99_BOOL
-
 /* Define if __attribute__((visibility("hidden"))) is supported. */
 #undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
 
@@ -100,18 +97,15 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* The size of a `double', as computed by sizeof. */
+/* The size of `double', as computed by sizeof. */
 #undef SIZEOF_DOUBLE
 
-/* The size of a `long double', as computed by sizeof. */
+/* The size of `long double', as computed by sizeof. */
 #undef SIZEOF_LONG_DOUBLE
 
-/* The size of a `_Bool', as computed by sizeof. */
-#undef SIZEOF__BOOL
-
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
+   automatically deduced at runtime.
 	STACK_DIRECTION > 0 => grows toward higher addresses
 	STACK_DIRECTION < 0 => grows toward lower addresses
 	STACK_DIRECTION = 0 => direction of growth unknown */

Modified: python/branches/trunk-math/Modules/_struct.c
==============================================================================
--- python/branches/trunk-math/Modules/_struct.c	(original)
+++ python/branches/trunk-math/Modules/_struct.c	Thu Feb 28 21:09:17 2008
@@ -1471,7 +1471,7 @@
 		return -1;
 
 	Py_INCREF(o_format);
-	Py_XDECREF(soself->s_format);
+	Py_CLEAR(soself->s_format);
 	soself->s_format = o_format;
 
 	ret = prepare_s(soself);

Modified: python/branches/trunk-math/Modules/_testcapimodule.c
==============================================================================
--- python/branches/trunk-math/Modules/_testcapimodule.c	(original)
+++ python/branches/trunk-math/Modules/_testcapimodule.c	Thu Feb 28 21:09:17 2008
@@ -306,6 +306,22 @@
 	return Py_BuildValue("iii", a, b, c);
 }
 
+/* test PyArg_ParseTupleAndKeywords */
+static PyObject *getargs_keywords(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+	static char *keywords[] = {"arg1","arg2","arg3","arg4","arg5", NULL};
+	static char *fmt="(ii)i|(i(ii))(iii)i";
+	int int_args[10]={-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
+
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, fmt, keywords,
+		&int_args[0], &int_args[1], &int_args[2], &int_args[3], &int_args[4],
+		&int_args[5], &int_args[6], &int_args[7], &int_args[8], &int_args[9]))
+		return NULL;
+	return Py_BuildValue("iiiiiiiiii",
+		int_args[0], int_args[1], int_args[2], int_args[3], int_args[4],
+		int_args[5], int_args[6], int_args[7], int_args[8], int_args[9]);
+}
+
 /* Functions to call PyArg_ParseTuple with integer format codes,
    and return the result.
 */
@@ -732,6 +748,8 @@
 	 PyDoc_STR("This is a pretty normal docstring.")},
 
 	{"getargs_tuple",	getargs_tuple,			 METH_VARARGS},
+	{"getargs_keywords", (PyCFunction)getargs_keywords, 
+	  METH_VARARGS|METH_KEYWORDS},
 	{"getargs_b",		getargs_b,			 METH_VARARGS},
 	{"getargs_B",		getargs_B,			 METH_VARARGS},
 	{"getargs_H",		getargs_H,			 METH_VARARGS},

Modified: python/branches/trunk-math/Modules/cStringIO.c
==============================================================================
--- python/branches/trunk-math/Modules/cStringIO.c	(original)
+++ python/branches/trunk-math/Modules/cStringIO.c	Thu Feb 28 21:09:17 2008
@@ -575,8 +575,7 @@
 
 static PyObject *
 I_close(Iobject *self, PyObject *unused) {
-        Py_XDECREF(self->pbuf);
-        self->pbuf = NULL;
+        Py_CLEAR(self->pbuf);
         self->buf = NULL;
 
         self->pos = self->string_size = 0;

Modified: python/branches/trunk-math/Modules/datetimemodule.c
==============================================================================
--- python/branches/trunk-math/Modules/datetimemodule.c	(original)
+++ python/branches/trunk-math/Modules/datetimemodule.c	Thu Feb 28 21:09:17 2008
@@ -2469,6 +2469,32 @@
 	return result;
 }
 
+static PyObject *
+date_format(PyDateTime_Date *self, PyObject *args)
+{
+	PyObject *format;
+
+	if (!PyArg_ParseTuple(args, "O:__format__", &format))
+		return NULL;
+
+	/* Check for str or unicode */
+	if (PyString_Check(format)) {
+                /* If format is zero length, return str(self) */
+		if (PyString_GET_SIZE(format) == 0)
+			return PyObject_Str((PyObject *)self);
+	} else if (PyUnicode_Check(format)) {
+                /* If format is zero length, return str(self) */
+		if (PyUnicode_GET_SIZE(format) == 0)
+			return PyObject_Unicode((PyObject *)self);
+	} else {
+		PyErr_Format(PyExc_ValueError,
+			     "__format__ expects str or unicode, not %.200s",
+			     Py_TYPE(format)->tp_name);
+		return NULL;
+	}
+	return PyObject_CallMethod((PyObject *)self, "strftime", "O", format);
+}
+
 /* ISO methods. */
 
 static PyObject *
@@ -2633,6 +2659,9 @@
 	{"strftime",   	(PyCFunction)date_strftime,	METH_VARARGS | METH_KEYWORDS,
 	 PyDoc_STR("format -> strftime() style string.")},
 
+	{"__format__", 	(PyCFunction)date_format,	METH_VARARGS,
+	 PyDoc_STR("Formats self with strftime.")},
+
 	{"timetuple",   (PyCFunction)date_timetuple,    METH_NOARGS,
          PyDoc_STR("Return time tuple, compatible with time.localtime().")},
 
@@ -3418,6 +3447,9 @@
 	{"strftime",   	(PyCFunction)time_strftime,	METH_VARARGS | METH_KEYWORDS,
 	 PyDoc_STR("format -> strftime() style string.")},
 
+	{"__format__", 	(PyCFunction)date_format,	METH_VARARGS,
+	 PyDoc_STR("Formats self with strftime.")},
+
 	{"utcoffset",	(PyCFunction)time_utcoffset,	METH_NOARGS,
 	 PyDoc_STR("Return self.tzinfo.utcoffset(self).")},
 

Modified: python/branches/trunk-math/Modules/dbmmodule.c
==============================================================================
--- python/branches/trunk-math/Modules/dbmmodule.c	(original)
+++ python/branches/trunk-math/Modules/dbmmodule.c	Thu Feb 28 21:09:17 2008
@@ -161,6 +161,37 @@
 	return 0;
 }
 
+static int
+dbm_contains(register dbmobject *dp, PyObject *v)
+{
+	datum key, val;
+
+	if (PyString_AsStringAndSize(v, &key.dptr, &key.dsize)) {
+		return -1;
+	}
+
+	/* Expand check_dbmobject_open to return -1 */
+	if (dp->di_dbm == NULL) {
+		PyErr_SetString(DbmError, "DBM object has already been closed");
+		return -1;
+	}
+	val = dbm_fetch(dp->di_dbm, key);
+	return val.dptr != NULL;
+}
+
+static PySequenceMethods dbm_as_sequence = {
+    (lenfunc)dbm_length,        /*_length*/
+    0,                          /*sq_concat*/
+    0,                          /*sq_repeat*/
+    0,                          /*sq_item*/
+    0,                          /*sq_slice*/
+    0,                          /*sq_ass_item*/
+    0,                          /*sq_ass_slice*/
+    (objobjproc)dbm_contains,   /*sq_contains*/
+    0,                          /*sq_inplace_concat*/
+    0                           /*sq_inplace_repeat*/
+};
+
 static PyMappingMethods dbm_as_mapping = {
 	(lenfunc)dbm_length,		/*mp_length*/
 	(binaryfunc)dbm_subscript,	/*mp_subscript*/
@@ -313,8 +344,15 @@
 	0,			  /*tp_compare*/
 	0,			  /*tp_repr*/
 	0,			  /*tp_as_number*/
-	0,			  /*tp_as_sequence*/
+    &dbm_as_sequence,     /*tp_as_sequence*/
 	&dbm_as_mapping,	  /*tp_as_mapping*/
+    0,                    /*tp_hash*/
+    0,                    /*tp_call*/
+    0,                    /*tp_str*/
+    0,                    /*tp_getattro*/
+    0,                    /*tp_setattro*/
+    0,                    /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT,   /*tp_xxx4*/
 };
 
 /* ----------------------------------------------------------------- */

Modified: python/branches/trunk-math/Modules/gdbmmodule.c
==============================================================================
--- python/branches/trunk-math/Modules/gdbmmodule.c	(original)
+++ python/branches/trunk-math/Modules/gdbmmodule.c	Thu Feb 28 21:09:17 2008
@@ -178,6 +178,40 @@
     return 0;
 }
 
+static int
+dbm_contains(register dbmobject *dp, PyObject *arg)
+{
+    datum key;
+
+    if ((dp)->di_dbm == NULL) {
+        PyErr_SetString(DbmError,
+                        "GDBM object has already been closed");
+        return -1;
+    }
+    if (!PyString_Check(arg)) {
+        PyErr_Format(PyExc_TypeError,
+                     "gdbm key must be string, not %.100s",
+                     arg->ob_type->tp_name);
+        return -1;
+    }
+    key.dptr = PyString_AS_STRING(arg);
+    key.dsize = PyString_GET_SIZE(arg);
+    return gdbm_exists(dp->di_dbm, key);
+}
+
+static PySequenceMethods dbm_as_sequence = {
+    (lenfunc)dbm_length,               /*_length*/
+       0,              /*sq_concat*/
+       0,                      /*sq_repeat*/
+       0,                      /*sq_item*/
+       0,                      /*sq_slice*/
+       0,                      /*sq_ass_item*/
+       0,                  /*sq_ass_slice*/
+       (objobjproc)dbm_contains,               /*sq_contains*/
+       0,                  /*sq_inplace_concat*/
+       0                   /*sq_inplace_repeat*/
+};
+
 static PyMappingMethods dbm_as_mapping = {
     (lenfunc)dbm_length,		/*mp_length*/
     (binaryfunc)dbm_subscript,          /*mp_subscript*/
@@ -381,7 +415,7 @@
     0,                                  /*tp_compare*/
     0,                                  /*tp_repr*/
     0,                                  /*tp_as_number*/
-    0,                                  /*tp_as_sequence*/
+    &dbm_as_sequence,                   /*tp_as_sequence*/
     &dbm_as_mapping,                    /*tp_as_mapping*/
     0,                                  /*tp_hash*/
     0,                                  /*tp_call*/
@@ -389,7 +423,7 @@
     0,                                  /*tp_getattro*/
     0,                                  /*tp_setattro*/
     0,                                  /*tp_as_buffer*/
-    0,                                  /*tp_xxx4*/
+    Py_TPFLAGS_DEFAULT,                 /*tp_xxx4*/
     gdbm_object__doc__,                 /*tp_doc*/
 };
 

Modified: python/branches/trunk-math/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/trunk-math/Modules/itertoolsmodule.c	(original)
+++ python/branches/trunk-math/Modules/itertoolsmodule.c	Thu Feb 28 21:09:17 2008
@@ -1741,6 +1741,471 @@
 };
 
 
+/* product object ************************************************************/
+
+typedef struct {
+	PyObject_HEAD
+	PyObject *pools;		/* tuple of pool tuples */
+	Py_ssize_t *maxvec;             /* size of each pool */
+	Py_ssize_t *indices;            /* one index per pool */
+	PyObject *result;               /* most recently returned result tuple */
+	int stopped;                    /* set to 1 when the product iterator is exhausted */
+} productobject;
+
+static PyTypeObject product_type;
+
+static PyObject *
+product_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+	productobject *lz;
+	Py_ssize_t npools;
+	PyObject *pools = NULL;
+	Py_ssize_t *maxvec = NULL;
+	Py_ssize_t *indices = NULL;
+	Py_ssize_t i;
+
+	if (type == &product_type && !_PyArg_NoKeywords("product()", kwds))
+		return NULL;
+
+	assert(PyTuple_Check(args));
+	npools = PyTuple_GET_SIZE(args);
+
+	maxvec = PyMem_Malloc(npools * sizeof(Py_ssize_t));
+	indices = PyMem_Malloc(npools * sizeof(Py_ssize_t));
+	if (maxvec == NULL || indices == NULL) {
+    		PyErr_NoMemory();
+		goto error;
+	}
+
+	pools = PyTuple_New(npools);
+	if (pools == NULL)
+		goto error;
+
+	for (i=0; i < npools; ++i) {
+		PyObject *item = PyTuple_GET_ITEM(args, i);
+		PyObject *pool = PySequence_Tuple(item);
+		if (pool == NULL)
+			goto error;
+
+		PyTuple_SET_ITEM(pools, i, pool);
+		maxvec[i] = PyTuple_GET_SIZE(pool);
+		indices[i] = 0;
+	}
+
+	/* create productobject structure */
+	lz = (productobject *)type->tp_alloc(type, 0);
+	if (lz == NULL)
+		goto error;
+
+	lz->pools = pools;
+	lz->maxvec = maxvec;
+	lz->indices = indices;
+	lz->result = NULL;
+	lz->stopped = 0;
+
+	return (PyObject *)lz;
+
+error:
+	if (maxvec != NULL)
+		PyMem_Free(maxvec);
+	if (indices != NULL)
+		PyMem_Free(indices);
+	Py_XDECREF(pools);
+	return NULL;
+}
+
+static void
+product_dealloc(productobject *lz)
+{
+	PyObject_GC_UnTrack(lz);
+	Py_XDECREF(lz->pools);
+	Py_XDECREF(lz->result);
+	PyMem_Free(lz->maxvec);
+	PyMem_Free(lz->indices);
+	Py_TYPE(lz)->tp_free(lz);
+}
+
+static int
+product_traverse(productobject *lz, visitproc visit, void *arg)
+{
+	Py_VISIT(lz->pools);
+	Py_VISIT(lz->result);
+	return 0;
+}
+
+static PyObject *
+product_next(productobject *lz)
+{
+	PyObject *pool;
+	PyObject *elem;
+	PyObject *oldelem;
+	PyObject *pools = lz->pools;
+	PyObject *result = lz->result;
+	Py_ssize_t npools = PyTuple_GET_SIZE(pools);
+	Py_ssize_t i;
+
+	if (lz->stopped)
+		return NULL;
+
+	if (result == NULL) {
+                /* On the first pass, return an initial tuple filled with the 
+                   first element from each pool.  If any pool is empty, then 
+                   whole product is empty and we're already done */
+		if (npools == 0)
+			goto empty;
+		result = PyTuple_New(npools);
+		if (result == NULL)
+            		goto empty;
+		lz->result = result;
+		for (i=0; i < npools; i++) {
+			pool = PyTuple_GET_ITEM(pools, i);
+			if (PyTuple_GET_SIZE(pool) == 0)
+				goto empty;
+    			elem = PyTuple_GET_ITEM(pool, 0);
+    			Py_INCREF(elem);
+    			PyTuple_SET_ITEM(result, i, elem);
+		}
+	} else {
+		Py_ssize_t *indices = lz->indices;
+		Py_ssize_t *maxvec = lz->maxvec;
+
+		/* Copy the previous result tuple or re-use it if available */
+		if (Py_REFCNT(result) > 1) {
+			PyObject *old_result = result;
+			result = PyTuple_New(npools);
+			if (result == NULL)
+				goto empty;
+			lz->result = result;
+			for (i=0; i < npools; i++) {
+				elem = PyTuple_GET_ITEM(old_result, i);
+    				Py_INCREF(elem);
+    				PyTuple_SET_ITEM(result, i, elem);
+			}
+			Py_DECREF(old_result);
+		}
+		/* Now, we've got the only copy so we can update it in-place */
+		assert (Py_REFCNT(result) == 1);
+
+                /* Update the pool indices right-to-left.  Only advance to the
+                   next pool when the previous one rolls-over */
+		for (i=npools-1 ; i >= 0 ; i--) {
+			pool = PyTuple_GET_ITEM(pools, i);
+			indices[i]++;
+			if (indices[i] == maxvec[i]) {
+				/* Roll-over and advance to next pool */
+				indices[i] = 0;
+				elem = PyTuple_GET_ITEM(pool, 0);
+				Py_INCREF(elem);
+				oldelem = PyTuple_GET_ITEM(result, i);
+				PyTuple_SET_ITEM(result, i, elem);
+				Py_DECREF(oldelem);
+			} else {
+				/* No rollover. Just increment and stop here. */
+				elem = PyTuple_GET_ITEM(pool, indices[i]);
+				Py_INCREF(elem);
+				oldelem = PyTuple_GET_ITEM(result, i);
+				PyTuple_SET_ITEM(result, i, elem);
+				Py_DECREF(oldelem);
+				break;
+			}
+		}
+
+		/* If i is negative, then the indices have all rolled-over
+                   and we're done. */
+		if (i < 0)
+			goto empty;
+	}
+
+	Py_INCREF(result);
+	return result;
+
+empty:
+	lz->stopped = 1;
+	return NULL;
+}
+
+PyDoc_STRVAR(product_doc,
+"product(*iterables) --> product object\n\
+\n\
+Cartesian product of input iterables.  Equivalent to nested for-loops.\n\n\
+For example, product(A, B) returns the same as:  ((x,y) for x in A for y in B).\n\
+The leftmost iterators are in the outermost for-loop, so the output tuples\n\
+cycle in a manner similar to an odometer (with the rightmost element changing\n\
+on every iteration).\n\n\
+product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\n\
+product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...");
+
+static PyTypeObject product_type = {
+	PyVarObject_HEAD_INIT(NULL, 0)
+	"itertools.product",		/* tp_name */
+	sizeof(productobject),	/* tp_basicsize */
+	0,				/* tp_itemsize */
+	/* methods */
+	(destructor)product_dealloc,	/* tp_dealloc */
+	0,				/* tp_print */
+	0,				/* tp_getattr */
+	0,				/* tp_setattr */
+	0,				/* tp_compare */
+	0,				/* tp_repr */
+	0,				/* tp_as_number */
+	0,				/* tp_as_sequence */
+	0,				/* tp_as_mapping */
+	0,				/* tp_hash */
+	0,				/* tp_call */
+	0,				/* tp_str */
+	PyObject_GenericGetAttr,	/* tp_getattro */
+	0,				/* tp_setattro */
+	0,				/* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+		Py_TPFLAGS_BASETYPE,	/* tp_flags */
+	product_doc,			/* tp_doc */
+	(traverseproc)product_traverse,	/* tp_traverse */
+	0,				/* tp_clear */
+	0,				/* tp_richcompare */
+	0,				/* tp_weaklistoffset */
+	PyObject_SelfIter,		/* tp_iter */
+	(iternextfunc)product_next,	/* tp_iternext */
+	0,				/* tp_methods */
+	0,				/* tp_members */
+	0,				/* tp_getset */
+	0,				/* tp_base */
+	0,				/* tp_dict */
+	0,				/* tp_descr_get */
+	0,				/* tp_descr_set */
+	0,				/* tp_dictoffset */
+	0,				/* tp_init */
+	0,				/* tp_alloc */
+	product_new,			/* tp_new */
+	PyObject_GC_Del,		/* tp_free */
+};
+
+
+/* combinations object ************************************************************/
+
+typedef struct {
+	PyObject_HEAD
+	PyObject *pool;			/* input converted to a tuple */
+	Py_ssize_t *indices;            /* one index per result element */
+	PyObject *result;               /* most recently returned result tuple */
+	Py_ssize_t r;			/* size of result tuple */
+	int stopped;			/* set to 1 when the combinations iterator is exhausted */
+} combinationsobject;
+
+static PyTypeObject combinations_type;
+
+static PyObject *
+combinations_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+	combinationsobject *co;
+	Py_ssize_t n;
+	Py_ssize_t r;
+	PyObject *pool = NULL;
+	PyObject *iterable = NULL;
+	Py_ssize_t *indices = NULL;
+	Py_ssize_t i;
+	static char *kwargs[] = {"iterable", "r", NULL};
+ 
+ 	if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:combinations", kwargs, 
+					 &iterable, &r))
+		return NULL;
+
+	pool = PySequence_Tuple(iterable);
+	if (pool == NULL)
+		goto error;
+	n = PyTuple_GET_SIZE(pool);
+	if (r < 0) {
+		PyErr_SetString(PyExc_ValueError, "r must be non-negative");
+		goto error;
+	}
+	if (r > n) {
+		PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable");
+		goto error;
+	}
+
+	indices = PyMem_Malloc(r * sizeof(Py_ssize_t));
+	if (indices == NULL) {
+    		PyErr_NoMemory();
+		goto error;
+	}
+
+	for (i=0 ; i<r ; i++)
+		indices[i] = i;
+
+	/* create combinationsobject structure */
+	co = (combinationsobject *)type->tp_alloc(type, 0);
+	if (co == NULL)
+		goto error;
+
+	co->pool = pool;
+	co->indices = indices;
+	co->result = NULL;
+	co->r = r;
+	co->stopped = 0;
+
+	return (PyObject *)co;
+
+error:
+	if (indices != NULL)
+		PyMem_Free(indices);
+	Py_XDECREF(pool);
+	return NULL;
+}
+
+static void
+combinations_dealloc(combinationsobject *co)
+{
+	PyObject_GC_UnTrack(co);
+	Py_XDECREF(co->pool);
+	Py_XDECREF(co->result);
+	PyMem_Free(co->indices);
+	Py_TYPE(co)->tp_free(co);
+}
+
+static int
+combinations_traverse(combinationsobject *co, visitproc visit, void *arg)
+{
+	Py_VISIT(co->pool);
+	Py_VISIT(co->result);
+	return 0;
+}
+
+static PyObject *
+combinations_next(combinationsobject *co)
+{
+	PyObject *elem;
+	PyObject *oldelem;
+	PyObject *pool = co->pool;
+	Py_ssize_t *indices = co->indices;
+	PyObject *result = co->result;
+	Py_ssize_t n = PyTuple_GET_SIZE(pool);
+	Py_ssize_t r = co->r;
+	Py_ssize_t i, j, index;
+
+	if (co->stopped)
+		return NULL;
+
+	if (result == NULL) {
+                /* On the first pass, initialize result tuple using the indices */
+		result = PyTuple_New(r);
+		if (result == NULL)
+            		goto empty;
+		co->result = result;
+		for (i=0; i<r ; i++) {
+			index = indices[i];
+    			elem = PyTuple_GET_ITEM(pool, index);
+    			Py_INCREF(elem);
+    			PyTuple_SET_ITEM(result, i, elem);
+		}
+	} else {
+		/* Copy the previous result tuple or re-use it if available */
+		if (Py_REFCNT(result) > 1) {
+			PyObject *old_result = result;
+			result = PyTuple_New(r);
+			if (result == NULL)
+				goto empty;
+			co->result = result;
+			for (i=0; i<r ; i++) {
+				elem = PyTuple_GET_ITEM(old_result, i);
+    				Py_INCREF(elem);
+    				PyTuple_SET_ITEM(result, i, elem);
+			}
+			Py_DECREF(old_result);
+		}
+		/* Now, we've got the only copy so we can update it in-place 
+		 * CPython's empty tuple is a singleton and cached in 
+		 * PyTuple's freelist. 
+		 */
+		assert(r == 0 || Py_REFCNT(result) == 1);
+
+                /* Scan indices right-to-left until finding one that is not
+                   at its maximum (i + n - r). */
+		for (i=r-1 ; i >= 0 && indices[i] == i+n-r ; i--)
+			;
+
+		/* If i is negative, then the indices are all at
+                   their maximum value and we're done. */
+		if (i < 0)
+			goto empty;
+
+		/* Increment the current index which we know is not at its
+                   maximum.  Then move back to the right setting each index
+                   to its lowest possible value (one higher than the index
+                   to its left -- this maintains the sort order invariant). */
+		indices[i]++;
+		for (j=i+1 ; j<r ; j++)
+			indices[j] = indices[j-1] + 1;
+
+		/* Update the result tuple for the new indices
+		   starting with i, the leftmost index that changed */
+		for ( ; i<r ; i++) {
+			index = indices[i];
+			elem = PyTuple_GET_ITEM(pool, index);
+			Py_INCREF(elem);
+			oldelem = PyTuple_GET_ITEM(result, i);
+			PyTuple_SET_ITEM(result, i, elem);
+			Py_DECREF(oldelem);
+		}
+	}
+
+	Py_INCREF(result);
+	return result;
+
+empty:
+	co->stopped = 1;
+	return NULL;
+}
+
+PyDoc_STRVAR(combinations_doc,
+"combinations(iterables) --> combinations object\n\
+\n\
+Return successive r-length combinations of elements in the iterable.\n\n\
+combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)");
+
+static PyTypeObject combinations_type = {
+	PyVarObject_HEAD_INIT(NULL, 0)
+	"itertools.combinations",		/* tp_name */
+	sizeof(combinationsobject),	/* tp_basicsize */
+	0,				/* tp_itemsize */
+	/* methods */
+	(destructor)combinations_dealloc,	/* tp_dealloc */
+	0,				/* tp_print */
+	0,				/* tp_getattr */
+	0,				/* tp_setattr */
+	0,				/* tp_compare */
+	0,				/* tp_repr */
+	0,				/* tp_as_number */
+	0,				/* tp_as_sequence */
+	0,				/* tp_as_mapping */
+	0,				/* tp_hash */
+	0,				/* tp_call */
+	0,				/* tp_str */
+	PyObject_GenericGetAttr,	/* tp_getattro */
+	0,				/* tp_setattro */
+	0,				/* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+		Py_TPFLAGS_BASETYPE,	/* tp_flags */
+	combinations_doc,			/* tp_doc */
+	(traverseproc)combinations_traverse,	/* tp_traverse */
+	0,				/* tp_clear */
+	0,				/* tp_richcompare */
+	0,				/* tp_weaklistoffset */
+	PyObject_SelfIter,		/* tp_iter */
+	(iternextfunc)combinations_next,	/* tp_iternext */
+	0,				/* tp_methods */
+	0,				/* tp_members */
+	0,				/* tp_getset */
+	0,				/* tp_base */
+	0,				/* tp_dict */
+	0,				/* tp_descr_get */
+	0,				/* tp_descr_set */
+	0,				/* tp_dictoffset */
+	0,				/* tp_init */
+	0,				/* tp_alloc */
+	combinations_new,			/* tp_new */
+	PyObject_GC_Del,		/* tp_free */
+};
+
+
 /* ifilter object ************************************************************/
 
 typedef struct {
@@ -1814,7 +2279,7 @@
 		if (item == NULL)
 			return NULL;
 
-		if (lz->func == Py_None) {
+		if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) {
 			ok = PyObject_IsTrue(item);
 		} else {
 			PyObject *good;
@@ -1958,7 +2423,7 @@
 		if (item == NULL)
 			return NULL;
 
-		if (lz->func == Py_None) {
+		if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) {
 			ok = PyObject_IsTrue(item);
 		} else {
 			PyObject *good;
@@ -2785,6 +3250,7 @@
 	PyObject *m;
 	char *name;
 	PyTypeObject *typelist[] = {
+		&combinations_type,
 		&cycle_type,
 		&dropwhile_type,
 		&takewhile_type,
@@ -2796,7 +3262,8 @@
 		&ifilterfalse_type,
 		&count_type,
 		&izip_type,
-		&iziplongest_type,                
+		&iziplongest_type,
+		&product_type,         
 		&repeat_type,
 		&groupby_type,
 		NULL

Modified: python/branches/trunk-math/Modules/mmapmodule.c
==============================================================================
--- python/branches/trunk-math/Modules/mmapmodule.c	(original)
+++ python/branches/trunk-math/Modules/mmapmodule.c	Thu Feb 28 21:09:17 2008
@@ -1402,7 +1402,10 @@
 	dict = PyModule_GetDict(module);
 	if (!dict)
 		return;
-	mmap_module_error = PyExc_EnvironmentError;
+	mmap_module_error = PyErr_NewException("mmap.error",
+		PyExc_EnvironmentError , NULL);
+	if (mmap_module_error == NULL)
+		return;
 	PyDict_SetItemString(dict, "error", mmap_module_error);
 	PyDict_SetItemString(dict, "mmap", (PyObject*) &mmap_object_type);
 #ifdef PROT_EXEC

Modified: python/branches/trunk-math/Modules/operator.c
==============================================================================
--- python/branches/trunk-math/Modules/operator.c	(original)
+++ python/branches/trunk-math/Modules/operator.c	Thu Feb 28 21:09:17 2008
@@ -496,6 +496,49 @@
 }
 
 static PyObject *
+dotted_getattr(PyObject *obj, PyObject *attr)
+{
+	char *s, *p;
+
+#ifdef Py_USING_UNICODE
+	if (PyUnicode_Check(attr)) {
+		attr = _PyUnicode_AsDefaultEncodedString(attr, NULL);
+		if (attr == NULL)
+			return NULL;
+	}
+#endif
+	
+	if (!PyString_Check(attr)) {
+		PyErr_SetString(PyExc_TypeError,
+				"attribute name must be a string");
+		return NULL;
+	}
+
+	s = PyString_AS_STRING(attr);
+	Py_INCREF(obj);
+	for (;;) {
+		PyObject *newobj, *str;
+		p = strchr(s, '.');
+		str = p ? PyString_FromStringAndSize(s, (p-s)) : 
+			  PyString_FromString(s);
+		if (str == NULL) {
+			Py_DECREF(obj);
+			return NULL;
+		}
+		newobj = PyObject_GetAttr(obj, str);
+		Py_DECREF(str);
+		Py_DECREF(obj);
+		if (newobj == NULL)
+			return NULL;
+		obj = newobj;
+		if (p == NULL) break;
+		s = p+1;
+	}
+
+	return obj;
+}
+
+static PyObject *
 attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw)
 {
 	PyObject *obj, *result;
@@ -504,7 +547,7 @@
 	if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &obj))
 		return NULL;
 	if (ag->nattrs == 1)
-		return PyObject_GetAttr(obj, ag->attr);
+		return dotted_getattr(obj, ag->attr);
 
 	assert(PyTuple_Check(ag->attr));
 	assert(PyTuple_GET_SIZE(ag->attr) == nattrs);
@@ -516,7 +559,7 @@
 	for (i=0 ; i < nattrs ; i++) {
 		PyObject *attr, *val;
 		attr = PyTuple_GET_ITEM(ag->attr, i);
-		val = PyObject_GetAttr(obj, attr);
+		val = dotted_getattr(obj, attr);
 		if (val == NULL) {
 			Py_DECREF(result);
 			return NULL;
@@ -531,7 +574,9 @@
 \n\
 Return a callable object that fetches the given attribute(s) from its operand.\n\
 After, f=attrgetter('name'), the call f(r) returns r.name.\n\
-After, g=attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).");
+After, g=attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).\n\
+After, h=attrgetter('name.first', 'name.last'), the call h(r) returns\n\
+(r.name.first, r.name.last).");
 
 static PyTypeObject attrgetter_type = {
 	PyVarObject_HEAD_INIT(NULL, 0)
@@ -575,6 +620,139 @@
 	attrgetter_new,			/* tp_new */
 	0,				/* tp_free */
 };
+
+
+/* methodcaller object **********************************************************/
+
+typedef struct {
+	PyObject_HEAD
+	PyObject *name;
+	PyObject *args;
+	PyObject *kwds;
+} methodcallerobject;
+
+static PyTypeObject methodcaller_type;
+
+static PyObject *
+methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+	methodcallerobject *mc;
+	PyObject *name, *newargs;
+
+	if (PyTuple_GET_SIZE(args) < 1) {
+		PyErr_SetString(PyExc_TypeError, "methodcaller needs at least "
+				"one argument, the method name");
+		return NULL;
+	}
+
+	/* create methodcallerobject structure */
+	mc = PyObject_GC_New(methodcallerobject, &methodcaller_type);
+	if (mc == NULL) 
+		return NULL;	
+
+	newargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+	if (newargs == NULL) {
+		Py_DECREF(mc);
+		return NULL;
+	}
+	mc->args = newargs;
+
+	name = PyTuple_GET_ITEM(args, 0);
+	Py_INCREF(name);
+	mc->name = name;
+
+	Py_XINCREF(kwds);
+	mc->kwds = kwds;
+
+	PyObject_GC_Track(mc);
+	return (PyObject *)mc;
+}
+
+static void
+methodcaller_dealloc(methodcallerobject *mc)
+{
+	PyObject_GC_UnTrack(mc);
+	Py_XDECREF(mc->name);
+	Py_XDECREF(mc->args);
+	Py_XDECREF(mc->kwds);
+	PyObject_GC_Del(mc);
+}
+
+static int
+methodcaller_traverse(methodcallerobject *mc, visitproc visit, void *arg)
+{
+	Py_VISIT(mc->args);
+	Py_VISIT(mc->kwds);
+	return 0;
+}
+
+static PyObject *
+methodcaller_call(methodcallerobject *mc, PyObject *args, PyObject *kw)
+{
+	PyObject *method, *obj, *result;
+
+	if (!PyArg_UnpackTuple(args, "methodcaller", 1, 1, &obj))
+		return NULL;
+	method = PyObject_GetAttr(obj, mc->name);
+	if (method == NULL)
+		return NULL;
+	result = PyObject_Call(method, mc->args, mc->kwds);
+	Py_DECREF(method);
+	return result;
+}
+
+PyDoc_STRVAR(methodcaller_doc,
+"methodcaller(name, ...) --> methodcaller object\n\
+\n\
+Return a callable object that calls the given method on its operand.\n\
+After, f = methodcaller('name'), the call f(r) returns r.name().\n\
+After, g = methodcaller('name', 'date', foo=1), the call g(r) returns\n\
+r.name('date', foo=1).");
+
+static PyTypeObject methodcaller_type = {
+	PyVarObject_HEAD_INIT(NULL, 0)
+	"operator.methodcaller",	/* tp_name */
+	sizeof(methodcallerobject),	/* tp_basicsize */
+	0,				/* tp_itemsize */
+	/* methods */
+	(destructor)methodcaller_dealloc, /* tp_dealloc */
+	0,				/* tp_print */
+	0,				/* tp_getattr */
+	0,				/* tp_setattr */
+	0,				/* tp_compare */
+	0,				/* tp_repr */
+	0,				/* tp_as_number */
+	0,				/* tp_as_sequence */
+	0,				/* tp_as_mapping */
+	0,				/* tp_hash */
+	(ternaryfunc)methodcaller_call,	/* tp_call */
+	0,				/* tp_str */
+	PyObject_GenericGetAttr,	/* tp_getattro */
+	0,				/* tp_setattro */
+	0,				/* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
+	methodcaller_doc,			/* tp_doc */
+	(traverseproc)methodcaller_traverse,	/* tp_traverse */
+	0,				/* tp_clear */
+	0,				/* tp_richcompare */
+	0,				/* tp_weaklistoffset */
+	0,				/* tp_iter */
+	0,				/* tp_iternext */
+	0,				/* tp_methods */
+	0,				/* tp_members */
+	0,				/* tp_getset */
+	0,				/* tp_base */
+	0,				/* tp_dict */
+	0,				/* tp_descr_get */
+	0,				/* tp_descr_set */
+	0,				/* tp_dictoffset */
+	0,				/* tp_init */
+	0,				/* tp_alloc */
+	methodcaller_new,		/* tp_new */
+	0,				/* tp_free */
+};
+
+
 /* Initialization function for the module (*must* be called initoperator) */
 
 PyMODINIT_FUNC
@@ -597,4 +775,9 @@
 		return;
 	Py_INCREF(&attrgetter_type);
 	PyModule_AddObject(m, "attrgetter", (PyObject *)&attrgetter_type);
+
+	if (PyType_Ready(&methodcaller_type) < 0)
+		return;
+	Py_INCREF(&methodcaller_type);
+	PyModule_AddObject(m, "methodcaller", (PyObject *)&methodcaller_type);
 }

Modified: python/branches/trunk-math/Modules/parsermodule.c
==============================================================================
--- python/branches/trunk-math/Modules/parsermodule.c	(original)
+++ python/branches/trunk-math/Modules/parsermodule.c	Thu Feb 28 21:09:17 2008
@@ -1498,7 +1498,7 @@
 
 
 /*  compound_stmt:
- *      if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
+ *      if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef | decorated
  */
 static int
 validate_compound_stmt(node *tree)
@@ -1517,7 +1517,8 @@
           || (ntype == for_stmt)
           || (ntype == try_stmt)
           || (ntype == funcdef)
-          || (ntype == classdef))
+          || (ntype == classdef)
+          || (ntype == decorated))
         res = validate_node(tree);
     else {
         res = 0;
@@ -1527,7 +1528,6 @@
     return (res);
 }
 
-
 static int
 validate_yield_or_testlist(node *tree)
 {
@@ -2558,28 +2558,40 @@
 
 /*  funcdef:
  *      
- *            -6   -5    -4         -3  -2 -1
- *  [decorators] 'def' NAME parameters ':' suite
+ *     -5   -4         -3  -2    -1
+ *  'def' NAME parameters ':' suite
  */
 static int
 validate_funcdef(node *tree)
 {
     int nch = NCH(tree);
     int ok = (validate_ntype(tree, funcdef)
-	       && ((nch == 5) || (nch == 6))
+	       && (nch == 5)
 	       && validate_name(RCHILD(tree, -5), "def")
 	       && validate_ntype(RCHILD(tree, -4), NAME)
 	       && validate_colon(RCHILD(tree, -2))
 	       && validate_parameters(RCHILD(tree, -3))
 	       && validate_suite(RCHILD(tree, -1)));
-
-    if (ok && (nch == 6))
-	ok = validate_decorators(CHILD(tree, 0));
-
     return ok;
 }
 
 
+/* decorated
+ *   decorators (classdef | funcdef)
+ */
+static int
+validate_decorated(node *tree)
+{
+  int nch = NCH(tree);
+  int ok = (validate_ntype(tree, decorated)
+	    && (nch == 2)
+	    && validate_decorators(RCHILD(tree, -2))
+	    && (validate_funcdef(RCHILD(tree, -1))
+		|| validate_class(RCHILD(tree, -1)))
+	    );
+  return ok;
+}
+
 static int
 validate_lambdef(node *tree)
 {
@@ -2923,6 +2935,9 @@
           case classdef:
             res = validate_class(tree);
             break;
+	  case decorated:
+	    res = validate_decorated(tree);
+	    break;
             /*
              *  "Trivial" parse tree nodes.
              *  (Why did I call these trivial?)

Modified: python/branches/trunk-math/Modules/signalmodule.c
==============================================================================
--- python/branches/trunk-math/Modules/signalmodule.c	(original)
+++ python/branches/trunk-math/Modules/signalmodule.c	Thu Feb 28 21:09:17 2008
@@ -272,6 +272,36 @@
 None -- if an unknown handler is in effect\n\
 anything else -- the callable Python object used as a handler");
 
+#ifdef HAVE_SIGINTERRUPT
+PyDoc_STRVAR(siginterrupt_doc,
+"siginterrupt(sig, flag) -> None\n\
+change system call restart behaviour: if flag is False, system calls\n\
+will be restarted when interrupted by signal sig, else system calls\n\
+will be interrupted.");
+
+static PyObject *
+signal_siginterrupt(PyObject *self, PyObject *args)
+{
+	int sig_num;
+	int flag;
+
+	if (!PyArg_ParseTuple(args, "ii:siginterrupt", &sig_num, &flag))
+		return NULL;
+	if (sig_num < 1 || sig_num >= NSIG) {
+		PyErr_SetString(PyExc_ValueError,
+				"signal number out of range");
+		return NULL;
+	}
+	if (siginterrupt(sig_num, flag)<0) {
+		PyErr_SetFromErrno(PyExc_RuntimeError);
+		return NULL;
+	}
+
+	Py_INCREF(Py_None);
+	return Py_None;
+}
+
+#endif
 
 static PyObject *
 signal_set_wakeup_fd(PyObject *self, PyObject *args)
@@ -325,6 +355,9 @@
 	{"signal",	        signal_signal, METH_VARARGS, signal_doc},
 	{"getsignal",	        signal_getsignal, METH_VARARGS, getsignal_doc},
 	{"set_wakeup_fd",	signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
+#ifdef HAVE_SIGINTERRUPT
+ 	{"siginterrupt",	signal_siginterrupt, METH_VARARGS, siginterrupt_doc},
+#endif
 #ifdef HAVE_PAUSE
 	{"pause",	        (PyCFunction)signal_pause,
 	 METH_NOARGS,pause_doc},

Modified: python/branches/trunk-math/Modules/syslogmodule.c
==============================================================================
--- python/branches/trunk-math/Modules/syslogmodule.c	(original)
+++ python/branches/trunk-math/Modules/syslogmodule.c	Thu Feb 28 21:09:17 2008
@@ -92,7 +92,9 @@
 			return NULL;
 	}
 
+	Py_BEGIN_ALLOW_THREADS;
 	syslog(priority, "%s", message);
+	Py_END_ALLOW_THREADS;
 	Py_INCREF(Py_None);
 	return Py_None;
 }

Modified: python/branches/trunk-math/Objects/abstract.c
==============================================================================
--- python/branches/trunk-math/Objects/abstract.c	(original)
+++ python/branches/trunk-math/Objects/abstract.c	Thu Feb 28 21:09:17 2008
@@ -348,6 +348,138 @@
 	return 0;
 }
 
+PyObject *
+PyObject_Format(PyObject* obj, PyObject *format_spec)
+{
+	static PyObject * str__format__ = NULL;
+	PyObject *empty = NULL;
+	PyObject *result = NULL;
+	int spec_is_unicode;
+	int result_is_unicode;
+
+	/* Initialize cached value */
+	if (str__format__ == NULL) {
+		/* Initialize static variable needed by _PyType_Lookup */
+		str__format__ = PyString_InternFromString("__format__");
+		if (str__format__ == NULL)
+			goto done;
+	}
+
+	/* If no format_spec is provided, use an empty string */
+	if (format_spec == NULL) {
+		empty = PyString_FromStringAndSize(NULL, 0);
+		format_spec = empty;
+	}
+
+	/* Check the format_spec type, and make sure it's str or unicode */
+	if (PyUnicode_Check(format_spec))
+		spec_is_unicode = 1;
+	else if (PyString_Check(format_spec))
+		spec_is_unicode = 0;
+	else {
+		PyErr_Format(PyExc_TypeError,
+			     "format expects arg 2 to be string "
+			     "or unicode, not %.100s", Py_TYPE(format_spec)->tp_name);
+		goto done;
+	}
+
+	/* Make sure the type is initialized.  float gets initialized late */
+	if (Py_TYPE(obj)->tp_dict == NULL)
+		if (PyType_Ready(Py_TYPE(obj)) < 0)
+			goto done;
+
+	/* Check for a __format__ method and call it. */
+	if (PyInstance_Check(obj)) {
+		/* We're an instance of a classic class */
+		PyObject *bound_method = PyObject_GetAttr(obj,
+							  str__format__);
+		if (bound_method != NULL) {
+			result = PyObject_CallFunctionObjArgs(bound_method,
+							      format_spec,
+							      NULL);
+			Py_DECREF(bound_method);
+		} else {
+			PyObject *self_as_str;
+			PyObject *format_method;
+
+			PyErr_Clear();
+			/* Per the PEP, convert to str (or unicode,
+			   depending on the type of the format
+			   specifier).  For new-style classes, this
+			   logic is done by object.__format__(). */
+			if (spec_is_unicode)
+				self_as_str = PyObject_Unicode(obj);
+			else
+				self_as_str = PyObject_Str(obj);
+			if (self_as_str == NULL)
+				goto done;
+
+			/* Then call str.__format__ on that result */
+			format_method = PyObject_GetAttr(self_as_str,
+							 str__format__);
+			if (format_method == NULL) {
+				Py_DECREF(self_as_str);
+				goto done;
+			}
+                        result = PyObject_CallFunctionObjArgs(format_method,
+							      format_spec,
+							      NULL);
+			Py_DECREF(self_as_str);
+			Py_DECREF(format_method);
+			if (result == NULL)
+				goto done;
+                }
+	} else {
+		/* Not an instance of a classic class, use the code
+		   from py3k */
+
+		/* Find the (unbound!) __format__ method (a borrowed
+		   reference) */
+		PyObject *method = _PyType_Lookup(Py_TYPE(obj),
+						  str__format__);
+		if (method == NULL) {
+			PyErr_Format(PyExc_TypeError,
+				     "Type %.100s doesn't define __format__",
+				     Py_TYPE(obj)->tp_name);
+			goto done;
+		}
+		/* And call it, binding it to the value */
+		result = PyObject_CallFunctionObjArgs(method, obj,
+						      format_spec, NULL);
+	}
+
+	if (result == NULL)
+		goto done;
+
+	/* Check the result type, and make sure it's str or unicode */
+	if (PyUnicode_Check(result))
+		result_is_unicode = 1;
+	else if (PyString_Check(result))
+		result_is_unicode = 0;
+	else {
+		PyErr_Format(PyExc_TypeError,
+			     "%.100s.__format__ must return string or "
+			     "unicode, not %.100s", Py_TYPE(obj)->tp_name,
+			     Py_TYPE(result)->tp_name);
+		Py_DECREF(result);
+		result = NULL;
+		goto done;
+	}
+
+	/* Convert to unicode, if needed.  Required if spec is unicode
+	   and result is str */
+	if (spec_is_unicode && !result_is_unicode) {
+		PyObject *tmp = PyObject_Unicode(result);
+		/* This logic works whether or not tmp is NULL */
+		Py_DECREF(result);
+		result = tmp;
+	}
+
+done:
+	Py_XDECREF(empty);
+	return result;
+}
+
 /* Operations on numbers */
 
 int

Modified: python/branches/trunk-math/Objects/cellobject.c
==============================================================================
--- python/branches/trunk-math/Objects/cellobject.c	(original)
+++ python/branches/trunk-math/Objects/cellobject.c	Thu Feb 28 21:09:17 2008
@@ -31,13 +31,15 @@
 int
 PyCell_Set(PyObject *op, PyObject *obj)
 {
+	PyObject* oldobj;
 	if (!PyCell_Check(op)) {
 		PyErr_BadInternalCall();
 		return -1;
 	}
-	Py_XDECREF(((PyCellObject*)op)->ob_ref);
+	oldobj = PyCell_GET(op);
 	Py_XINCREF(obj);
 	PyCell_SET(op, obj);
+	Py_XDECREF(oldobj);
 	return 0;
 }
 

Modified: python/branches/trunk-math/Objects/dictobject.c
==============================================================================
--- python/branches/trunk-math/Objects/dictobject.c	(original)
+++ python/branches/trunk-math/Objects/dictobject.c	Thu Feb 28 21:09:17 2008
@@ -171,8 +171,10 @@
 static void
 show_alloc(void)
 {
-	fprintf(stderr, "Dict allocations: %zd\n", count_alloc);
-	fprintf(stderr, "Dict reuse through freelist: %zd\n", count_reuse);
+	fprintf(stderr, "Dict allocations: %" PY_FORMAT_SIZE_T "d\n",
+		count_alloc);
+	fprintf(stderr, "Dict reuse through freelist: %" PY_FORMAT_SIZE_T
+		"d\n", count_reuse);
 	fprintf(stderr, "%.2f%% reuse rate\n\n",
 		(100.0*count_reuse/(count_alloc+count_reuse)));
 }

Modified: python/branches/trunk-math/Objects/fileobject.c
==============================================================================
--- python/branches/trunk-math/Objects/fileobject.c	(original)
+++ python/branches/trunk-math/Objects/fileobject.c	Thu Feb 28 21:09:17 2008
@@ -1660,9 +1660,9 @@
 }
 
 static PyObject *
-file_exit(PyFileObject *f, PyObject *args)
+file_exit(PyObject *f, PyObject *args)
 {
-	PyObject *ret = file_close(f);
+	PyObject *ret = PyObject_CallMethod(f, "close", NULL);
 	if (!ret)
 		/* If error occurred, pass through */
 		return NULL;

Modified: python/branches/trunk-math/Objects/floatobject.c
==============================================================================
--- python/branches/trunk-math/Objects/floatobject.c	(original)
+++ python/branches/trunk-math/Objects/floatobject.c	Thu Feb 28 21:09:17 2008
@@ -9,6 +9,7 @@
 
 #include <ctype.h>
 #include <float.h>
+#include "formatter_string.h"
 
 /* global NAN and INF objects */
 #ifdef Py_NAN
@@ -1382,6 +1383,46 @@
 	return PyFloat_FromDouble(0.0);
 }
 
+static PyObject *
+float__format__(PyObject *self, PyObject *args)
+{
+	PyObject *format_spec;
+
+	if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
+		return NULL;
+	if (PyString_Check(format_spec))
+		return string_float__format__(self, args);
+	if (PyUnicode_Check(format_spec)) {
+		/* Convert format_spec to a str */
+		PyObject *result = NULL;
+		PyObject *newargs = NULL;
+		PyObject *string_format_spec = NULL;
+
+		string_format_spec = PyObject_Str(format_spec);
+		if (string_format_spec == NULL)
+			goto done;
+
+		newargs = Py_BuildValue("(O)", string_format_spec);
+		if (newargs == NULL)
+			goto done;
+
+		result = string_float__format__(self, newargs);
+
+		done:
+		Py_XDECREF(string_format_spec);
+		Py_XDECREF(newargs);
+		return result;
+	}
+	PyErr_SetString(PyExc_TypeError, "__format__ requires str or unicode");
+	return NULL;
+}
+
+PyDoc_STRVAR(float__format__doc,
+"float.__format__(format_spec) -> string\n"
+"\n"
+"Formats the float according to format_spec.");
+
+
 static PyMethodDef float_methods[] = {
 	{"conjugate",	(PyCFunction)float_float,	METH_NOARGS,
 	 "Returns self, the complex conjugate of any float."},
@@ -1402,6 +1443,8 @@
 	 METH_O|METH_CLASS,		float_getformat_doc},
 	{"__setformat__",	(PyCFunction)float_setformat,	
 	 METH_VARARGS|METH_CLASS,	float_setformat_doc},
+        {"__format__",          (PyCFunction)float__format__,
+         METH_VARARGS,                  float__format__doc},
 	{NULL,		NULL}		/* sentinel */
 };
 

Modified: python/branches/trunk-math/Objects/intobject.c
==============================================================================
--- python/branches/trunk-math/Objects/intobject.c	(original)
+++ python/branches/trunk-math/Objects/intobject.c	Thu Feb 28 21:09:17 2008
@@ -3,6 +3,7 @@
 
 #include "Python.h"
 #include <ctype.h>
+#include "formatter_string.h"
 
 static PyObject *int_int(PyIntObject *v);
 
@@ -1114,6 +1115,40 @@
 	Py_RETURN_TRUE;
 }
 
+static PyObject *
+int__format__(PyObject *self, PyObject *args)
+{
+	PyObject *format_spec;
+
+	if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
+		return NULL;
+	if (PyString_Check(format_spec))
+		return string_int__format__(self, args);
+	if (PyUnicode_Check(format_spec)) {
+		/* Convert format_spec to a str */
+		PyObject *result = NULL;
+		PyObject *newargs = NULL;
+		PyObject *string_format_spec = NULL;
+
+		string_format_spec = PyObject_Str(format_spec);
+		if (string_format_spec == NULL)
+			goto done;
+
+		newargs = Py_BuildValue("(O)", string_format_spec);
+		if (newargs == NULL)
+			goto done;
+
+		result = string_int__format__(self, newargs);
+
+		done:
+		Py_XDECREF(string_format_spec);
+		Py_XDECREF(newargs);
+		return result;
+	}
+	PyErr_SetString(PyExc_TypeError, "__format__ requires str or unicode");
+	return NULL;
+}
+
 static PyMethodDef int_methods[] = {
 	{"conjugate",	(PyCFunction)int_int,	METH_NOARGS,
 	 "Returns self, the complex conjugate of any int."},
@@ -1122,6 +1157,7 @@
 	{"__trunc__",	(PyCFunction)int_int,	METH_NOARGS,
          "Truncating an Integral returns itself."},
 	{"__getnewargs__",	(PyCFunction)int_getnewargs,	METH_NOARGS},
+        {"__format__", (PyCFunction)int__format__, METH_VARARGS},
 	{NULL,		NULL}		/* sentinel */
 };
 

Modified: python/branches/trunk-math/Objects/listobject.c
==============================================================================
--- python/branches/trunk-math/Objects/listobject.c	(original)
+++ python/branches/trunk-math/Objects/listobject.c	Thu Feb 28 21:09:17 2008
@@ -72,8 +72,10 @@
 static void
 show_alloc(void)
 {
-	fprintf(stderr, "List allocations: %zd\n", count_alloc);
-	fprintf(stderr, "List reuse through freelist: %zd\n", count_reuse);
+	fprintf(stderr, "List allocations: %" PY_FORMAT_SIZE_T "d\n",
+		count_alloc);
+	fprintf(stderr, "List reuse through freelist: %" PY_FORMAT_SIZE_T
+		"d\n", count_reuse);
 	fprintf(stderr, "%.2f%% reuse rate\n\n",
 		(100.0*count_reuse/(count_alloc+count_reuse)));
 }

Modified: python/branches/trunk-math/Objects/longobject.c
==============================================================================
--- python/branches/trunk-math/Objects/longobject.c	(original)
+++ python/branches/trunk-math/Objects/longobject.c	Thu Feb 28 21:09:17 2008
@@ -6,6 +6,7 @@
 
 #include "Python.h"
 #include "longintrepr.h"
+#include "formatter_string.h"
 
 #include <ctype.h>
 
@@ -3386,6 +3387,40 @@
 	Py_RETURN_TRUE;
 }
 
+static PyObject *
+long__format__(PyObject *self, PyObject *args)
+{
+	PyObject *format_spec;
+
+	if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
+		return NULL;
+	if (PyString_Check(format_spec))
+		return string_long__format__(self, args);
+	if (PyUnicode_Check(format_spec)) {
+		/* Convert format_spec to a str */
+		PyObject *result = NULL;
+		PyObject *newargs = NULL;
+		PyObject *string_format_spec = NULL;
+
+		string_format_spec = PyObject_Str(format_spec);
+		if (string_format_spec == NULL)
+			goto done;
+
+		newargs = Py_BuildValue("(O)", string_format_spec);
+		if (newargs == NULL)
+			goto done;
+
+		result = string_long__format__(self, newargs);
+
+		done:
+		Py_XDECREF(string_format_spec);
+		Py_XDECREF(newargs);
+		return result;
+	}
+	PyErr_SetString(PyExc_TypeError, "__format__ requires str or unicode");
+	return NULL;
+}
+
 static PyMethodDef long_methods[] = {
 	{"conjugate",	(PyCFunction)long_long,	METH_NOARGS,
 	 "Returns self, the complex conjugate of any long."},
@@ -3394,6 +3429,7 @@
 	{"__trunc__",	(PyCFunction)long_long,	METH_NOARGS,
          "Truncating an Integral returns itself."},
 	{"__getnewargs__",	(PyCFunction)long_getnewargs,	METH_NOARGS},
+        {"__format__", (PyCFunction)long__format__, METH_VARARGS},
 	{NULL,		NULL}		/* sentinel */
 };
 

Modified: python/branches/trunk-math/Objects/stringobject.c
==============================================================================
--- python/branches/trunk-math/Objects/stringobject.c	(original)
+++ python/branches/trunk-math/Objects/stringobject.c	Thu Feb 28 21:09:17 2008
@@ -4,6 +4,8 @@
 
 #include "Python.h"
 
+#include "formatter_string.h"
+
 #include <ctype.h>
 
 #ifdef COUNT_ALLOCS
@@ -771,15 +773,7 @@
 /* -------------------------------------------------------------------- */
 /* Methods */
 
-#define STRINGLIB_CHAR char
-
-#define STRINGLIB_CMP memcmp
-#define STRINGLIB_LEN PyString_GET_SIZE
-#define STRINGLIB_NEW PyString_FromStringAndSize
-#define STRINGLIB_STR PyString_AS_STRING
-
-#define STRINGLIB_EMPTY nullstring
-
+#include "stringlib/stringdefs.h"
 #include "stringlib/fastsearch.h"
 
 #include "stringlib/count.h"
@@ -3910,6 +3904,19 @@
 	return Py_BuildValue("(s#)", v->ob_sval, Py_SIZE(v));
 }
 
+
+#include "stringlib/string_format.h"
+
+PyDoc_STRVAR(format__doc__,
+"S.format(*args, **kwargs) -> unicode\n\
+\n\
+");
+
+PyDoc_STRVAR(p_format__doc__,
+"S.__format__(format_spec) -> unicode\n\
+\n\
+");
+
 
 static PyMethodDef
 string_methods[] = {
@@ -3954,6 +3961,10 @@
 	{"rjust", (PyCFunction)string_rjust, METH_VARARGS, rjust__doc__},
 	{"center", (PyCFunction)string_center, METH_VARARGS, center__doc__},
 	{"zfill", (PyCFunction)string_zfill, METH_VARARGS, zfill__doc__},
+	{"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__},
+	{"__format__", (PyCFunction) string__format__, METH_VARARGS, p_format__doc__},
+	{"_formatter_field_name_split", (PyCFunction) formatter_field_name_split, METH_NOARGS},
+	{"_formatter_parser", (PyCFunction) formatter_parser, METH_NOARGS},
 	{"encode", (PyCFunction)string_encode, METH_VARARGS, encode__doc__},
 	{"decode", (PyCFunction)string_decode, METH_VARARGS, decode__doc__},
 	{"expandtabs", (PyCFunction)string_expandtabs, METH_VARARGS,
@@ -4574,6 +4585,7 @@
 			int prec = -1;
 			int c = '\0';
 			int fill;
+			int isnumok;
 			PyObject *v = NULL;
 			PyObject *temp = NULL;
 			char *pbuf;
@@ -4775,23 +4787,52 @@
 			case 'X':
 				if (c == 'i')
 					c = 'd';
-				if (PyLong_Check(v)) {
-					int ilen;
-					temp = _PyString_FormatLong(v, flags,
-						prec, c, &pbuf, &ilen);
-					len = ilen;
-					if (!temp)
-						goto error;
-					sign = 1;
+				isnumok = 0;
+				if (PyNumber_Check(v)) {
+					PyObject *iobj=NULL;
+
+					if (PyInt_Check(v) || (PyLong_Check(v))) {
+						iobj = v;
+						Py_INCREF(iobj);
+					}
+					else {
+						iobj = PyNumber_Int(v);
+						if (iobj==NULL) iobj = PyNumber_Long(v);
+					}
+					if (iobj!=NULL) {
+						if (PyInt_Check(iobj)) {
+							isnumok = 1;
+							pbuf = formatbuf;
+							len = formatint(pbuf,
+									sizeof(formatbuf),
+									flags, prec, c, iobj);
+							Py_DECREF(iobj);
+							if (len < 0)
+								goto error;
+							sign = 1;
+						}
+						else if (PyLong_Check(iobj)) {
+							int ilen;
+							
+							isnumok = 1;
+							temp = _PyString_FormatLong(iobj, flags,
+								prec, c, &pbuf, &ilen);
+							Py_DECREF(iobj);
+							len = ilen;
+							if (!temp)
+								goto error;
+							sign = 1;
+						}
+						else {
+							Py_DECREF(iobj);
+						}
+					}
 				}
-				else {
-					pbuf = formatbuf;
-					len = formatint(pbuf,
-							sizeof(formatbuf),
-							flags, prec, c, v);
-					if (len < 0)
-						goto error;
-					sign = 1;
+				if (!isnumok) {
+					PyErr_Format(PyExc_TypeError, 
+					    "%%%c format: a number is required, "
+					    "not %.200s", c, Py_TYPE(v)->tp_name);
+					goto error;
 				}
 				if (flags & F_ZERO)
 					fill = '0';

Modified: python/branches/trunk-math/Objects/typeobject.c
==============================================================================
--- python/branches/trunk-math/Objects/typeobject.c	(original)
+++ python/branches/trunk-math/Objects/typeobject.c	Thu Feb 28 21:09:17 2008
@@ -306,6 +306,40 @@
 }
 
 static PyObject *
+type_abstractmethods(PyTypeObject *type, void *context)
+{
+	PyObject *mod = PyDict_GetItemString(type->tp_dict,
+					     "__abstractmethods__");
+	if (!mod) {
+		PyErr_Format(PyExc_AttributeError, "__abstractmethods__");
+		return NULL;
+	}
+	Py_XINCREF(mod);
+	return mod;
+}
+
+static int
+type_set_abstractmethods(PyTypeObject *type, PyObject *value, void *context)
+{
+	/* __abstractmethods__ should only be set once on a type, in
+	   abc.ABCMeta.__new__, so this function doesn't do anything
+	   special to update subclasses.
+	*/
+	int res = PyDict_SetItemString(type->tp_dict,
+				       "__abstractmethods__", value);
+	if (res == 0) {
+		type_modified(type);
+		if (value && PyObject_IsTrue(value)) {
+			type->tp_flags |= Py_TPFLAGS_IS_ABSTRACT;
+		}
+		else {
+			type->tp_flags &= ~Py_TPFLAGS_IS_ABSTRACT;
+		}
+	}
+	return res;
+}
+
+static PyObject *
 type_get_bases(PyTypeObject *type, void *context)
 {
 	Py_INCREF(type->tp_bases);
@@ -542,6 +576,8 @@
 	{"__name__", (getter)type_name, (setter)type_set_name, NULL},
 	{"__bases__", (getter)type_get_bases, (setter)type_set_bases, NULL},
 	{"__module__", (getter)type_module, (setter)type_set_module, NULL},
+	{"__abstractmethods__", (getter)type_abstractmethods,
+	 (setter)type_set_abstractmethods, NULL},
 	{"__dict__",  (getter)type_dict,  NULL, NULL},
 	{"__doc__", (getter)type_get_doc, NULL, NULL},
 	{0}
@@ -2749,6 +2785,56 @@
 	}
 	if (err < 0)
 		return NULL;
+
+	if (type->tp_flags & Py_TPFLAGS_IS_ABSTRACT) {
+		static PyObject *comma = NULL;
+		PyObject *abstract_methods = NULL;
+		PyObject *builtins;
+		PyObject *sorted;
+		PyObject *sorted_methods = NULL;
+		PyObject *joined = NULL;
+		const char *joined_str;
+
+		/* Compute ", ".join(sorted(type.__abstractmethods__))
+		   into joined. */
+		abstract_methods = type_abstractmethods(type, NULL);
+		if (abstract_methods == NULL)
+			goto error;
+		builtins = PyEval_GetBuiltins();
+		if (builtins == NULL)
+			goto error;
+		sorted = PyDict_GetItemString(builtins, "sorted");
+		if (sorted == NULL)
+			goto error;
+		sorted_methods = PyObject_CallFunctionObjArgs(sorted,
+							      abstract_methods,
+							      NULL);
+		if (sorted_methods == NULL)
+			goto error;
+		if (comma == NULL) {
+			comma = PyString_InternFromString(", ");
+			if (comma == NULL)
+				goto error;
+		}
+		joined = PyObject_CallMethod(comma, "join",
+					     "O",  sorted_methods);
+		if (joined == NULL)
+			goto error;
+		joined_str = PyString_AsString(joined);
+		if (joined_str == NULL)
+			goto error;
+
+		PyErr_Format(PyExc_TypeError,
+			     "Can't instantiate abstract class %s "
+			     "with abstract methods %s",
+			     type->tp_name,
+			     joined_str);
+	error:
+		Py_XDECREF(joined);
+		Py_XDECREF(sorted_methods);
+		Py_XDECREF(abstract_methods);
+		return NULL;
+	}
 	return type->tp_alloc(type, 0);
 }
 
@@ -3210,11 +3296,74 @@
 	return _common_reduce(self, proto);
 }
 
+static PyObject *
+object_subclasshook(PyObject *cls, PyObject *args)
+{
+	Py_INCREF(Py_NotImplemented);
+	return Py_NotImplemented;
+}
+
+PyDoc_STRVAR(object_subclasshook_doc,
+"Abstract classes can override this to customize issubclass().\n"
+"\n"
+"This is invoked early on by abc.ABCMeta.__subclasscheck__().\n"
+"It should return True, False or NotImplemented.  If it returns\n"
+"NotImplemented, the normal algorithm is used.  Otherwise, it\n"
+"overrides the normal algorithm (and the outcome is cached).\n");
+
+/*
+   from PEP 3101, this code implements:
+
+   class object:
+       def __format__(self, format_spec):
+           if isinstance(format_spec, str):
+               return format(str(self), format_spec)
+           elif isinstance(format_spec, unicode):
+               return format(unicode(self), format_spec)
+*/
+static PyObject *
+object_format(PyObject *self, PyObject *args)
+{
+        PyObject *format_spec;
+        PyObject *self_as_str = NULL;
+        PyObject *result = NULL;
+        PyObject *format_meth = NULL;
+
+        if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
+                return NULL;
+	if (PyUnicode_Check(format_spec)) {
+	        self_as_str = PyObject_Unicode(self);
+	} else if (PyString_Check(format_spec)) {
+	        self_as_str = PyObject_Str(self);
+	} else {
+	        PyErr_SetString(PyExc_TypeError, "argument to __format__ must be unicode or str");
+	        return NULL;
+	}
+
+        if (self_as_str != NULL) {
+                /* find the format function */
+                format_meth = PyObject_GetAttrString(self_as_str, "__format__");
+                if (format_meth != NULL) {
+                       /* and call it */
+                        result = PyObject_CallFunctionObjArgs(format_meth, format_spec, NULL);
+                }
+        }
+
+        Py_XDECREF(self_as_str);
+        Py_XDECREF(format_meth);
+
+        return result;
+}
+
 static PyMethodDef object_methods[] = {
 	{"__reduce_ex__", object_reduce_ex, METH_VARARGS,
 	 PyDoc_STR("helper for pickle")},
 	{"__reduce__", object_reduce, METH_VARARGS,
 	 PyDoc_STR("helper for pickle")},
+	{"__subclasshook__", object_subclasshook, METH_CLASS | METH_VARARGS,
+	 object_subclasshook_doc},
+        {"__format__", object_format, METH_VARARGS,
+         PyDoc_STR("default object formatter")},
 	{0}
 };
 

Modified: python/branches/trunk-math/Objects/unicodeobject.c
==============================================================================
--- python/branches/trunk-math/Objects/unicodeobject.c	(original)
+++ python/branches/trunk-math/Objects/unicodeobject.c	Thu Feb 28 21:09:17 2008
@@ -42,6 +42,8 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
+#include "formatter_unicode.h"
+
 #include "unicodeobject.h"
 #include "ucnhash.h"
 
@@ -5059,21 +5061,8 @@
 
 /* --- Helpers ------------------------------------------------------------ */
 
-#define STRINGLIB_CHAR Py_UNICODE
-
-#define STRINGLIB_LEN PyUnicode_GET_SIZE
-#define STRINGLIB_NEW PyUnicode_FromUnicode
-#define STRINGLIB_STR PyUnicode_AS_UNICODE
-
-Py_LOCAL_INLINE(int)
-STRINGLIB_CMP(const Py_UNICODE* str, const Py_UNICODE* other, Py_ssize_t len)
-{
-    if (str[0] != other[0])
-        return 1;
-    return memcmp((void*) str, (void*) other, len * sizeof(Py_UNICODE));
-}
+#include "stringlib/unicodedefs.h"
 
-#define STRINGLIB_EMPTY unicode_empty
 #define FROM_UNICODE
 
 #include "stringlib/fastsearch.h"
@@ -7802,6 +7791,19 @@
 }
 
 
+/* Implements do_string_format, which is unicode because of stringlib */
+#include "stringlib/string_format.h"
+
+PyDoc_STRVAR(format__doc__,
+"S.format(*args, **kwargs) -> unicode\n\
+\n\
+");
+
+PyDoc_STRVAR(p_format__doc__,
+"S.__format__(format_spec) -> unicode\n\
+\n\
+");
+
 
 static PyObject *
 unicode_getnewargs(PyUnicodeObject *v)
@@ -7855,6 +7857,10 @@
     {"isalpha", (PyCFunction) unicode_isalpha, METH_NOARGS, isalpha__doc__},
     {"isalnum", (PyCFunction) unicode_isalnum, METH_NOARGS, isalnum__doc__},
     {"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__},
+    {"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__},
+    {"__format__", (PyCFunction) unicode__format__, METH_VARARGS, p_format__doc__},
+    {"_formatter_field_name_split", (PyCFunction) formatter_field_name_split, METH_NOARGS},
+    {"_formatter_parser", (PyCFunction) formatter_parser, METH_NOARGS},
 #if 0
     {"capwords", (PyCFunction) unicode_capwords, METH_NOARGS, capwords__doc__},
 #endif
@@ -8328,6 +8334,7 @@
 	    int prec = -1;
 	    Py_UNICODE c = '\0';
 	    Py_UNICODE fill;
+	    int isnumok;
 	    PyObject *v = NULL;
 	    PyObject *temp = NULL;
 	    Py_UNICODE *pbuf;
@@ -8540,21 +8547,49 @@
 	    case 'X':
 		if (c == 'i')
 		    c = 'd';
-		if (PyLong_Check(v)) {
-		    temp = formatlong(v, flags, prec, c);
-		    if (!temp)
-			goto onError;
-		    pbuf = PyUnicode_AS_UNICODE(temp);
-		    len = PyUnicode_GET_SIZE(temp);
-		    sign = 1;
+		isnumok = 0;
+		if (PyNumber_Check(v)) {
+			PyObject *iobj=NULL;
+
+			if (PyInt_Check(v) || (PyLong_Check(v))) {
+				iobj = v;
+				Py_INCREF(iobj);
+			}
+			else {
+				iobj = PyNumber_Int(v);
+				if (iobj==NULL) iobj = PyNumber_Long(v);
+			}
+			if (iobj!=NULL) {
+				if (PyInt_Check(iobj)) {
+					isnumok = 1;
+					pbuf = formatbuf;
+					len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE),
+						    flags, prec, c, iobj);
+					Py_DECREF(iobj);
+					if (len < 0)
+					    goto onError;
+					sign = 1;
+				} 
+				else if (PyLong_Check(iobj)) {
+					isnumok = 1;
+					temp = formatlong(iobj, flags, prec, c);
+					Py_DECREF(iobj);
+					if (!temp)
+					    goto onError;
+					pbuf = PyUnicode_AS_UNICODE(temp);
+					len = PyUnicode_GET_SIZE(temp);
+					sign = 1;
+				}
+				else {
+					Py_DECREF(iobj);
+				}
+			}
 		}
-		else {
-		    pbuf = formatbuf;
-		    len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE),
-				    flags, prec, c, v);
-		    if (len < 0)
+		if (!isnumok) {
+			PyErr_Format(PyExc_TypeError, 
+			    "%%%c format: a number is required, "
+			    "not %.200s", c, Py_TYPE(v)->tp_name);
 			goto onError;
-		    sign = 1;
 		}
 		if (flags & F_ZERO)
 		    fill = '0';

Modified: python/branches/trunk-math/PC/VC6/pythoncore.dsp
==============================================================================
--- python/branches/trunk-math/PC/VC6/pythoncore.dsp	(original)
+++ python/branches/trunk-math/PC/VC6/pythoncore.dsp	Thu Feb 28 21:09:17 2008
@@ -125,6 +125,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\Modules\_collectionsmodule.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\Modules\_csv.c
 # End Source File
 # Begin Source File
@@ -253,10 +257,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\Modules\collectionsmodule.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\Python\compile.c
 # End Source File
 # Begin Source File
@@ -333,6 +333,14 @@
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\Python\formatter_string.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Python\formatter_unicode.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\Objects\frameobject.c
 # End Source File
 # Begin Source File
@@ -583,10 +591,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\Modules\rgbimgmodule.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\Modules\rotatingtree.c
 # End Source File
 # Begin Source File

Modified: python/branches/trunk-math/PC/VS7.1/pythoncore.vcproj
==============================================================================
--- python/branches/trunk-math/PC/VS7.1/pythoncore.vcproj	(original)
+++ python/branches/trunk-math/PC/VS7.1/pythoncore.vcproj	Thu Feb 28 21:09:17 2008
@@ -515,6 +515,12 @@
 			RelativePath="..\..\Objects\floatobject.c">
 		</File>
 		<File
+			RelativePath="..\..\Python\formatter_string.c">
+		</File>
+		<File
+			RelativePath="..\..\Python\formatter_unicode.c">
+		</File>
+		<File
 			RelativePath="..\..\Objects\frameobject.c">
 		</File>
 		<File

Modified: python/branches/trunk-math/PC/VS8.0/build_tkinter.py
==============================================================================
--- python/branches/trunk-math/PC/VS8.0/build_tkinter.py	(original)
+++ python/branches/trunk-math/PC/VS8.0/build_tkinter.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,6 @@
 
 import os
 import sys
-import shutil
 
 here = os.path.abspath(os.path.dirname(__file__))
 par = os.path.pardir

Modified: python/branches/trunk-math/PC/VS8.0/pythoncore.vcproj
==============================================================================
--- python/branches/trunk-math/PC/VS8.0/pythoncore.vcproj	(original)
+++ python/branches/trunk-math/PC/VS8.0/pythoncore.vcproj	Thu Feb 28 21:09:17 2008
@@ -1627,6 +1627,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Python\formatter_string.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Python\formatter_unicode.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\Python\frozen.c"
 				>
 			</File>

Modified: python/branches/trunk-math/PC/config.c
==============================================================================
--- python/branches/trunk-math/PC/config.c	(original)
+++ python/branches/trunk-math/PC/config.c	Thu Feb 28 21:09:17 2008
@@ -12,6 +12,7 @@
 extern void initbinascii(void);
 extern void initcmath(void);
 extern void initerrno(void);
+extern void initfuture_builtins(void);
 extern void initgc(void);
 #ifndef MS_WINI64
 extern void initimageop(void);
@@ -84,6 +85,7 @@
         {"binascii", initbinascii},
         {"cmath", initcmath},
         {"errno", initerrno},
+        {"future_builtins", initfuture_builtins},
         {"gc", initgc},
 #ifndef MS_WINI64
         {"imageop", initimageop},

Modified: python/branches/trunk-math/PCbuild/build_tkinter.py
==============================================================================
--- python/branches/trunk-math/PCbuild/build_tkinter.py	(original)
+++ python/branches/trunk-math/PCbuild/build_tkinter.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,6 @@
 
 import os
 import sys
-import shutil
 
 here = os.path.abspath(os.path.dirname(__file__))
 par = os.path.pardir

Modified: python/branches/trunk-math/PCbuild/pythoncore.vcproj
==============================================================================
--- python/branches/trunk-math/PCbuild/pythoncore.vcproj	(original)
+++ python/branches/trunk-math/PCbuild/pythoncore.vcproj	Thu Feb 28 21:09:17 2008
@@ -1055,6 +1055,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Modules\future_builtins.c"
+				>
+			</File>
+			<File
 				RelativePath="..\Modules\gcmodule.c"
 				>
 			</File>
@@ -1631,6 +1635,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Python\formatter_string.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Python\formatter_unicode.c"
+				>
+			</File>
+			<File
 				RelativePath="..\Python\frozen.c"
 				>
 			</File>

Modified: python/branches/trunk-math/Parser/Python.asdl
==============================================================================
--- python/branches/trunk-math/Parser/Python.asdl	(original)
+++ python/branches/trunk-math/Parser/Python.asdl	Thu Feb 28 21:09:17 2008
@@ -10,8 +10,8 @@
 	    | Suite(stmt* body)
 
 	stmt = FunctionDef(identifier name, arguments args, 
-                           stmt* body, expr* decorators)
-	      | ClassDef(identifier name, expr* bases, stmt* body)
+                            stmt* body, expr* decorator_list)
+	      | ClassDef(identifier name, expr* bases, stmt* body, expr *decorator_list)
 	      | Return(expr? value)
 
 	      | Delete(expr* targets)

Modified: python/branches/trunk-math/Parser/asdl_c.py
==============================================================================
--- python/branches/trunk-math/Parser/asdl_c.py	(original)
+++ python/branches/trunk-math/Parser/asdl_c.py	Thu Feb 28 21:09:17 2008
@@ -4,7 +4,7 @@
 # TO DO
 # handle fields that have a type but no name
 
-import os, sys, traceback
+import os, sys
 
 import asdl
 

Modified: python/branches/trunk-math/Parser/parser.h
==============================================================================
--- python/branches/trunk-math/Parser/parser.h	(original)
+++ python/branches/trunk-math/Parser/parser.h	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,7 @@
 
 /* Parser interface */
 
-#define MAXSTACK 500
+#define MAXSTACK 1500
 
 typedef struct {
 	int		 s_state;	/* State in current DFA */

Modified: python/branches/trunk-math/Parser/spark.py
==============================================================================
--- python/branches/trunk-math/Parser/spark.py	(original)
+++ python/branches/trunk-math/Parser/spark.py	Thu Feb 28 21:09:17 2008
@@ -22,7 +22,6 @@
 __version__ = 'SPARK-0.7 (pre-alpha-5)'
 
 import re
-import sys
 import string
 
 def _namelist(instance):

Modified: python/branches/trunk-math/Python/Python-ast.c
==============================================================================
--- python/branches/trunk-math/Python/Python-ast.c	(original)
+++ python/branches/trunk-math/Python/Python-ast.c	Thu Feb 28 21:09:17 2008
@@ -42,13 +42,14 @@
         "name",
         "args",
         "body",
-        "decorators",
+        "decorator_list",
 };
 static PyTypeObject *ClassDef_type;
 static char *ClassDef_fields[]={
         "name",
         "bases",
         "body",
+        "decorator_list",
 };
 static PyTypeObject *Return_type;
 static char *Return_fields[]={
@@ -469,7 +470,7 @@
         FunctionDef_type = make_type("FunctionDef", stmt_type,
                                      FunctionDef_fields, 4);
         if (!FunctionDef_type) return 0;
-        ClassDef_type = make_type("ClassDef", stmt_type, ClassDef_fields, 3);
+        ClassDef_type = make_type("ClassDef", stmt_type, ClassDef_fields, 4);
         if (!ClassDef_type) return 0;
         Return_type = make_type("Return", stmt_type, Return_fields, 1);
         if (!Return_type) return 0;
@@ -790,7 +791,7 @@
 
 stmt_ty
 FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq *
-            decorators, int lineno, int col_offset, PyArena *arena)
+            decorator_list, int lineno, int col_offset, PyArena *arena)
 {
         stmt_ty p;
         if (!name) {
@@ -810,15 +811,15 @@
         p->v.FunctionDef.name = name;
         p->v.FunctionDef.args = args;
         p->v.FunctionDef.body = body;
-        p->v.FunctionDef.decorators = decorators;
+        p->v.FunctionDef.decorator_list = decorator_list;
         p->lineno = lineno;
         p->col_offset = col_offset;
         return p;
 }
 
 stmt_ty
-ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int lineno, int
-         col_offset, PyArena *arena)
+ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, asdl_seq *
+         decorator_list, int lineno, int col_offset, PyArena *arena)
 {
         stmt_ty p;
         if (!name) {
@@ -833,6 +834,7 @@
         p->v.ClassDef.name = name;
         p->v.ClassDef.bases = bases;
         p->v.ClassDef.body = body;
+        p->v.ClassDef.decorator_list = decorator_list;
         p->lineno = lineno;
         p->col_offset = col_offset;
         return p;
@@ -1906,9 +1908,11 @@
                 if (PyObject_SetAttrString(result, "body", value) == -1)
                         goto failed;
                 Py_DECREF(value);
-                value = ast2obj_list(o->v.FunctionDef.decorators, ast2obj_expr);
+                value = ast2obj_list(o->v.FunctionDef.decorator_list,
+                                     ast2obj_expr);
                 if (!value) goto failed;
-                if (PyObject_SetAttrString(result, "decorators", value) == -1)
+                if (PyObject_SetAttrString(result, "decorator_list", value) ==
+                    -1)
                         goto failed;
                 Py_DECREF(value);
                 break;
@@ -1930,6 +1934,13 @@
                 if (PyObject_SetAttrString(result, "body", value) == -1)
                         goto failed;
                 Py_DECREF(value);
+                value = ast2obj_list(o->v.ClassDef.decorator_list,
+                                     ast2obj_expr);
+                if (!value) goto failed;
+                if (PyObject_SetAttrString(result, "decorator_list", value) ==
+                    -1)
+                        goto failed;
+                Py_DECREF(value);
                 break;
         case Return_kind:
                 result = PyType_GenericNew(Return_type, NULL, NULL);

Modified: python/branches/trunk-math/Python/ast.c
==============================================================================
--- python/branches/trunk-math/Python/ast.c	(original)
+++ python/branches/trunk-math/Python/ast.c	Thu Feb 28 21:09:17 2008
@@ -29,6 +29,7 @@
 static asdl_seq *ast_for_exprlist(struct compiling *, const node *,
                                   expr_context_ty);
 static expr_ty ast_for_testlist(struct compiling *, const node *);
+static stmt_ty ast_for_classdef(struct compiling *, const node *, asdl_seq *);
 static expr_ty ast_for_testlist_gexp(struct compiling *, const node *);
 
 /* Note different signature for ast_for_call */
@@ -828,27 +829,16 @@
 }
 
 static stmt_ty
-ast_for_funcdef(struct compiling *c, const node *n)
+ast_for_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
 {
-    /* funcdef: 'def' [decorators] NAME parameters ':' suite */
+    /* funcdef: 'def' NAME parameters ':' suite */
     identifier name;
     arguments_ty args;
     asdl_seq *body;
-    asdl_seq *decorator_seq = NULL;
-    int name_i;
+    int name_i = 1;
 
     REQ(n, funcdef);
 
-    if (NCH(n) == 6) { /* decorators are present */
-        decorator_seq = ast_for_decorators(c, CHILD(n, 0));
-        if (!decorator_seq)
-            return NULL;
-        name_i = 2;
-    }
-    else {
-        name_i = 1;
-    }
-
     name = NEW_IDENTIFIER(CHILD(n, name_i));
     if (!name)
         return NULL;
@@ -867,6 +857,36 @@
                        n->n_col_offset, c->c_arena);
 }
 
+static stmt_ty
+ast_for_decorated(struct compiling *c, const node *n)
+{
+    /* decorated: decorators (classdef | funcdef) */
+    stmt_ty thing = NULL;
+    asdl_seq *decorator_seq = NULL;
+
+    REQ(n, decorated);
+
+    decorator_seq = ast_for_decorators(c, CHILD(n, 0));
+    if (!decorator_seq)
+      return NULL;
+
+    assert(TYPE(CHILD(n, 1)) == funcdef ||
+	   TYPE(CHILD(n, 1)) == classdef);
+
+    if (TYPE(CHILD(n, 1)) == funcdef) {
+      thing = ast_for_funcdef(c, CHILD(n, 1), decorator_seq);
+    } else if (TYPE(CHILD(n, 1)) == classdef) {
+      thing = ast_for_classdef(c, CHILD(n, 1), decorator_seq);
+    }
+    /* we count the decorators in when talking about the class' or
+       function's line number */
+    if (thing) {
+        thing->lineno = LINENO(n);
+        thing->col_offset = n->n_col_offset;
+    }
+    return thing;
+}
+
 static expr_ty
 ast_for_lambdef(struct compiling *c, const node *n)
 {
@@ -2968,7 +2988,7 @@
 }
 
 static stmt_ty
-ast_for_classdef(struct compiling *c, const node *n)
+ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
 {
     /* classdef: 'class' NAME ['(' testlist ')'] ':' suite */
     asdl_seq *bases, *s;
@@ -2984,16 +3004,16 @@
         s = ast_for_suite(c, CHILD(n, 3));
         if (!s)
             return NULL;
-        return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, LINENO(n),
-                        n->n_col_offset, c->c_arena);
+        return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, decorator_seq,
+                        LINENO(n), n->n_col_offset, c->c_arena);
     }
     /* check for empty base list */
     if (TYPE(CHILD(n,3)) == RPAR) {
         s = ast_for_suite(c, CHILD(n,5));
         if (!s)
                 return NULL;
-        return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, LINENO(n),
-                        n->n_col_offset, c->c_arena);
+        return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, decorator_seq,
+                        LINENO(n), n->n_col_offset, c->c_arena);
     }
 
     /* else handle the base class list */
@@ -3004,8 +3024,8 @@
     s = ast_for_suite(c, CHILD(n, 6));
     if (!s)
         return NULL;
-    return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), bases, s, LINENO(n),
-                    n->n_col_offset, c->c_arena);
+    return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), bases, s, decorator_seq,
+                    LINENO(n), n->n_col_offset, c->c_arena);
 }
 
 static stmt_ty
@@ -3054,7 +3074,7 @@
     }
     else {
         /* compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt
-                        | funcdef | classdef
+                        | funcdef | classdef | decorated
         */
         node *ch = CHILD(n, 0);
         REQ(n, compound_stmt);
@@ -3070,9 +3090,11 @@
             case with_stmt:
                 return ast_for_with_stmt(c, ch);
             case funcdef:
-                return ast_for_funcdef(c, ch);
+                return ast_for_funcdef(c, ch, NULL);
             case classdef:
-                return ast_for_classdef(c, ch);
+                return ast_for_classdef(c, ch, NULL);
+	    case decorated:
+	        return ast_for_decorated(c, ch);
             default:
                 PyErr_Format(PyExc_SystemError,
                              "unhandled small_stmt: TYPE=%d NCH=%d\n",

Modified: python/branches/trunk-math/Python/bltinmodule.c
==============================================================================
--- python/branches/trunk-math/Python/bltinmodule.c	(original)
+++ python/branches/trunk-math/Python/bltinmodule.c	Thu Feb 28 21:09:17 2008
@@ -166,7 +166,7 @@
 
 	if (Py_Py3kWarningFlag &&
 	    PyErr_Warn(PyExc_DeprecationWarning, 
-		       "apply() not supported in 3.x") < 0)
+		       "apply() not supported in 3.x. Use func(*args, **kwargs).") < 0)
 		return NULL;
 
 	if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict))
@@ -209,11 +209,23 @@
 
 
 static PyObject *
+builtin_bin(PyObject *self, PyObject *v)
+{
+        return PyNumber_ToBase(v, 2);
+}
+
+PyDoc_STRVAR(bin_doc,
+"bin(number) -> string\n\
+\n\
+Return the binary representation of an integer or long integer.");
+
+
+static PyObject *
 builtin_callable(PyObject *self, PyObject *v)
 {
 	if (Py_Py3kWarningFlag &&
 	    PyErr_Warn(PyExc_DeprecationWarning, 
-		       "callable() not supported in 3.x") < 0)
+		       "callable() not supported in 3.x. Use hasattr(o, '__call__').") < 0)
 		return NULL;
 	return PyBool_FromLong((long)PyCallable_Check(v));
 }
@@ -339,6 +351,24 @@
 "or string, return the same type, else return a list.");
 
 static PyObject *
+builtin_format(PyObject *self, PyObject *args)
+{
+	PyObject *value;
+	PyObject *format_spec = NULL;
+
+	if (!PyArg_ParseTuple(args, "O|O:format", &value, &format_spec))
+		return NULL;
+
+	return PyObject_Format(value, format_spec);
+}
+
+PyDoc_STRVAR(format_doc,
+"format(value[, format_spec]) -> string\n\
+\n\
+Returns value.__format__(format_spec)\n\
+format_spec defaults to \"\"");
+
+static PyObject *
 builtin_chr(PyObject *self, PyObject *args)
 {
 	long x;
@@ -654,7 +684,7 @@
 
 	if (Py_Py3kWarningFlag &&
 	    PyErr_Warn(PyExc_DeprecationWarning, 
-		       "execfile() not supported in 3.x") < 0)
+		       "execfile() not supported in 3.x.  Use exec().") < 0)
 		return NULL;
 
 	if (!PyArg_ParseTuple(args, "s|O!O:execfile",
@@ -879,9 +909,15 @@
 	func = PyTuple_GetItem(args, 0);
 	n--;
 
-	if (func == Py_None && n == 1) {
-		/* map(None, S) is the same as list(S). */
-		return PySequence_List(PyTuple_GetItem(args, 1));
+	if (func == Py_None) {
+		if (Py_Py3kWarningFlag &&
+		    PyErr_Warn(PyExc_DeprecationWarning, 
+			       "map(None, ...) not supported in 3.x. Use list(...).") < 0)
+			return NULL;
+		if (n == 1) {
+			/* map(None, S) is the same as list(S). */
+			return PySequence_List(PyTuple_GetItem(args, 1));
+		}
 	}
 
 	/* Get space for sequence descriptors.  Must NULL out the iterator
@@ -2348,6 +2384,7 @@
  	{"all",		builtin_all,        METH_O, all_doc},
  	{"any",		builtin_any,        METH_O, any_doc},
  	{"apply",	builtin_apply,      METH_VARARGS, apply_doc},
+	{"bin",		builtin_bin,	    METH_O, bin_doc},
  	{"callable",	builtin_callable,   METH_O, callable_doc},
  	{"chr",		builtin_chr,        METH_VARARGS, chr_doc},
  	{"cmp",		builtin_cmp,        METH_VARARGS, cmp_doc},
@@ -2359,6 +2396,7 @@
  	{"eval",	builtin_eval,       METH_VARARGS, eval_doc},
  	{"execfile",	builtin_execfile,   METH_VARARGS, execfile_doc},
  	{"filter",	builtin_filter,     METH_VARARGS, filter_doc},
+ 	{"format",	builtin_format,     METH_VARARGS, format_doc},
  	{"getattr",	builtin_getattr,    METH_VARARGS, getattr_doc},
  	{"globals",	(PyCFunction)builtin_globals,    METH_NOARGS, globals_doc},
  	{"hasattr",	builtin_hasattr,    METH_VARARGS, hasattr_doc},

Modified: python/branches/trunk-math/Python/compile.c
==============================================================================
--- python/branches/trunk-math/Python/compile.c	(original)
+++ python/branches/trunk-math/Python/compile.c	Thu Feb 28 21:09:17 2008
@@ -1362,7 +1362,7 @@
 	PyCodeObject *co;
 	PyObject *first_const = Py_None;
 	arguments_ty args = s->v.FunctionDef.args;
-	asdl_seq* decos = s->v.FunctionDef.decorators;
+	asdl_seq* decos = s->v.FunctionDef.decorator_list;
 	stmt_ty st;
 	int i, n, docstring;
 
@@ -1413,9 +1413,14 @@
 static int
 compiler_class(struct compiler *c, stmt_ty s)
 {
-	int n;
+	int n, i;
 	PyCodeObject *co;
 	PyObject *str;
+	asdl_seq* decos = s->v.ClassDef.decorator_list;
+	
+	if (!compiler_decorators(c, decos))
+		return 0;
+
 	/* push class name on stack, needed by BUILD_CLASS */
 	ADDOP_O(c, LOAD_CONST, s->v.ClassDef.name, consts);
 	/* push the tuple of base classes on the stack */
@@ -1461,6 +1466,10 @@
 
 	ADDOP_I(c, CALL_FUNCTION, 0);
 	ADDOP(c, BUILD_CLASS);
+	/* apply decorators */
+	for (i = 0; i < asdl_seq_LEN(decos); i++) {
+		ADDOP_I(c, CALL_FUNCTION, 1);
+	}
 	if (!compiler_nameop(c, s->v.ClassDef.name, Store))
 		return 0;
 	return 1;
@@ -2314,7 +2323,7 @@
 		return compiler_error(c, "can not assign to __debug__");
 	}
 
-mangled = _Py_Mangle(c->u->u_private, name);
+	mangled = _Py_Mangle(c->u->u_private, name);
 	if (!mangled)
 		return 0;
 

Modified: python/branches/trunk-math/Python/getargs.c
==============================================================================
--- python/branches/trunk-math/Python/getargs.c	(original)
+++ python/branches/trunk-math/Python/getargs.c	Thu Feb 28 21:09:17 2008
@@ -154,7 +154,7 @@
 		PyMem_FREE(ptr);
 		return -1;
 	}
-	if(PyList_Append(*freelist, cobj)) {
+	if (PyList_Append(*freelist, cobj)) {
                 PyMem_FREE(ptr);
 		Py_DECREF(cobj);
 		return -1;
@@ -166,8 +166,8 @@
 static int
 cleanreturn(int retval, PyObject *freelist)
 {
-	if(freelist) {
-		if((retval) == 0) {
+	if (freelist) {
+		if (retval == 0) {
 			Py_ssize_t len = PyList_GET_SIZE(freelist), i;
 			for (i = 0; i < len; i++)
                                 PyMem_FREE(PyCObject_AsVoidPtr(
@@ -708,7 +708,7 @@
 	case 'L': {/* PY_LONG_LONG */
 		PY_LONG_LONG *p = va_arg( *p_va, PY_LONG_LONG * );
 		PY_LONG_LONG ival = PyLong_AsLongLong( arg );
-		if( ival == (PY_LONG_LONG)-1 && PyErr_Occurred() ) {
+		if (ival == (PY_LONG_LONG)-1 && PyErr_Occurred() ) {
 			return converterr("long<L>", arg, msgbuf, bufsize);
 		} else {
 			*p = ival;
@@ -998,7 +998,7 @@
 						"(memory error)",
 						arg, msgbuf, bufsize);
 				}
-				if(addcleanup(*buffer, freelist)) {
+				if (addcleanup(*buffer, freelist)) {
 					Py_DECREF(s);
 					return converterr(
 						"(cleanup problem)",
@@ -1043,7 +1043,7 @@
 				return converterr("(memory error)",
 						  arg, msgbuf, bufsize);
 			}
-			if(addcleanup(*buffer, freelist)) {
+			if (addcleanup(*buffer, freelist)) {
 				Py_DECREF(s);
 				return converterr("(cleanup problem)",
 						arg, msgbuf, bufsize);
@@ -1345,6 +1345,7 @@
 	return retval;
 }
 
+#define IS_END_OF_FORMAT(c) (c == '\0' || c == ';' || c == ':')
 
 static int
 vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
@@ -1352,13 +1353,10 @@
 {
 	char msgbuf[512];
 	int levels[32];
-	const char *fname, *message;
-	int min, max;
-	const char *formatsave;
+	const char *fname, *msg, *custom_msg, *keyword;
+	int min = INT_MAX;
 	int i, len, nargs, nkeywords;
-	const char *msg;
-	char **p;
-	PyObject *freelist = NULL;
+	PyObject *freelist = NULL, *current_arg;
 
 	assert(args != NULL && PyTuple_Check(args));
 	assert(keywords == NULL || PyDict_Check(keywords));
@@ -1366,168 +1364,108 @@
 	assert(kwlist != NULL);
 	assert(p_va != NULL);
 
-	/* Search the format:
-	   message <- error msg, if any (else NULL).
-	   fname <- routine name, if any (else NULL).
-	   min <- # of required arguments, or -1 if all are required.
-	   max <- most arguments (required + optional).
-	   Check that kwlist has a non-NULL entry for each arg.
-	   Raise error if a tuple arg spec is found.
-	*/
-	fname = message = NULL;
-	formatsave = format;
-	p = kwlist;
-	min = -1;
-	max = 0;
-	while ((i = *format++) != '\0') {
-		if (isalpha(Py_CHARMASK(i)) && i != 'e') {
-			max++;
-			if (*p == NULL) {
-				PyErr_SetString(PyExc_RuntimeError,
-					"more argument specifiers than "
-					"keyword list entries");
-				return 0;
-			}
-			p++;
-		}
-		else if (i == '|')
-			min = max;
-		else if (i == ':') {
-			fname = format;
-			break;
-		}
-		else if (i == ';') {
-			message = format;
-			break;
-		}
-		else if (i == '(') {
-			PyErr_SetString(PyExc_RuntimeError,
-				"tuple found in format when using keyword "
-				"arguments");
-			return 0;
-		}
-	}
-	format = formatsave;
-	if (*p != NULL) {
-		PyErr_SetString(PyExc_RuntimeError,
-			"more keyword list entries than "
-			"argument specifiers");
-		return 0;
-	}
-	if (min < 0) {
-		/* All arguments are required. */
-		min = max;
+	/* grab the function name or custom error msg first (mutually exclusive) */
+	fname = strchr(format, ':');
+	if (fname) {
+		fname++;
+		custom_msg = NULL;
 	}
-
-	nargs = PyTuple_GET_SIZE(args);
-	nkeywords = keywords == NULL ? 0 : PyDict_Size(keywords);
-
-	/* make sure there are no duplicate values for an argument;
-	   its not clear when to use the term "keyword argument vs. 
-	   keyword parameter in messages */
-	if (nkeywords > 0) {
-		for (i = 0; i < nargs; i++) {
-			const char *thiskw = kwlist[i];
-			if (thiskw == NULL)
-				break;
-			if (PyDict_GetItemString(keywords, thiskw)) {
-				PyErr_Format(PyExc_TypeError,
-					"keyword parameter '%s' was given "
-					"by position and by name",
-					thiskw);
-				return 0;
-			}
-			else if (PyErr_Occurred())
-				return 0;
-		}
+	else {
+		custom_msg = strchr(format,';');
+		if (custom_msg)
+			custom_msg++;
 	}
 
-	/* required arguments missing from args can be supplied by keyword 
-	   arguments; set len to the number of positional arguments, and,
-	   if that's less than the minimum required, add in the number of
-	   required arguments that are supplied by keywords */
-	len = nargs;
-	if (nkeywords > 0 && nargs < min) {
-		for (i = nargs; i < min; i++) {
-			if (PyDict_GetItemString(keywords, kwlist[i]))
-				len++;
-			else if (PyErr_Occurred())
-				return 0;
-		}
-	}
+	/* scan kwlist and get greatest possible nbr of args */
+	for (len=0; kwlist[len]; len++)
+		continue;
 
-	/* make sure we got an acceptable number of arguments; the message
-	   is a little confusing with keywords since keyword arguments
-	   which are supplied, but don't match the required arguments
-	   are not included in the "%d given" part of the message 
-	   XXX and this isn't a bug!? */
-	if (len < min || max < len) {
-		if (message == NULL) {
-			PyOS_snprintf(msgbuf, sizeof(msgbuf),
-				      "%.200s%s takes %s %d argument%s "
-				      "(%d given)",
-				      fname==NULL ? "function" : fname,
-				      fname==NULL ? "" : "()",
-				      min==max ? "exactly"
-			              : len < min ? "at least" : "at most",
-				      len < min ? min : max,
-				      (len < min ? min : max) == 1 ? "" : "s",
-				      len);
-			message = msgbuf;
-		}
-		PyErr_SetString(PyExc_TypeError, message);
+	nargs = PyTuple_GET_SIZE(args);
+	nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords);
+	if (nargs + nkeywords > len) {
+		PyErr_Format(PyExc_TypeError, "%s%s takes at most %d "
+			     "argument%s (%d given)",
+			     (fname == NULL) ? "function" : fname,
+			     (fname == NULL) ? "" : "()",
+			     len,
+			     (len == 1) ? "" : "s",
+			     nargs + nkeywords);
 		return 0;
 	}
 
-	/* convert the positional arguments */
-	for (i = 0; i < nargs; i++) {
-		if (*format == '|')
+	/* convert tuple args and keyword args in same loop, using kwlist to drive process */
+	for (i = 0; i < len; i++) {
+		keyword = kwlist[i];
+		if (*format == '|') {
+			min = i;
 			format++;
-		msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va,
-				  flags, levels, msgbuf, sizeof(msgbuf), 
-				  &freelist);
-		if (msg) {
-			seterror(i+1, msg, levels, fname, message);
+		}
+		if (IS_END_OF_FORMAT(*format)) {
+			PyErr_Format(PyExc_RuntimeError,
+				     "More keyword list entries (%d) than "
+				     "format specifiers (%d)", len, i);
 			return cleanreturn(0, freelist);
 		}
-	}
-
-	/* handle no keyword parameters in call */	
-	if (nkeywords == 0)
-		return cleanreturn(1, freelist);
-
-	/* convert the keyword arguments; this uses the format 
-	   string where it was left after processing args */
-	for (i = nargs; i < max; i++) {
-		PyObject *item;
-		if (*format == '|')
-			format++;
-		item = PyDict_GetItemString(keywords, kwlist[i]);
-		if (item != NULL) {
-			Py_INCREF(item);
-			msg = convertitem(item, &format, p_va, flags, levels, 
-					  msgbuf, sizeof(msgbuf), &freelist);
-			Py_DECREF(item);
-			if (msg) {
-				seterror(i+1, msg, levels, fname, message);
+		current_arg = NULL;
+		if (nkeywords) {
+			current_arg = PyDict_GetItemString(keywords, keyword);
+		}
+		if (current_arg) {
+			--nkeywords;
+			if (i < nargs) {
+				/* arg present in tuple and in dict */
+				PyErr_Format(PyExc_TypeError,
+					     "Argument given by name ('%s') "
+					     "and position (%d)",
+					     keyword, i+1);
 				return cleanreturn(0, freelist);
 			}
-			--nkeywords;
-			if (nkeywords == 0)
-				break;
 		}
-		else if (PyErr_Occurred())
+		else if (nkeywords && PyErr_Occurred())
 			return cleanreturn(0, freelist);
-		else {
-			msg = skipitem(&format, p_va, flags);
+		else if (i < nargs)
+			current_arg = PyTuple_GET_ITEM(args, i);
+			
+		if (current_arg) {
+			msg = convertitem(current_arg, &format, p_va, flags,
+				levels, msgbuf, sizeof(msgbuf), &freelist);
 			if (msg) {
-				levels[0] = 0;
-				seterror(i+1, msg, levels, fname, message);
+				seterror(i+1, msg, levels, fname, custom_msg);
 				return cleanreturn(0, freelist);
 			}
+			continue;
+		}
+
+		if (i < min) {
+			PyErr_Format(PyExc_TypeError, "Required argument "
+				     "'%s' (pos %d) not found",
+				     keyword, i+1);
+			return cleanreturn(0, freelist);
+		}
+		/* current code reports success when all required args
+		 * fulfilled and no keyword args left, with no further
+		 * validation. XXX Maybe skip this in debug build ?
+		 */
+		if (!nkeywords)
+			return cleanreturn(1, freelist);
+
+		/* We are into optional args, skip thru to any remaining
+		 * keyword args */
+		msg = skipitem(&format, p_va, flags);
+		if (msg) {
+			PyErr_Format(PyExc_RuntimeError, "%s: '%s'", msg,
+				     format);
+			return cleanreturn(0, freelist);
 		}
 	}
 
+	if (!IS_END_OF_FORMAT(*format)) {
+		PyErr_Format(PyExc_RuntimeError,
+			"more argument specifiers than keyword list entries "
+			"(remaining format:'%s')", format);
+		return cleanreturn(0, freelist);
+	}
+
 	/* make sure there are no extraneous keyword arguments */
 	if (nkeywords > 0) {
 		PyObject *key, *value;
@@ -1541,7 +1479,7 @@
 				return cleanreturn(0, freelist);
 			}
 			ks = PyString_AsString(key);
-			for (i = 0; i < max; i++) {
+			for (i = 0; i < len; i++) {
 				if (!strcmp(ks, kwlist[i])) {
 					match = 1;
 					break;
@@ -1564,7 +1502,7 @@
 static char *
 skipitem(const char **p_format, va_list *p_va, int flags)
 {
-        const char *format = *p_format;
+	const char *format = *p_format;
 	char c = *format++;
 	
 	switch (c) {
@@ -1671,16 +1609,33 @@
 			}
 			break;
 		}
-	
+
+	case '(':	/* bypass tuple, not handled at all previously */
+		{
+			char *msg;
+			for (;;) {
+				if (*format==')')
+					break;
+				if (IS_END_OF_FORMAT(*format))
+					return "Unmatched left paren in format "
+					       "string";
+				msg = skipitem(&format, p_va, flags);
+				if (msg)
+					return msg;
+			}
+			format++;
+			break;
+		}
+
+	case ')':
+		return "Unmatched right paren in format string";
+
 	default:
 err:
 		return "impossible<bad format char>";
 	
 	}
 
-	/* The "(...)" format code for tuples is not handled here because
-	 * it is not allowed with keyword args. */
-	
 	*p_format = format;
 	return NULL;
 }

Modified: python/branches/trunk-math/Python/graminit.c
==============================================================================
--- python/branches/trunk-math/Python/graminit.c	(original)
+++ python/branches/trunk-math/Python/graminit.c	Thu Feb 28 21:09:17 2008
@@ -86,176 +86,184 @@
 	{1, arcs_4_0},
 	{2, arcs_4_1},
 };
-static arc arcs_5_0[2] = {
+static arc arcs_5_0[1] = {
 	{16, 1},
-	{18, 2},
 };
-static arc arcs_5_1[1] = {
+static arc arcs_5_1[2] = {
 	{18, 2},
+	{19, 2},
 };
 static arc arcs_5_2[1] = {
-	{19, 3},
-};
-static arc arcs_5_3[1] = {
-	{20, 4},
-};
-static arc arcs_5_4[1] = {
-	{21, 5},
-};
-static arc arcs_5_5[1] = {
-	{22, 6},
-};
-static arc arcs_5_6[1] = {
-	{0, 6},
+	{0, 2},
 };
-static state states_5[7] = {
-	{2, arcs_5_0},
-	{1, arcs_5_1},
+static state states_5[3] = {
+	{1, arcs_5_0},
+	{2, arcs_5_1},
 	{1, arcs_5_2},
-	{1, arcs_5_3},
-	{1, arcs_5_4},
-	{1, arcs_5_5},
-	{1, arcs_5_6},
 };
 static arc arcs_6_0[1] = {
-	{13, 1},
+	{20, 1},
 };
-static arc arcs_6_1[2] = {
-	{23, 2},
-	{15, 3},
+static arc arcs_6_1[1] = {
+	{21, 2},
 };
 static arc arcs_6_2[1] = {
-	{15, 3},
+	{22, 3},
 };
 static arc arcs_6_3[1] = {
-	{0, 3},
+	{23, 4},
 };
-static state states_6[4] = {
+static arc arcs_6_4[1] = {
+	{24, 5},
+};
+static arc arcs_6_5[1] = {
+	{0, 5},
+};
+static state states_6[6] = {
 	{1, arcs_6_0},
-	{2, arcs_6_1},
+	{1, arcs_6_1},
 	{1, arcs_6_2},
 	{1, arcs_6_3},
+	{1, arcs_6_4},
+	{1, arcs_6_5},
 };
-static arc arcs_7_0[3] = {
-	{24, 1},
-	{28, 2},
-	{29, 3},
+static arc arcs_7_0[1] = {
+	{13, 1},
 };
-static arc arcs_7_1[3] = {
-	{25, 4},
-	{27, 5},
-	{0, 1},
+static arc arcs_7_1[2] = {
+	{25, 2},
+	{15, 3},
 };
 static arc arcs_7_2[1] = {
-	{19, 6},
+	{15, 3},
 };
 static arc arcs_7_3[1] = {
-	{19, 7},
+	{0, 3},
+};
+static state states_7[4] = {
+	{1, arcs_7_0},
+	{2, arcs_7_1},
+	{1, arcs_7_2},
+	{1, arcs_7_3},
 };
-static arc arcs_7_4[1] = {
-	{26, 8},
+static arc arcs_8_0[3] = {
+	{26, 1},
+	{30, 2},
+	{31, 3},
 };
-static arc arcs_7_5[4] = {
-	{24, 1},
-	{28, 2},
-	{29, 3},
+static arc arcs_8_1[3] = {
+	{27, 4},
+	{29, 5},
+	{0, 1},
+};
+static arc arcs_8_2[1] = {
+	{21, 6},
+};
+static arc arcs_8_3[1] = {
+	{21, 7},
+};
+static arc arcs_8_4[1] = {
+	{28, 8},
+};
+static arc arcs_8_5[4] = {
+	{26, 1},
+	{30, 2},
+	{31, 3},
 	{0, 5},
 };
-static arc arcs_7_6[2] = {
-	{27, 9},
+static arc arcs_8_6[2] = {
+	{29, 9},
 	{0, 6},
 };
-static arc arcs_7_7[1] = {
+static arc arcs_8_7[1] = {
 	{0, 7},
 };
-static arc arcs_7_8[2] = {
-	{27, 5},
+static arc arcs_8_8[2] = {
+	{29, 5},
 	{0, 8},
 };
-static arc arcs_7_9[1] = {
-	{29, 3},
+static arc arcs_8_9[1] = {
+	{31, 3},
 };
-static state states_7[10] = {
-	{3, arcs_7_0},
-	{3, arcs_7_1},
-	{1, arcs_7_2},
-	{1, arcs_7_3},
-	{1, arcs_7_4},
-	{4, arcs_7_5},
-	{2, arcs_7_6},
-	{1, arcs_7_7},
-	{2, arcs_7_8},
-	{1, arcs_7_9},
+static state states_8[10] = {
+	{3, arcs_8_0},
+	{3, arcs_8_1},
+	{1, arcs_8_2},
+	{1, arcs_8_3},
+	{1, arcs_8_4},
+	{4, arcs_8_5},
+	{2, arcs_8_6},
+	{1, arcs_8_7},
+	{2, arcs_8_8},
+	{1, arcs_8_9},
 };
-static arc arcs_8_0[2] = {
-	{19, 1},
+static arc arcs_9_0[2] = {
+	{21, 1},
 	{13, 2},
 };
-static arc arcs_8_1[1] = {
+static arc arcs_9_1[1] = {
 	{0, 1},
 };
-static arc arcs_8_2[1] = {
-	{30, 3},
+static arc arcs_9_2[1] = {
+	{32, 3},
 };
-static arc arcs_8_3[1] = {
+static arc arcs_9_3[1] = {
 	{15, 1},
 };
-static state states_8[4] = {
-	{2, arcs_8_0},
-	{1, arcs_8_1},
-	{1, arcs_8_2},
-	{1, arcs_8_3},
+static state states_9[4] = {
+	{2, arcs_9_0},
+	{1, arcs_9_1},
+	{1, arcs_9_2},
+	{1, arcs_9_3},
 };
-static arc arcs_9_0[1] = {
-	{24, 1},
+static arc arcs_10_0[1] = {
+	{26, 1},
 };
-static arc arcs_9_1[2] = {
-	{27, 2},
+static arc arcs_10_1[2] = {
+	{29, 2},
 	{0, 1},
 };
-static arc arcs_9_2[2] = {
-	{24, 1},
+static arc arcs_10_2[2] = {
+	{26, 1},
 	{0, 2},
 };
-static state states_9[3] = {
-	{1, arcs_9_0},
-	{2, arcs_9_1},
-	{2, arcs_9_2},
+static state states_10[3] = {
+	{1, arcs_10_0},
+	{2, arcs_10_1},
+	{2, arcs_10_2},
 };
-static arc arcs_10_0[2] = {
+static arc arcs_11_0[2] = {
 	{3, 1},
 	{4, 1},
 };
-static arc arcs_10_1[1] = {
+static arc arcs_11_1[1] = {
 	{0, 1},
 };
-static state states_10[2] = {
-	{2, arcs_10_0},
-	{1, arcs_10_1},
+static state states_11[2] = {
+	{2, arcs_11_0},
+	{1, arcs_11_1},
 };
-static arc arcs_11_0[1] = {
-	{31, 1},
+static arc arcs_12_0[1] = {
+	{33, 1},
 };
-static arc arcs_11_1[2] = {
-	{32, 2},
+static arc arcs_12_1[2] = {
+	{34, 2},
 	{2, 3},
 };
-static arc arcs_11_2[2] = {
-	{31, 1},
+static arc arcs_12_2[2] = {
+	{33, 1},
 	{2, 3},
 };
-static arc arcs_11_3[1] = {
+static arc arcs_12_3[1] = {
 	{0, 3},
 };
-static state states_11[4] = {
-	{1, arcs_11_0},
-	{2, arcs_11_1},
-	{2, arcs_11_2},
-	{1, arcs_11_3},
+static state states_12[4] = {
+	{1, arcs_12_0},
+	{2, arcs_12_1},
+	{2, arcs_12_2},
+	{1, arcs_12_3},
 };
-static arc arcs_12_0[9] = {
-	{33, 1},
-	{34, 1},
+static arc arcs_13_0[9] = {
 	{35, 1},
 	{36, 1},
 	{37, 1},
@@ -263,48 +271,48 @@
 	{39, 1},
 	{40, 1},
 	{41, 1},
+	{42, 1},
+	{43, 1},
 };
-static arc arcs_12_1[1] = {
+static arc arcs_13_1[1] = {
 	{0, 1},
 };
-static state states_12[2] = {
-	{9, arcs_12_0},
-	{1, arcs_12_1},
+static state states_13[2] = {
+	{9, arcs_13_0},
+	{1, arcs_13_1},
 };
-static arc arcs_13_0[1] = {
+static arc arcs_14_0[1] = {
 	{9, 1},
 };
-static arc arcs_13_1[3] = {
-	{42, 2},
-	{25, 3},
+static arc arcs_14_1[3] = {
+	{44, 2},
+	{27, 3},
 	{0, 1},
 };
-static arc arcs_13_2[2] = {
-	{43, 4},
+static arc arcs_14_2[2] = {
+	{45, 4},
 	{9, 4},
 };
-static arc arcs_13_3[2] = {
-	{43, 5},
+static arc arcs_14_3[2] = {
+	{45, 5},
 	{9, 5},
 };
-static arc arcs_13_4[1] = {
+static arc arcs_14_4[1] = {
 	{0, 4},
 };
-static arc arcs_13_5[2] = {
-	{25, 3},
+static arc arcs_14_5[2] = {
+	{27, 3},
 	{0, 5},
 };
-static state states_13[6] = {
-	{1, arcs_13_0},
-	{3, arcs_13_1},
-	{2, arcs_13_2},
-	{2, arcs_13_3},
-	{1, arcs_13_4},
-	{2, arcs_13_5},
+static state states_14[6] = {
+	{1, arcs_14_0},
+	{3, arcs_14_1},
+	{2, arcs_14_2},
+	{2, arcs_14_3},
+	{1, arcs_14_4},
+	{2, arcs_14_5},
 };
-static arc arcs_14_0[12] = {
-	{44, 1},
-	{45, 1},
+static arc arcs_15_0[12] = {
 	{46, 1},
 	{47, 1},
 	{48, 1},
@@ -315,109 +323,101 @@
 	{53, 1},
 	{54, 1},
 	{55, 1},
+	{56, 1},
+	{57, 1},
 };
-static arc arcs_14_1[1] = {
+static arc arcs_15_1[1] = {
 	{0, 1},
 };
-static state states_14[2] = {
-	{12, arcs_14_0},
-	{1, arcs_14_1},
+static state states_15[2] = {
+	{12, arcs_15_0},
+	{1, arcs_15_1},
 };
-static arc arcs_15_0[1] = {
-	{56, 1},
+static arc arcs_16_0[1] = {
+	{58, 1},
 };
-static arc arcs_15_1[3] = {
-	{26, 2},
-	{57, 3},
+static arc arcs_16_1[3] = {
+	{28, 2},
+	{59, 3},
 	{0, 1},
 };
-static arc arcs_15_2[2] = {
-	{27, 4},
+static arc arcs_16_2[2] = {
+	{29, 4},
 	{0, 2},
 };
-static arc arcs_15_3[1] = {
-	{26, 5},
+static arc arcs_16_3[1] = {
+	{28, 5},
 };
-static arc arcs_15_4[2] = {
-	{26, 2},
+static arc arcs_16_4[2] = {
+	{28, 2},
 	{0, 4},
 };
-static arc arcs_15_5[2] = {
-	{27, 6},
+static arc arcs_16_5[2] = {
+	{29, 6},
 	{0, 5},
 };
-static arc arcs_15_6[1] = {
-	{26, 7},
+static arc arcs_16_6[1] = {
+	{28, 7},
 };
-static arc arcs_15_7[2] = {
-	{27, 8},
+static arc arcs_16_7[2] = {
+	{29, 8},
 	{0, 7},
 };
-static arc arcs_15_8[2] = {
-	{26, 7},
+static arc arcs_16_8[2] = {
+	{28, 7},
 	{0, 8},
 };
-static state states_15[9] = {
-	{1, arcs_15_0},
-	{3, arcs_15_1},
-	{2, arcs_15_2},
-	{1, arcs_15_3},
-	{2, arcs_15_4},
-	{2, arcs_15_5},
-	{1, arcs_15_6},
-	{2, arcs_15_7},
-	{2, arcs_15_8},
-};
-static arc arcs_16_0[1] = {
-	{58, 1},
-};
-static arc arcs_16_1[1] = {
-	{59, 2},
-};
-static arc arcs_16_2[1] = {
-	{0, 2},
-};
-static state states_16[3] = {
+static state states_16[9] = {
 	{1, arcs_16_0},
-	{1, arcs_16_1},
-	{1, arcs_16_2},
+	{3, arcs_16_1},
+	{2, arcs_16_2},
+	{1, arcs_16_3},
+	{2, arcs_16_4},
+	{2, arcs_16_5},
+	{1, arcs_16_6},
+	{2, arcs_16_7},
+	{2, arcs_16_8},
 };
 static arc arcs_17_0[1] = {
 	{60, 1},
 };
 static arc arcs_17_1[1] = {
-	{0, 1},
+	{61, 2},
 };
-static state states_17[2] = {
+static arc arcs_17_2[1] = {
+	{0, 2},
+};
+static state states_17[3] = {
 	{1, arcs_17_0},
 	{1, arcs_17_1},
+	{1, arcs_17_2},
 };
-static arc arcs_18_0[5] = {
-	{61, 1},
+static arc arcs_18_0[1] = {
 	{62, 1},
-	{63, 1},
-	{64, 1},
-	{65, 1},
 };
 static arc arcs_18_1[1] = {
 	{0, 1},
 };
 static state states_18[2] = {
-	{5, arcs_18_0},
+	{1, arcs_18_0},
 	{1, arcs_18_1},
 };
-static arc arcs_19_0[1] = {
+static arc arcs_19_0[5] = {
+	{63, 1},
+	{64, 1},
+	{65, 1},
 	{66, 1},
+	{67, 1},
 };
 static arc arcs_19_1[1] = {
 	{0, 1},
 };
 static state states_19[2] = {
-	{1, arcs_19_0},
+	{5, arcs_19_0},
 	{1, arcs_19_1},
 };
 static arc arcs_20_0[1] = {
-	{67, 1},
+	{68, 1},
 };
 static arc arcs_20_1[1] = {
 	{0, 1},
@@ -427,155 +427,146 @@
 	{1, arcs_20_1},
 };
 static arc arcs_21_0[1] = {
-	{68, 1},
+	{69, 1},
 };
-static arc arcs_21_1[2] = {
-	{9, 2},
+static arc arcs_21_1[1] = {
 	{0, 1},
 };
-static arc arcs_21_2[1] = {
-	{0, 2},
-};
-static state states_21[3] = {
+static state states_21[2] = {
 	{1, arcs_21_0},
-	{2, arcs_21_1},
-	{1, arcs_21_2},
+	{1, arcs_21_1},
 };
 static arc arcs_22_0[1] = {
-	{43, 1},
+	{70, 1},
 };
-static arc arcs_22_1[1] = {
+static arc arcs_22_1[2] = {
+	{9, 2},
 	{0, 1},
 };
-static state states_22[2] = {
+static arc arcs_22_2[1] = {
+	{0, 2},
+};
+static state states_22[3] = {
 	{1, arcs_22_0},
-	{1, arcs_22_1},
+	{2, arcs_22_1},
+	{1, arcs_22_2},
 };
 static arc arcs_23_0[1] = {
-	{69, 1},
+	{45, 1},
 };
-static arc arcs_23_1[2] = {
-	{26, 2},
+static arc arcs_23_1[1] = {
 	{0, 1},
 };
-static arc arcs_23_2[2] = {
-	{27, 3},
-	{0, 2},
+static state states_23[2] = {
+	{1, arcs_23_0},
+	{1, arcs_23_1},
 };
-static arc arcs_23_3[1] = {
-	{26, 4},
+static arc arcs_24_0[1] = {
+	{71, 1},
 };
-static arc arcs_23_4[2] = {
-	{27, 5},
-	{0, 4},
+static arc arcs_24_1[2] = {
+	{28, 2},
+	{0, 1},
 };
-static arc arcs_23_5[1] = {
-	{26, 6},
+static arc arcs_24_2[2] = {
+	{29, 3},
+	{0, 2},
 };
-static arc arcs_23_6[1] = {
-	{0, 6},
+static arc arcs_24_3[1] = {
+	{28, 4},
 };
-static state states_23[7] = {
-	{1, arcs_23_0},
-	{2, arcs_23_1},
-	{2, arcs_23_2},
-	{1, arcs_23_3},
-	{2, arcs_23_4},
-	{1, arcs_23_5},
-	{1, arcs_23_6},
+static arc arcs_24_4[2] = {
+	{29, 5},
+	{0, 4},
 };
-static arc arcs_24_0[2] = {
-	{70, 1},
-	{71, 1},
+static arc arcs_24_5[1] = {
+	{28, 6},
 };
-static arc arcs_24_1[1] = {
-	{0, 1},
+static arc arcs_24_6[1] = {
+	{0, 6},
 };
-static state states_24[2] = {
-	{2, arcs_24_0},
-	{1, arcs_24_1},
+static state states_24[7] = {
+	{1, arcs_24_0},
+	{2, arcs_24_1},
+	{2, arcs_24_2},
+	{1, arcs_24_3},
+	{2, arcs_24_4},
+	{1, arcs_24_5},
+	{1, arcs_24_6},
 };
-static arc arcs_25_0[1] = {
+static arc arcs_25_0[2] = {
 	{72, 1},
+	{73, 1},
 };
 static arc arcs_25_1[1] = {
-	{73, 2},
-};
-static arc arcs_25_2[1] = {
-	{0, 2},
+	{0, 1},
 };
-static state states_25[3] = {
-	{1, arcs_25_0},
+static state states_25[2] = {
+	{2, arcs_25_0},
 	{1, arcs_25_1},
-	{1, arcs_25_2},
 };
 static arc arcs_26_0[1] = {
 	{74, 1},
 };
-static arc arcs_26_1[2] = {
+static arc arcs_26_1[1] = {
 	{75, 2},
+};
+static arc arcs_26_2[1] = {
+	{0, 2},
+};
+static state states_26[3] = {
+	{1, arcs_26_0},
+	{1, arcs_26_1},
+	{1, arcs_26_2},
+};
+static arc arcs_27_0[1] = {
+	{76, 1},
+};
+static arc arcs_27_1[2] = {
+	{77, 2},
 	{12, 3},
 };
-static arc arcs_26_2[3] = {
-	{75, 2},
+static arc arcs_27_2[3] = {
+	{77, 2},
 	{12, 3},
-	{72, 4},
+	{74, 4},
 };
-static arc arcs_26_3[1] = {
-	{72, 4},
+static arc arcs_27_3[1] = {
+	{74, 4},
 };
-static arc arcs_26_4[3] = {
-	{28, 5},
+static arc arcs_27_4[3] = {
+	{30, 5},
 	{13, 6},
-	{76, 5},
+	{78, 5},
 };
-static arc arcs_26_5[1] = {
+static arc arcs_27_5[1] = {
 	{0, 5},
 };
-static arc arcs_26_6[1] = {
-	{76, 7},
+static arc arcs_27_6[1] = {
+	{78, 7},
 };
-static arc arcs_26_7[1] = {
+static arc arcs_27_7[1] = {
 	{15, 5},
 };
-static state states_26[8] = {
-	{1, arcs_26_0},
-	{2, arcs_26_1},
-	{3, arcs_26_2},
-	{1, arcs_26_3},
-	{3, arcs_26_4},
-	{1, arcs_26_5},
-	{1, arcs_26_6},
-	{1, arcs_26_7},
-};
-static arc arcs_27_0[1] = {
-	{19, 1},
-};
-static arc arcs_27_1[2] = {
-	{78, 2},
-	{0, 1},
-};
-static arc arcs_27_2[1] = {
-	{19, 3},
-};
-static arc arcs_27_3[1] = {
-	{0, 3},
-};
-static state states_27[4] = {
+static state states_27[8] = {
 	{1, arcs_27_0},
 	{2, arcs_27_1},
-	{1, arcs_27_2},
+	{3, arcs_27_2},
 	{1, arcs_27_3},
+	{3, arcs_27_4},
+	{1, arcs_27_5},
+	{1, arcs_27_6},
+	{1, arcs_27_7},
 };
 static arc arcs_28_0[1] = {
-	{12, 1},
+	{21, 1},
 };
 static arc arcs_28_1[2] = {
-	{78, 2},
+	{80, 2},
 	{0, 1},
 };
 static arc arcs_28_2[1] = {
-	{19, 3},
+	{21, 3},
 };
 static arc arcs_28_3[1] = {
 	{0, 3},
@@ -587,37 +578,45 @@
 	{1, arcs_28_3},
 };
 static arc arcs_29_0[1] = {
-	{77, 1},
+	{12, 1},
 };
 static arc arcs_29_1[2] = {
-	{27, 2},
+	{80, 2},
 	{0, 1},
 };
-static arc arcs_29_2[2] = {
-	{77, 1},
-	{0, 2},
+static arc arcs_29_2[1] = {
+	{21, 3},
+};
+static arc arcs_29_3[1] = {
+	{0, 3},
 };
-static state states_29[3] = {
+static state states_29[4] = {
 	{1, arcs_29_0},
 	{2, arcs_29_1},
-	{2, arcs_29_2},
+	{1, arcs_29_2},
+	{1, arcs_29_3},
 };
 static arc arcs_30_0[1] = {
 	{79, 1},
 };
 static arc arcs_30_1[2] = {
-	{27, 0},
+	{29, 2},
 	{0, 1},
 };
-static state states_30[2] = {
+static arc arcs_30_2[2] = {
+	{79, 1},
+	{0, 2},
+};
+static state states_30[3] = {
 	{1, arcs_30_0},
 	{2, arcs_30_1},
+	{2, arcs_30_2},
 };
 static arc arcs_31_0[1] = {
-	{19, 1},
+	{81, 1},
 };
 static arc arcs_31_1[2] = {
-	{75, 0},
+	{29, 0},
 	{0, 1},
 };
 static state states_31[2] = {
@@ -625,148 +624,125 @@
 	{2, arcs_31_1},
 };
 static arc arcs_32_0[1] = {
-	{80, 1},
-};
-static arc arcs_32_1[1] = {
-	{19, 2},
+	{21, 1},
 };
-static arc arcs_32_2[2] = {
-	{27, 1},
-	{0, 2},
+static arc arcs_32_1[2] = {
+	{77, 0},
+	{0, 1},
 };
-static state states_32[3] = {
+static state states_32[2] = {
 	{1, arcs_32_0},
-	{1, arcs_32_1},
-	{2, arcs_32_2},
+	{2, arcs_32_1},
 };
 static arc arcs_33_0[1] = {
-	{81, 1},
+	{82, 1},
 };
 static arc arcs_33_1[1] = {
-	{82, 2},
+	{21, 2},
 };
 static arc arcs_33_2[2] = {
-	{83, 3},
+	{29, 1},
 	{0, 2},
 };
-static arc arcs_33_3[1] = {
-	{26, 4},
-};
-static arc arcs_33_4[2] = {
-	{27, 5},
-	{0, 4},
-};
-static arc arcs_33_5[1] = {
-	{26, 6},
-};
-static arc arcs_33_6[1] = {
-	{0, 6},
-};
-static state states_33[7] = {
+static state states_33[3] = {
 	{1, arcs_33_0},
 	{1, arcs_33_1},
 	{2, arcs_33_2},
-	{1, arcs_33_3},
-	{2, arcs_33_4},
-	{1, arcs_33_5},
-	{1, arcs_33_6},
 };
 static arc arcs_34_0[1] = {
-	{84, 1},
+	{83, 1},
 };
 static arc arcs_34_1[1] = {
-	{26, 2},
+	{84, 2},
 };
 static arc arcs_34_2[2] = {
-	{27, 3},
+	{85, 3},
 	{0, 2},
 };
 static arc arcs_34_3[1] = {
-	{26, 4},
+	{28, 4},
 };
-static arc arcs_34_4[1] = {
+static arc arcs_34_4[2] = {
+	{29, 5},
 	{0, 4},
 };
-static state states_34[5] = {
+static arc arcs_34_5[1] = {
+	{28, 6},
+};
+static arc arcs_34_6[1] = {
+	{0, 6},
+};
+static state states_34[7] = {
 	{1, arcs_34_0},
 	{1, arcs_34_1},
 	{2, arcs_34_2},
 	{1, arcs_34_3},
-	{1, arcs_34_4},
+	{2, arcs_34_4},
+	{1, arcs_34_5},
+	{1, arcs_34_6},
 };
-static arc arcs_35_0[7] = {
-	{85, 1},
+static arc arcs_35_0[1] = {
 	{86, 1},
-	{87, 1},
-	{88, 1},
-	{89, 1},
-	{17, 1},
-	{90, 1},
 };
 static arc arcs_35_1[1] = {
-	{0, 1},
-};
-static state states_35[2] = {
-	{7, arcs_35_0},
-	{1, arcs_35_1},
-};
-static arc arcs_36_0[1] = {
-	{91, 1},
-};
-static arc arcs_36_1[1] = {
-	{26, 2},
+	{28, 2},
 };
-static arc arcs_36_2[1] = {
-	{21, 3},
+static arc arcs_35_2[2] = {
+	{29, 3},
+	{0, 2},
 };
-static arc arcs_36_3[1] = {
-	{22, 4},
+static arc arcs_35_3[1] = {
+	{28, 4},
 };
-static arc arcs_36_4[3] = {
-	{92, 1},
-	{93, 5},
+static arc arcs_35_4[1] = {
 	{0, 4},
 };
-static arc arcs_36_5[1] = {
-	{21, 6},
+static state states_35[5] = {
+	{1, arcs_35_0},
+	{1, arcs_35_1},
+	{2, arcs_35_2},
+	{1, arcs_35_3},
+	{1, arcs_35_4},
 };
-static arc arcs_36_6[1] = {
-	{22, 7},
+static arc arcs_36_0[8] = {
+	{87, 1},
+	{88, 1},
+	{89, 1},
+	{90, 1},
+	{91, 1},
+	{19, 1},
+	{18, 1},
+	{17, 1},
 };
-static arc arcs_36_7[1] = {
-	{0, 7},
+static arc arcs_36_1[1] = {
+	{0, 1},
 };
-static state states_36[8] = {
-	{1, arcs_36_0},
+static state states_36[2] = {
+	{8, arcs_36_0},
 	{1, arcs_36_1},
-	{1, arcs_36_2},
-	{1, arcs_36_3},
-	{3, arcs_36_4},
-	{1, arcs_36_5},
-	{1, arcs_36_6},
-	{1, arcs_36_7},
 };
 static arc arcs_37_0[1] = {
-	{94, 1},
+	{92, 1},
 };
 static arc arcs_37_1[1] = {
-	{26, 2},
+	{28, 2},
 };
 static arc arcs_37_2[1] = {
-	{21, 3},
+	{23, 3},
 };
 static arc arcs_37_3[1] = {
-	{22, 4},
+	{24, 4},
 };
-static arc arcs_37_4[2] = {
-	{93, 5},
+static arc arcs_37_4[3] = {
+	{93, 1},
+	{94, 5},
 	{0, 4},
 };
 static arc arcs_37_5[1] = {
-	{21, 6},
+	{23, 6},
 };
 static arc arcs_37_6[1] = {
-	{22, 7},
+	{24, 7},
 };
 static arc arcs_37_7[1] = {
 	{0, 7},
@@ -776,7 +752,7 @@
 	{1, arcs_37_1},
 	{1, arcs_37_2},
 	{1, arcs_37_3},
-	{2, arcs_37_4},
+	{3, arcs_37_4},
 	{1, arcs_37_5},
 	{1, arcs_37_6},
 	{1, arcs_37_7},
@@ -785,373 +761,397 @@
 	{95, 1},
 };
 static arc arcs_38_1[1] = {
-	{59, 2},
+	{28, 2},
 };
 static arc arcs_38_2[1] = {
-	{83, 3},
+	{23, 3},
 };
 static arc arcs_38_3[1] = {
-	{9, 4},
+	{24, 4},
 };
-static arc arcs_38_4[1] = {
-	{21, 5},
+static arc arcs_38_4[2] = {
+	{94, 5},
+	{0, 4},
 };
 static arc arcs_38_5[1] = {
-	{22, 6},
+	{23, 6},
 };
-static arc arcs_38_6[2] = {
-	{93, 7},
-	{0, 6},
+static arc arcs_38_6[1] = {
+	{24, 7},
 };
 static arc arcs_38_7[1] = {
-	{21, 8},
-};
-static arc arcs_38_8[1] = {
-	{22, 9},
-};
-static arc arcs_38_9[1] = {
-	{0, 9},
+	{0, 7},
 };
-static state states_38[10] = {
+static state states_38[8] = {
 	{1, arcs_38_0},
 	{1, arcs_38_1},
 	{1, arcs_38_2},
 	{1, arcs_38_3},
-	{1, arcs_38_4},
+	{2, arcs_38_4},
 	{1, arcs_38_5},
-	{2, arcs_38_6},
+	{1, arcs_38_6},
 	{1, arcs_38_7},
-	{1, arcs_38_8},
-	{1, arcs_38_9},
 };
 static arc arcs_39_0[1] = {
 	{96, 1},
 };
 static arc arcs_39_1[1] = {
-	{21, 2},
+	{61, 2},
 };
 static arc arcs_39_2[1] = {
-	{22, 3},
+	{85, 3},
 };
-static arc arcs_39_3[2] = {
-	{97, 4},
-	{98, 5},
+static arc arcs_39_3[1] = {
+	{9, 4},
 };
 static arc arcs_39_4[1] = {
-	{21, 6},
+	{23, 5},
 };
 static arc arcs_39_5[1] = {
-	{21, 7},
+	{24, 6},
 };
-static arc arcs_39_6[1] = {
-	{22, 8},
+static arc arcs_39_6[2] = {
+	{94, 7},
+	{0, 6},
 };
 static arc arcs_39_7[1] = {
-	{22, 9},
+	{23, 8},
 };
-static arc arcs_39_8[4] = {
-	{97, 4},
-	{93, 10},
-	{98, 5},
-	{0, 8},
+static arc arcs_39_8[1] = {
+	{24, 9},
 };
 static arc arcs_39_9[1] = {
 	{0, 9},
 };
-static arc arcs_39_10[1] = {
-	{21, 11},
-};
-static arc arcs_39_11[1] = {
-	{22, 12},
-};
-static arc arcs_39_12[2] = {
-	{98, 5},
-	{0, 12},
-};
-static state states_39[13] = {
+static state states_39[10] = {
 	{1, arcs_39_0},
 	{1, arcs_39_1},
 	{1, arcs_39_2},
-	{2, arcs_39_3},
+	{1, arcs_39_3},
 	{1, arcs_39_4},
 	{1, arcs_39_5},
-	{1, arcs_39_6},
+	{2, arcs_39_6},
 	{1, arcs_39_7},
-	{4, arcs_39_8},
+	{1, arcs_39_8},
 	{1, arcs_39_9},
-	{1, arcs_39_10},
-	{1, arcs_39_11},
-	{2, arcs_39_12},
 };
 static arc arcs_40_0[1] = {
-	{99, 1},
+	{97, 1},
 };
 static arc arcs_40_1[1] = {
-	{26, 2},
+	{23, 2},
 };
-static arc arcs_40_2[2] = {
-	{100, 3},
-	{21, 4},
+static arc arcs_40_2[1] = {
+	{24, 3},
 };
-static arc arcs_40_3[1] = {
-	{21, 4},
+static arc arcs_40_3[2] = {
+	{98, 4},
+	{99, 5},
 };
 static arc arcs_40_4[1] = {
-	{22, 5},
+	{23, 6},
 };
 static arc arcs_40_5[1] = {
-	{0, 5},
+	{23, 7},
 };
-static state states_40[6] = {
+static arc arcs_40_6[1] = {
+	{24, 8},
+};
+static arc arcs_40_7[1] = {
+	{24, 9},
+};
+static arc arcs_40_8[4] = {
+	{98, 4},
+	{94, 10},
+	{99, 5},
+	{0, 8},
+};
+static arc arcs_40_9[1] = {
+	{0, 9},
+};
+static arc arcs_40_10[1] = {
+	{23, 11},
+};
+static arc arcs_40_11[1] = {
+	{24, 12},
+};
+static arc arcs_40_12[2] = {
+	{99, 5},
+	{0, 12},
+};
+static state states_40[13] = {
 	{1, arcs_40_0},
 	{1, arcs_40_1},
-	{2, arcs_40_2},
-	{1, arcs_40_3},
+	{1, arcs_40_2},
+	{2, arcs_40_3},
 	{1, arcs_40_4},
 	{1, arcs_40_5},
+	{1, arcs_40_6},
+	{1, arcs_40_7},
+	{4, arcs_40_8},
+	{1, arcs_40_9},
+	{1, arcs_40_10},
+	{1, arcs_40_11},
+	{2, arcs_40_12},
 };
 static arc arcs_41_0[1] = {
-	{78, 1},
+	{100, 1},
 };
 static arc arcs_41_1[1] = {
-	{82, 2},
+	{28, 2},
 };
-static arc arcs_41_2[1] = {
-	{0, 2},
+static arc arcs_41_2[2] = {
+	{101, 3},
+	{23, 4},
+};
+static arc arcs_41_3[1] = {
+	{23, 4},
+};
+static arc arcs_41_4[1] = {
+	{24, 5},
+};
+static arc arcs_41_5[1] = {
+	{0, 5},
 };
-static state states_41[3] = {
+static state states_41[6] = {
 	{1, arcs_41_0},
 	{1, arcs_41_1},
-	{1, arcs_41_2},
+	{2, arcs_41_2},
+	{1, arcs_41_3},
+	{1, arcs_41_4},
+	{1, arcs_41_5},
 };
 static arc arcs_42_0[1] = {
-	{101, 1},
+	{80, 1},
 };
-static arc arcs_42_1[2] = {
-	{26, 2},
-	{0, 1},
+static arc arcs_42_1[1] = {
+	{84, 2},
 };
-static arc arcs_42_2[3] = {
-	{78, 3},
-	{27, 3},
+static arc arcs_42_2[1] = {
 	{0, 2},
 };
-static arc arcs_42_3[1] = {
-	{26, 4},
-};
-static arc arcs_42_4[1] = {
-	{0, 4},
-};
-static state states_42[5] = {
+static state states_42[3] = {
 	{1, arcs_42_0},
-	{2, arcs_42_1},
-	{3, arcs_42_2},
-	{1, arcs_42_3},
-	{1, arcs_42_4},
+	{1, arcs_42_1},
+	{1, arcs_42_2},
 };
-static arc arcs_43_0[2] = {
-	{3, 1},
-	{2, 2},
+static arc arcs_43_0[1] = {
+	{102, 1},
 };
-static arc arcs_43_1[1] = {
+static arc arcs_43_1[2] = {
+	{28, 2},
 	{0, 1},
 };
-static arc arcs_43_2[1] = {
-	{102, 3},
+static arc arcs_43_2[3] = {
+	{80, 3},
+	{29, 3},
+	{0, 2},
 };
 static arc arcs_43_3[1] = {
-	{6, 4},
+	{28, 4},
 };
-static arc arcs_43_4[2] = {
-	{6, 4},
-	{103, 1},
+static arc arcs_43_4[1] = {
+	{0, 4},
 };
 static state states_43[5] = {
-	{2, arcs_43_0},
-	{1, arcs_43_1},
-	{1, arcs_43_2},
+	{1, arcs_43_0},
+	{2, arcs_43_1},
+	{3, arcs_43_2},
 	{1, arcs_43_3},
-	{2, arcs_43_4},
+	{1, arcs_43_4},
 };
-static arc arcs_44_0[1] = {
-	{105, 1},
+static arc arcs_44_0[2] = {
+	{3, 1},
+	{2, 2},
 };
-static arc arcs_44_1[2] = {
-	{27, 2},
+static arc arcs_44_1[1] = {
 	{0, 1},
 };
 static arc arcs_44_2[1] = {
-	{105, 3},
+	{103, 3},
 };
-static arc arcs_44_3[2] = {
-	{27, 4},
-	{0, 3},
+static arc arcs_44_3[1] = {
+	{6, 4},
 };
 static arc arcs_44_4[2] = {
-	{105, 3},
-	{0, 4},
+	{6, 4},
+	{104, 1},
 };
 static state states_44[5] = {
-	{1, arcs_44_0},
-	{2, arcs_44_1},
+	{2, arcs_44_0},
+	{1, arcs_44_1},
 	{1, arcs_44_2},
-	{2, arcs_44_3},
+	{1, arcs_44_3},
 	{2, arcs_44_4},
 };
-static arc arcs_45_0[2] = {
+static arc arcs_45_0[1] = {
 	{106, 1},
-	{107, 1},
 };
-static arc arcs_45_1[1] = {
+static arc arcs_45_1[2] = {
+	{29, 2},
 	{0, 1},
 };
-static state states_45[2] = {
-	{2, arcs_45_0},
-	{1, arcs_45_1},
+static arc arcs_45_2[1] = {
+	{106, 3},
 };
-static arc arcs_46_0[1] = {
-	{108, 1},
+static arc arcs_45_3[2] = {
+	{29, 4},
+	{0, 3},
 };
-static arc arcs_46_1[2] = {
-	{23, 2},
-	{21, 3},
+static arc arcs_45_4[2] = {
+	{106, 3},
+	{0, 4},
 };
-static arc arcs_46_2[1] = {
-	{21, 3},
+static state states_45[5] = {
+	{1, arcs_45_0},
+	{2, arcs_45_1},
+	{1, arcs_45_2},
+	{2, arcs_45_3},
+	{2, arcs_45_4},
 };
-static arc arcs_46_3[1] = {
-	{105, 4},
+static arc arcs_46_0[2] = {
+	{107, 1},
+	{108, 1},
 };
-static arc arcs_46_4[1] = {
-	{0, 4},
+static arc arcs_46_1[1] = {
+	{0, 1},
 };
-static state states_46[5] = {
-	{1, arcs_46_0},
-	{2, arcs_46_1},
-	{1, arcs_46_2},
-	{1, arcs_46_3},
-	{1, arcs_46_4},
+static state states_46[2] = {
+	{2, arcs_46_0},
+	{1, arcs_46_1},
 };
-static arc arcs_47_0[2] = {
-	{106, 1},
-	{109, 2},
+static arc arcs_47_0[1] = {
+	{109, 1},
 };
 static arc arcs_47_1[2] = {
-	{91, 3},
-	{0, 1},
+	{25, 2},
+	{23, 3},
 };
 static arc arcs_47_2[1] = {
-	{0, 2},
+	{23, 3},
 };
 static arc arcs_47_3[1] = {
 	{106, 4},
 };
 static arc arcs_47_4[1] = {
-	{93, 5},
-};
-static arc arcs_47_5[1] = {
-	{26, 2},
+	{0, 4},
 };
-static state states_47[6] = {
-	{2, arcs_47_0},
+static state states_47[5] = {
+	{1, arcs_47_0},
 	{2, arcs_47_1},
 	{1, arcs_47_2},
 	{1, arcs_47_3},
 	{1, arcs_47_4},
-	{1, arcs_47_5},
 };
-static arc arcs_48_0[1] = {
-	{110, 1},
+static arc arcs_48_0[2] = {
+	{107, 1},
+	{110, 2},
 };
 static arc arcs_48_1[2] = {
-	{111, 0},
+	{92, 3},
 	{0, 1},
 };
-static state states_48[2] = {
-	{1, arcs_48_0},
+static arc arcs_48_2[1] = {
+	{0, 2},
+};
+static arc arcs_48_3[1] = {
+	{107, 4},
+};
+static arc arcs_48_4[1] = {
+	{94, 5},
+};
+static arc arcs_48_5[1] = {
+	{28, 2},
+};
+static state states_48[6] = {
+	{2, arcs_48_0},
 	{2, arcs_48_1},
+	{1, arcs_48_2},
+	{1, arcs_48_3},
+	{1, arcs_48_4},
+	{1, arcs_48_5},
 };
 static arc arcs_49_0[1] = {
-	{112, 1},
+	{111, 1},
 };
 static arc arcs_49_1[2] = {
-	{113, 0},
+	{112, 0},
 	{0, 1},
 };
 static state states_49[2] = {
 	{1, arcs_49_0},
 	{2, arcs_49_1},
 };
-static arc arcs_50_0[2] = {
-	{114, 1},
-	{115, 2},
+static arc arcs_50_0[1] = {
+	{113, 1},
+};
+static arc arcs_50_1[2] = {
+	{114, 0},
+	{0, 1},
 };
-static arc arcs_50_1[1] = {
-	{112, 2},
+static state states_50[2] = {
+	{1, arcs_50_0},
+	{2, arcs_50_1},
 };
-static arc arcs_50_2[1] = {
+static arc arcs_51_0[2] = {
+	{115, 1},
+	{116, 2},
+};
+static arc arcs_51_1[1] = {
+	{113, 2},
+};
+static arc arcs_51_2[1] = {
 	{0, 2},
 };
-static state states_50[3] = {
-	{2, arcs_50_0},
-	{1, arcs_50_1},
-	{1, arcs_50_2},
+static state states_51[3] = {
+	{2, arcs_51_0},
+	{1, arcs_51_1},
+	{1, arcs_51_2},
 };
-static arc arcs_51_0[1] = {
-	{82, 1},
+static arc arcs_52_0[1] = {
+	{84, 1},
 };
-static arc arcs_51_1[2] = {
-	{116, 0},
+static arc arcs_52_1[2] = {
+	{117, 0},
 	{0, 1},
 };
-static state states_51[2] = {
-	{1, arcs_51_0},
-	{2, arcs_51_1},
+static state states_52[2] = {
+	{1, arcs_52_0},
+	{2, arcs_52_1},
 };
-static arc arcs_52_0[10] = {
-	{117, 1},
+static arc arcs_53_0[10] = {
 	{118, 1},
 	{119, 1},
 	{120, 1},
 	{121, 1},
 	{122, 1},
 	{123, 1},
-	{83, 1},
-	{114, 2},
-	{124, 3},
+	{124, 1},
+	{85, 1},
+	{115, 2},
+	{125, 3},
 };
-static arc arcs_52_1[1] = {
+static arc arcs_53_1[1] = {
 	{0, 1},
 };
-static arc arcs_52_2[1] = {
-	{83, 1},
+static arc arcs_53_2[1] = {
+	{85, 1},
 };
-static arc arcs_52_3[2] = {
-	{114, 1},
+static arc arcs_53_3[2] = {
+	{115, 1},
 	{0, 3},
 };
-static state states_52[4] = {
-	{10, arcs_52_0},
-	{1, arcs_52_1},
-	{1, arcs_52_2},
-	{2, arcs_52_3},
-};
-static arc arcs_53_0[1] = {
-	{125, 1},
-};
-static arc arcs_53_1[2] = {
-	{126, 0},
-	{0, 1},
-};
-static state states_53[2] = {
-	{1, arcs_53_0},
-	{2, arcs_53_1},
+static state states_53[4] = {
+	{10, arcs_53_0},
+	{1, arcs_53_1},
+	{1, arcs_53_2},
+	{2, arcs_53_3},
 };
 static arc arcs_54_0[1] = {
-	{127, 1},
+	{126, 1},
 };
 static arc arcs_54_1[2] = {
-	{128, 0},
+	{127, 0},
 	{0, 1},
 };
 static state states_54[2] = {
@@ -1159,10 +1159,10 @@
 	{2, arcs_54_1},
 };
 static arc arcs_55_0[1] = {
-	{129, 1},
+	{128, 1},
 };
 static arc arcs_55_1[2] = {
-	{130, 0},
+	{129, 0},
 	{0, 1},
 };
 static state states_55[2] = {
@@ -1170,23 +1170,22 @@
 	{2, arcs_55_1},
 };
 static arc arcs_56_0[1] = {
-	{131, 1},
+	{130, 1},
 };
-static arc arcs_56_1[3] = {
-	{132, 0},
-	{57, 0},
+static arc arcs_56_1[2] = {
+	{131, 0},
 	{0, 1},
 };
 static state states_56[2] = {
 	{1, arcs_56_0},
-	{3, arcs_56_1},
+	{2, arcs_56_1},
 };
 static arc arcs_57_0[1] = {
-	{133, 1},
+	{132, 1},
 };
 static arc arcs_57_1[3] = {
-	{134, 0},
-	{135, 0},
+	{133, 0},
+	{59, 0},
 	{0, 1},
 };
 static state states_57[2] = {
@@ -1194,156 +1193,142 @@
 	{3, arcs_57_1},
 };
 static arc arcs_58_0[1] = {
-	{136, 1},
+	{134, 1},
 };
-static arc arcs_58_1[5] = {
-	{28, 0},
-	{137, 0},
-	{138, 0},
-	{139, 0},
+static arc arcs_58_1[3] = {
+	{135, 0},
+	{136, 0},
 	{0, 1},
 };
 static state states_58[2] = {
 	{1, arcs_58_0},
-	{5, arcs_58_1},
+	{3, arcs_58_1},
 };
-static arc arcs_59_0[4] = {
-	{134, 1},
+static arc arcs_59_0[1] = {
+	{137, 1},
+};
+static arc arcs_59_1[5] = {
+	{30, 0},
+	{138, 0},
+	{139, 0},
+	{140, 0},
+	{0, 1},
+};
+static state states_59[2] = {
+	{1, arcs_59_0},
+	{5, arcs_59_1},
+};
+static arc arcs_60_0[4] = {
 	{135, 1},
-	{140, 1},
-	{141, 2},
+	{136, 1},
+	{141, 1},
+	{142, 2},
 };
-static arc arcs_59_1[1] = {
-	{136, 2},
+static arc arcs_60_1[1] = {
+	{137, 2},
 };
-static arc arcs_59_2[1] = {
+static arc arcs_60_2[1] = {
 	{0, 2},
 };
-static state states_59[3] = {
-	{4, arcs_59_0},
-	{1, arcs_59_1},
-	{1, arcs_59_2},
-};
-static arc arcs_60_0[1] = {
-	{142, 1},
+static state states_60[3] = {
+	{4, arcs_60_0},
+	{1, arcs_60_1},
+	{1, arcs_60_2},
 };
-static arc arcs_60_1[3] = {
+static arc arcs_61_0[1] = {
 	{143, 1},
-	{29, 2},
+};
+static arc arcs_61_1[3] = {
+	{144, 1},
+	{31, 2},
 	{0, 1},
 };
-static arc arcs_60_2[1] = {
-	{136, 3},
+static arc arcs_61_2[1] = {
+	{137, 3},
 };
-static arc arcs_60_3[1] = {
+static arc arcs_61_3[1] = {
 	{0, 3},
 };
-static state states_60[4] = {
-	{1, arcs_60_0},
-	{3, arcs_60_1},
-	{1, arcs_60_2},
-	{1, arcs_60_3},
+static state states_61[4] = {
+	{1, arcs_61_0},
+	{3, arcs_61_1},
+	{1, arcs_61_2},
+	{1, arcs_61_3},
 };
-static arc arcs_61_0[7] = {
+static arc arcs_62_0[7] = {
 	{13, 1},
-	{145, 2},
-	{148, 3},
-	{151, 4},
-	{19, 5},
-	{153, 5},
-	{154, 6},
+	{146, 2},
+	{149, 3},
+	{152, 4},
+	{21, 5},
+	{154, 5},
+	{155, 6},
 };
-static arc arcs_61_1[3] = {
-	{43, 7},
-	{144, 7},
+static arc arcs_62_1[3] = {
+	{45, 7},
+	{145, 7},
 	{15, 5},
 };
-static arc arcs_61_2[2] = {
-	{146, 8},
-	{147, 5},
-};
-static arc arcs_61_3[2] = {
-	{149, 9},
-	{150, 5},
+static arc arcs_62_2[2] = {
+	{147, 8},
+	{148, 5},
 };
-static arc arcs_61_4[1] = {
-	{152, 10},
+static arc arcs_62_3[2] = {
+	{150, 9},
+	{151, 5},
+};
+static arc arcs_62_4[1] = {
+	{153, 10},
 };
-static arc arcs_61_5[1] = {
+static arc arcs_62_5[1] = {
 	{0, 5},
 };
-static arc arcs_61_6[2] = {
-	{154, 6},
+static arc arcs_62_6[2] = {
+	{155, 6},
 	{0, 6},
 };
-static arc arcs_61_7[1] = {
+static arc arcs_62_7[1] = {
 	{15, 5},
 };
-static arc arcs_61_8[1] = {
-	{147, 5},
+static arc arcs_62_8[1] = {
+	{148, 5},
 };
-static arc arcs_61_9[1] = {
-	{150, 5},
-};
-static arc arcs_61_10[1] = {
+static arc arcs_62_9[1] = {
 	{151, 5},
 };
-static state states_61[11] = {
-	{7, arcs_61_0},
-	{3, arcs_61_1},
-	{2, arcs_61_2},
-	{2, arcs_61_3},
-	{1, arcs_61_4},
-	{1, arcs_61_5},
-	{2, arcs_61_6},
-	{1, arcs_61_7},
-	{1, arcs_61_8},
-	{1, arcs_61_9},
-	{1, arcs_61_10},
-};
-static arc arcs_62_0[1] = {
-	{26, 1},
-};
-static arc arcs_62_1[3] = {
-	{155, 2},
-	{27, 3},
-	{0, 1},
-};
-static arc arcs_62_2[1] = {
-	{0, 2},
-};
-static arc arcs_62_3[2] = {
-	{26, 4},
-	{0, 3},
-};
-static arc arcs_62_4[2] = {
-	{27, 3},
-	{0, 4},
+static arc arcs_62_10[1] = {
+	{152, 5},
 };
-static state states_62[5] = {
-	{1, arcs_62_0},
+static state states_62[11] = {
+	{7, arcs_62_0},
 	{3, arcs_62_1},
-	{1, arcs_62_2},
+	{2, arcs_62_2},
 	{2, arcs_62_3},
-	{2, arcs_62_4},
+	{1, arcs_62_4},
+	{1, arcs_62_5},
+	{2, arcs_62_6},
+	{1, arcs_62_7},
+	{1, arcs_62_8},
+	{1, arcs_62_9},
+	{1, arcs_62_10},
 };
 static arc arcs_63_0[1] = {
-	{26, 1},
+	{28, 1},
 };
 static arc arcs_63_1[3] = {
 	{156, 2},
-	{27, 3},
+	{29, 3},
 	{0, 1},
 };
 static arc arcs_63_2[1] = {
 	{0, 2},
 };
 static arc arcs_63_3[2] = {
-	{26, 4},
+	{28, 4},
 	{0, 3},
 };
 static arc arcs_63_4[2] = {
-	{27, 3},
+	{29, 3},
 	{0, 4},
 };
 static state states_63[5] = {
@@ -1354,153 +1339,163 @@
 	{2, arcs_63_4},
 };
 static arc arcs_64_0[1] = {
-	{108, 1},
+	{28, 1},
 };
-static arc arcs_64_1[2] = {
-	{23, 2},
-	{21, 3},
+static arc arcs_64_1[3] = {
+	{157, 2},
+	{29, 3},
+	{0, 1},
 };
 static arc arcs_64_2[1] = {
-	{21, 3},
+	{0, 2},
 };
-static arc arcs_64_3[1] = {
-	{26, 4},
+static arc arcs_64_3[2] = {
+	{28, 4},
+	{0, 3},
 };
-static arc arcs_64_4[1] = {
+static arc arcs_64_4[2] = {
+	{29, 3},
 	{0, 4},
 };
 static state states_64[5] = {
 	{1, arcs_64_0},
-	{2, arcs_64_1},
+	{3, arcs_64_1},
 	{1, arcs_64_2},
-	{1, arcs_64_3},
-	{1, arcs_64_4},
+	{2, arcs_64_3},
+	{2, arcs_64_4},
 };
-static arc arcs_65_0[3] = {
-	{13, 1},
-	{145, 2},
-	{75, 3},
+static arc arcs_65_0[1] = {
+	{109, 1},
 };
 static arc arcs_65_1[2] = {
-	{14, 4},
-	{15, 5},
+	{25, 2},
+	{23, 3},
 };
 static arc arcs_65_2[1] = {
-	{157, 6},
+	{23, 3},
 };
 static arc arcs_65_3[1] = {
-	{19, 5},
+	{28, 4},
 };
 static arc arcs_65_4[1] = {
-	{15, 5},
-};
-static arc arcs_65_5[1] = {
-	{0, 5},
-};
-static arc arcs_65_6[1] = {
-	{147, 5},
+	{0, 4},
 };
-static state states_65[7] = {
-	{3, arcs_65_0},
+static state states_65[5] = {
+	{1, arcs_65_0},
 	{2, arcs_65_1},
 	{1, arcs_65_2},
 	{1, arcs_65_3},
 	{1, arcs_65_4},
-	{1, arcs_65_5},
-	{1, arcs_65_6},
 };
-static arc arcs_66_0[1] = {
-	{158, 1},
+static arc arcs_66_0[3] = {
+	{13, 1},
+	{146, 2},
+	{77, 3},
 };
 static arc arcs_66_1[2] = {
-	{27, 2},
-	{0, 1},
+	{14, 4},
+	{15, 5},
 };
-static arc arcs_66_2[2] = {
-	{158, 1},
-	{0, 2},
+static arc arcs_66_2[1] = {
+	{158, 6},
+};
+static arc arcs_66_3[1] = {
+	{21, 5},
+};
+static arc arcs_66_4[1] = {
+	{15, 5},
+};
+static arc arcs_66_5[1] = {
+	{0, 5},
 };
-static state states_66[3] = {
-	{1, arcs_66_0},
+static arc arcs_66_6[1] = {
+	{148, 5},
+};
+static state states_66[7] = {
+	{3, arcs_66_0},
 	{2, arcs_66_1},
-	{2, arcs_66_2},
+	{1, arcs_66_2},
+	{1, arcs_66_3},
+	{1, arcs_66_4},
+	{1, arcs_66_5},
+	{1, arcs_66_6},
 };
-static arc arcs_67_0[3] = {
-	{75, 1},
-	{26, 2},
-	{21, 3},
+static arc arcs_67_0[1] = {
+	{159, 1},
 };
-static arc arcs_67_1[1] = {
-	{75, 4},
+static arc arcs_67_1[2] = {
+	{29, 2},
+	{0, 1},
 };
 static arc arcs_67_2[2] = {
-	{21, 3},
+	{159, 1},
 	{0, 2},
 };
-static arc arcs_67_3[3] = {
-	{26, 5},
-	{159, 6},
-	{0, 3},
+static state states_67[3] = {
+	{1, arcs_67_0},
+	{2, arcs_67_1},
+	{2, arcs_67_2},
 };
-static arc arcs_67_4[1] = {
-	{75, 6},
+static arc arcs_68_0[3] = {
+	{77, 1},
+	{28, 2},
+	{23, 3},
 };
-static arc arcs_67_5[2] = {
-	{159, 6},
-	{0, 5},
+static arc arcs_68_1[1] = {
+	{77, 4},
 };
-static arc arcs_67_6[1] = {
-	{0, 6},
+static arc arcs_68_2[2] = {
+	{23, 3},
+	{0, 2},
 };
-static state states_67[7] = {
-	{3, arcs_67_0},
-	{1, arcs_67_1},
-	{2, arcs_67_2},
-	{3, arcs_67_3},
-	{1, arcs_67_4},
-	{2, arcs_67_5},
-	{1, arcs_67_6},
+static arc arcs_68_3[3] = {
+	{28, 5},
+	{160, 6},
+	{0, 3},
 };
-static arc arcs_68_0[1] = {
-	{21, 1},
+static arc arcs_68_4[1] = {
+	{77, 6},
 };
-static arc arcs_68_1[2] = {
-	{26, 2},
-	{0, 1},
+static arc arcs_68_5[2] = {
+	{160, 6},
+	{0, 5},
 };
-static arc arcs_68_2[1] = {
-	{0, 2},
+static arc arcs_68_6[1] = {
+	{0, 6},
 };
-static state states_68[3] = {
-	{1, arcs_68_0},
-	{2, arcs_68_1},
-	{1, arcs_68_2},
+static state states_68[7] = {
+	{3, arcs_68_0},
+	{1, arcs_68_1},
+	{2, arcs_68_2},
+	{3, arcs_68_3},
+	{1, arcs_68_4},
+	{2, arcs_68_5},
+	{1, arcs_68_6},
 };
 static arc arcs_69_0[1] = {
-	{82, 1},
+	{23, 1},
 };
 static arc arcs_69_1[2] = {
-	{27, 2},
+	{28, 2},
 	{0, 1},
 };
-static arc arcs_69_2[2] = {
-	{82, 1},
+static arc arcs_69_2[1] = {
 	{0, 2},
 };
 static state states_69[3] = {
 	{1, arcs_69_0},
 	{2, arcs_69_1},
-	{2, arcs_69_2},
+	{1, arcs_69_2},
 };
 static arc arcs_70_0[1] = {
-	{26, 1},
+	{84, 1},
 };
 static arc arcs_70_1[2] = {
-	{27, 2},
+	{29, 2},
 	{0, 1},
 };
 static arc arcs_70_2[2] = {
-	{26, 1},
+	{84, 1},
 	{0, 2},
 };
 static state states_70[3] = {
@@ -1509,491 +1504,511 @@
 	{2, arcs_70_2},
 };
 static arc arcs_71_0[1] = {
-	{26, 1},
-};
-static arc arcs_71_1[1] = {
-	{21, 2},
+	{28, 1},
 };
-static arc arcs_71_2[1] = {
-	{26, 3},
-};
-static arc arcs_71_3[2] = {
-	{27, 4},
-	{0, 3},
+static arc arcs_71_1[2] = {
+	{29, 2},
+	{0, 1},
 };
-static arc arcs_71_4[2] = {
-	{26, 1},
-	{0, 4},
+static arc arcs_71_2[2] = {
+	{28, 1},
+	{0, 2},
 };
-static state states_71[5] = {
+static state states_71[3] = {
 	{1, arcs_71_0},
-	{1, arcs_71_1},
-	{1, arcs_71_2},
-	{2, arcs_71_3},
-	{2, arcs_71_4},
+	{2, arcs_71_1},
+	{2, arcs_71_2},
 };
 static arc arcs_72_0[1] = {
-	{160, 1},
+	{28, 1},
 };
 static arc arcs_72_1[1] = {
-	{19, 2},
+	{23, 2},
 };
-static arc arcs_72_2[2] = {
-	{13, 3},
-	{21, 4},
+static arc arcs_72_2[1] = {
+	{28, 3},
 };
 static arc arcs_72_3[2] = {
-	{9, 5},
-	{15, 6},
-};
-static arc arcs_72_4[1] = {
-	{22, 7},
-};
-static arc arcs_72_5[1] = {
-	{15, 6},
-};
-static arc arcs_72_6[1] = {
-	{21, 4},
+	{29, 4},
+	{0, 3},
 };
-static arc arcs_72_7[1] = {
-	{0, 7},
+static arc arcs_72_4[2] = {
+	{28, 1},
+	{0, 4},
 };
-static state states_72[8] = {
+static state states_72[5] = {
 	{1, arcs_72_0},
 	{1, arcs_72_1},
-	{2, arcs_72_2},
+	{1, arcs_72_2},
 	{2, arcs_72_3},
-	{1, arcs_72_4},
-	{1, arcs_72_5},
-	{1, arcs_72_6},
-	{1, arcs_72_7},
+	{2, arcs_72_4},
 };
-static arc arcs_73_0[3] = {
+static arc arcs_73_0[1] = {
 	{161, 1},
-	{28, 2},
-	{29, 3},
 };
-static arc arcs_73_1[2] = {
-	{27, 4},
-	{0, 1},
+static arc arcs_73_1[1] = {
+	{21, 2},
 };
-static arc arcs_73_2[1] = {
-	{26, 5},
+static arc arcs_73_2[2] = {
+	{13, 3},
+	{23, 4},
 };
-static arc arcs_73_3[1] = {
-	{26, 6},
+static arc arcs_73_3[2] = {
+	{9, 5},
+	{15, 6},
 };
-static arc arcs_73_4[4] = {
-	{161, 1},
-	{28, 2},
-	{29, 3},
-	{0, 4},
+static arc arcs_73_4[1] = {
+	{24, 7},
 };
-static arc arcs_73_5[2] = {
-	{27, 7},
-	{0, 5},
+static arc arcs_73_5[1] = {
+	{15, 6},
 };
 static arc arcs_73_6[1] = {
-	{0, 6},
+	{23, 4},
 };
 static arc arcs_73_7[1] = {
-	{29, 3},
+	{0, 7},
 };
 static state states_73[8] = {
-	{3, arcs_73_0},
-	{2, arcs_73_1},
-	{1, arcs_73_2},
-	{1, arcs_73_3},
-	{4, arcs_73_4},
-	{2, arcs_73_5},
+	{1, arcs_73_0},
+	{1, arcs_73_1},
+	{2, arcs_73_2},
+	{2, arcs_73_3},
+	{1, arcs_73_4},
+	{1, arcs_73_5},
 	{1, arcs_73_6},
 	{1, arcs_73_7},
 };
-static arc arcs_74_0[1] = {
-	{26, 1},
+static arc arcs_74_0[3] = {
+	{162, 1},
+	{30, 2},
+	{31, 3},
 };
-static arc arcs_74_1[3] = {
-	{156, 2},
-	{25, 3},
+static arc arcs_74_1[2] = {
+	{29, 4},
 	{0, 1},
 };
 static arc arcs_74_2[1] = {
-	{0, 2},
+	{28, 5},
 };
 static arc arcs_74_3[1] = {
-	{26, 2},
+	{28, 6},
+};
+static arc arcs_74_4[4] = {
+	{162, 1},
+	{30, 2},
+	{31, 3},
+	{0, 4},
+};
+static arc arcs_74_5[2] = {
+	{29, 7},
+	{0, 5},
+};
+static arc arcs_74_6[1] = {
+	{0, 6},
+};
+static arc arcs_74_7[1] = {
+	{31, 3},
 };
-static state states_74[4] = {
-	{1, arcs_74_0},
-	{3, arcs_74_1},
+static state states_74[8] = {
+	{3, arcs_74_0},
+	{2, arcs_74_1},
 	{1, arcs_74_2},
 	{1, arcs_74_3},
+	{4, arcs_74_4},
+	{2, arcs_74_5},
+	{1, arcs_74_6},
+	{1, arcs_74_7},
 };
-static arc arcs_75_0[2] = {
-	{155, 1},
-	{163, 1},
+static arc arcs_75_0[1] = {
+	{28, 1},
 };
-static arc arcs_75_1[1] = {
+static arc arcs_75_1[3] = {
+	{157, 2},
+	{27, 3},
 	{0, 1},
 };
-static state states_75[2] = {
-	{2, arcs_75_0},
-	{1, arcs_75_1},
-};
-static arc arcs_76_0[1] = {
-	{95, 1},
-};
-static arc arcs_76_1[1] = {
-	{59, 2},
+static arc arcs_75_2[1] = {
+	{0, 2},
 };
-static arc arcs_76_2[1] = {
-	{83, 3},
+static arc arcs_75_3[1] = {
+	{28, 2},
 };
-static arc arcs_76_3[1] = {
-	{104, 4},
+static state states_75[4] = {
+	{1, arcs_75_0},
+	{3, arcs_75_1},
+	{1, arcs_75_2},
+	{1, arcs_75_3},
 };
-static arc arcs_76_4[2] = {
-	{162, 5},
-	{0, 4},
+static arc arcs_76_0[2] = {
+	{156, 1},
+	{164, 1},
 };
-static arc arcs_76_5[1] = {
-	{0, 5},
+static arc arcs_76_1[1] = {
+	{0, 1},
 };
-static state states_76[6] = {
-	{1, arcs_76_0},
+static state states_76[2] = {
+	{2, arcs_76_0},
 	{1, arcs_76_1},
-	{1, arcs_76_2},
-	{1, arcs_76_3},
-	{2, arcs_76_4},
-	{1, arcs_76_5},
 };
 static arc arcs_77_0[1] = {
-	{91, 1},
+	{96, 1},
 };
 static arc arcs_77_1[1] = {
-	{105, 2},
+	{61, 2},
 };
-static arc arcs_77_2[2] = {
-	{162, 3},
-	{0, 2},
+static arc arcs_77_2[1] = {
+	{85, 3},
 };
 static arc arcs_77_3[1] = {
-	{0, 3},
+	{105, 4},
+};
+static arc arcs_77_4[2] = {
+	{163, 5},
+	{0, 4},
 };
-static state states_77[4] = {
+static arc arcs_77_5[1] = {
+	{0, 5},
+};
+static state states_77[6] = {
 	{1, arcs_77_0},
 	{1, arcs_77_1},
-	{2, arcs_77_2},
+	{1, arcs_77_2},
 	{1, arcs_77_3},
+	{2, arcs_77_4},
+	{1, arcs_77_5},
 };
-static arc arcs_78_0[2] = {
-	{156, 1},
-	{165, 1},
+static arc arcs_78_0[1] = {
+	{92, 1},
 };
 static arc arcs_78_1[1] = {
-	{0, 1},
-};
-static state states_78[2] = {
-	{2, arcs_78_0},
-	{1, arcs_78_1},
-};
-static arc arcs_79_0[1] = {
-	{95, 1},
+	{106, 2},
 };
-static arc arcs_79_1[1] = {
-	{59, 2},
+static arc arcs_78_2[2] = {
+	{163, 3},
+	{0, 2},
 };
-static arc arcs_79_2[1] = {
-	{83, 3},
+static arc arcs_78_3[1] = {
+	{0, 3},
 };
-static arc arcs_79_3[1] = {
-	{106, 4},
+static state states_78[4] = {
+	{1, arcs_78_0},
+	{1, arcs_78_1},
+	{2, arcs_78_2},
+	{1, arcs_78_3},
 };
-static arc arcs_79_4[2] = {
-	{164, 5},
-	{0, 4},
+static arc arcs_79_0[2] = {
+	{157, 1},
+	{166, 1},
 };
-static arc arcs_79_5[1] = {
-	{0, 5},
+static arc arcs_79_1[1] = {
+	{0, 1},
 };
-static state states_79[6] = {
-	{1, arcs_79_0},
+static state states_79[2] = {
+	{2, arcs_79_0},
 	{1, arcs_79_1},
-	{1, arcs_79_2},
-	{1, arcs_79_3},
-	{2, arcs_79_4},
-	{1, arcs_79_5},
 };
 static arc arcs_80_0[1] = {
-	{91, 1},
+	{96, 1},
 };
 static arc arcs_80_1[1] = {
-	{105, 2},
+	{61, 2},
 };
-static arc arcs_80_2[2] = {
-	{164, 3},
-	{0, 2},
+static arc arcs_80_2[1] = {
+	{85, 3},
 };
 static arc arcs_80_3[1] = {
-	{0, 3},
+	{107, 4},
 };
-static state states_80[4] = {
+static arc arcs_80_4[2] = {
+	{165, 5},
+	{0, 4},
+};
+static arc arcs_80_5[1] = {
+	{0, 5},
+};
+static state states_80[6] = {
 	{1, arcs_80_0},
 	{1, arcs_80_1},
-	{2, arcs_80_2},
+	{1, arcs_80_2},
 	{1, arcs_80_3},
+	{2, arcs_80_4},
+	{1, arcs_80_5},
 };
 static arc arcs_81_0[1] = {
-	{26, 1},
+	{92, 1},
 };
-static arc arcs_81_1[2] = {
-	{27, 0},
-	{0, 1},
+static arc arcs_81_1[1] = {
+	{106, 2},
+};
+static arc arcs_81_2[2] = {
+	{165, 3},
+	{0, 2},
+};
+static arc arcs_81_3[1] = {
+	{0, 3},
 };
-static state states_81[2] = {
+static state states_81[4] = {
 	{1, arcs_81_0},
-	{2, arcs_81_1},
+	{1, arcs_81_1},
+	{2, arcs_81_2},
+	{1, arcs_81_3},
 };
 static arc arcs_82_0[1] = {
-	{19, 1},
+	{28, 1},
 };
-static arc arcs_82_1[1] = {
+static arc arcs_82_1[2] = {
+	{29, 0},
 	{0, 1},
 };
 static state states_82[2] = {
 	{1, arcs_82_0},
-	{1, arcs_82_1},
+	{2, arcs_82_1},
 };
 static arc arcs_83_0[1] = {
-	{167, 1},
+	{21, 1},
+};
+static arc arcs_83_1[1] = {
+	{0, 1},
+};
+static state states_83[2] = {
+	{1, arcs_83_0},
+	{1, arcs_83_1},
+};
+static arc arcs_84_0[1] = {
+	{168, 1},
 };
-static arc arcs_83_1[2] = {
+static arc arcs_84_1[2] = {
 	{9, 2},
 	{0, 1},
 };
-static arc arcs_83_2[1] = {
+static arc arcs_84_2[1] = {
 	{0, 2},
 };
-static state states_83[3] = {
-	{1, arcs_83_0},
-	{2, arcs_83_1},
-	{1, arcs_83_2},
+static state states_84[3] = {
+	{1, arcs_84_0},
+	{2, arcs_84_1},
+	{1, arcs_84_2},
 };
-static dfa dfas[84] = {
+static dfa dfas[85] = {
 	{256, "single_input", 0, 3, states_0,
-	 "\004\050\014\000\000\000\000\025\074\005\023\310\011\020\004\000\300\020\222\006\201"},
+	 "\004\050\060\000\000\000\000\124\360\024\114\220\023\040\010\000\200\041\044\015\002\001"},
 	{257, "file_input", 0, 2, states_1,
-	 "\204\050\014\000\000\000\000\025\074\005\023\310\011\020\004\000\300\020\222\006\201"},
+	 "\204\050\060\000\000\000\000\124\360\024\114\220\023\040\010\000\200\041\044\015\002\001"},
 	{258, "eval_input", 0, 3, states_2,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
 	{259, "decorator", 0, 7, states_3,
-	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
 	{260, "decorators", 0, 2, states_4,
-	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{261, "funcdef", 0, 7, states_5,
-	 "\000\010\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{262, "parameters", 0, 4, states_6,
-	 "\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{263, "varargslist", 0, 10, states_7,
-	 "\000\040\010\060\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{264, "fpdef", 0, 4, states_8,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{265, "fplist", 0, 3, states_9,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{266, "stmt", 0, 2, states_10,
-	 "\000\050\014\000\000\000\000\025\074\005\023\310\011\020\004\000\300\020\222\006\201"},
-	{267, "simple_stmt", 0, 4, states_11,
-	 "\000\040\010\000\000\000\000\025\074\005\023\000\000\020\004\000\300\020\222\006\200"},
-	{268, "small_stmt", 0, 2, states_12,
-	 "\000\040\010\000\000\000\000\025\074\005\023\000\000\020\004\000\300\020\222\006\200"},
-	{269, "expr_stmt", 0, 6, states_13,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{270, "augassign", 0, 2, states_14,
-	 "\000\000\000\000\000\360\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{271, "print_stmt", 0, 9, states_15,
-	 "\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{272, "del_stmt", 0, 3, states_16,
-	 "\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{273, "pass_stmt", 0, 2, states_17,
-	 "\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{274, "flow_stmt", 0, 2, states_18,
-	 "\000\000\000\000\000\000\000\000\074\000\000\000\000\000\000\000\000\000\000\000\200"},
-	{275, "break_stmt", 0, 2, states_19,
-	 "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{276, "continue_stmt", 0, 2, states_20,
-	 "\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{277, "return_stmt", 0, 3, states_21,
-	 "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{278, "yield_stmt", 0, 2, states_22,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200"},
-	{279, "raise_stmt", 0, 7, states_23,
-	 "\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{280, "import_stmt", 0, 2, states_24,
-	 "\000\000\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000\000\000\000\000"},
-	{281, "import_name", 0, 3, states_25,
-	 "\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000"},
-	{282, "import_from", 0, 8, states_26,
-	 "\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000"},
-	{283, "import_as_name", 0, 4, states_27,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{284, "dotted_as_name", 0, 4, states_28,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{285, "import_as_names", 0, 3, states_29,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{286, "dotted_as_names", 0, 2, states_30,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{287, "dotted_name", 0, 2, states_31,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{288, "global_stmt", 0, 3, states_32,
-	 "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"},
-	{289, "exec_stmt", 0, 7, states_33,
-	 "\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000"},
-	{290, "assert_stmt", 0, 5, states_34,
-	 "\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
-	{291, "compound_stmt", 0, 2, states_35,
-	 "\000\010\004\000\000\000\000\000\000\000\000\310\011\000\000\000\000\000\000\000\001"},
-	{292, "if_stmt", 0, 8, states_36,
-	 "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
-	{293, "while_stmt", 0, 8, states_37,
-	 "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
-	{294, "for_stmt", 0, 10, states_38,
-	 "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"},
-	{295, "try_stmt", 0, 13, states_39,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"},
-	{296, "with_stmt", 0, 6, states_40,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000"},
-	{297, "with_var", 0, 3, states_41,
-	 "\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000"},
-	{298, "except_clause", 0, 5, states_42,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000"},
-	{299, "suite", 0, 5, states_43,
-	 "\004\040\010\000\000\000\000\025\074\005\023\000\000\020\004\000\300\020\222\006\200"},
-	{300, "testlist_safe", 0, 5, states_44,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{301, "old_test", 0, 2, states_45,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{302, "old_lambdef", 0, 5, states_46,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000"},
-	{303, "test", 0, 6, states_47,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{304, "or_test", 0, 2, states_48,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\004\000\300\020\222\006\000"},
-	{305, "and_test", 0, 2, states_49,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\004\000\300\020\222\006\000"},
-	{306, "not_test", 0, 3, states_50,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\004\000\300\020\222\006\000"},
-	{307, "comparison", 0, 2, states_51,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{308, "comp_op", 0, 4, states_52,
-	 "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\344\037\000\000\000\000\000"},
-	{309, "expr", 0, 2, states_53,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{310, "xor_expr", 0, 2, states_54,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{311, "and_expr", 0, 2, states_55,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{312, "shift_expr", 0, 2, states_56,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{313, "arith_expr", 0, 2, states_57,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{314, "term", 0, 2, states_58,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{315, "factor", 0, 3, states_59,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{316, "power", 0, 4, states_60,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\222\006\000"},
-	{317, "atom", 0, 11, states_61,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\222\006\000"},
-	{318, "listmaker", 0, 5, states_62,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{319, "testlist_gexp", 0, 5, states_63,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{320, "lambdef", 0, 5, states_64,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000"},
-	{321, "trailer", 0, 7, states_65,
-	 "\000\040\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\002\000\000"},
-	{322, "subscriptlist", 0, 3, states_66,
-	 "\000\040\050\000\000\000\000\000\000\010\000\000\000\020\004\000\300\020\222\006\000"},
-	{323, "subscript", 0, 7, states_67,
-	 "\000\040\050\000\000\000\000\000\000\010\000\000\000\020\004\000\300\020\222\006\000"},
-	{324, "sliceop", 0, 3, states_68,
-	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{325, "exprlist", 0, 3, states_69,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\300\020\222\006\000"},
-	{326, "testlist", 0, 3, states_70,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{327, "dictmaker", 0, 5, states_71,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{328, "classdef", 0, 8, states_72,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"},
-	{329, "arglist", 0, 8, states_73,
-	 "\000\040\010\060\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{330, "argument", 0, 4, states_74,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{331, "list_iter", 0, 2, states_75,
-	 "\000\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\000\000\000\000\000"},
-	{332, "list_for", 0, 6, states_76,
-	 "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"},
-	{333, "list_if", 0, 4, states_77,
-	 "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
-	{334, "gen_iter", 0, 2, states_78,
-	 "\000\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\000\000\000\000\000"},
-	{335, "gen_for", 0, 6, states_79,
-	 "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"},
-	{336, "gen_if", 0, 4, states_80,
-	 "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
-	{337, "testlist1", 0, 2, states_81,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\020\004\000\300\020\222\006\000"},
-	{338, "encoding_decl", 0, 2, states_82,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{339, "yield_expr", 0, 3, states_83,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200"},
+	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{261, "decorated", 0, 3, states_5,
+	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{262, "funcdef", 0, 6, states_6,
+	 "\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{263, "parameters", 0, 4, states_7,
+	 "\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{264, "varargslist", 0, 10, states_8,
+	 "\000\040\040\300\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{265, "fpdef", 0, 4, states_9,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{266, "fplist", 0, 3, states_10,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{267, "stmt", 0, 2, states_11,
+	 "\000\050\060\000\000\000\000\124\360\024\114\220\023\040\010\000\200\041\044\015\002\001"},
+	{268, "simple_stmt", 0, 4, states_12,
+	 "\000\040\040\000\000\000\000\124\360\024\114\000\000\040\010\000\200\041\044\015\000\001"},
+	{269, "small_stmt", 0, 2, states_13,
+	 "\000\040\040\000\000\000\000\124\360\024\114\000\000\040\010\000\200\041\044\015\000\001"},
+	{270, "expr_stmt", 0, 6, states_14,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{271, "augassign", 0, 2, states_15,
+	 "\000\000\000\000\000\300\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{272, "print_stmt", 0, 9, states_16,
+	 "\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{273, "del_stmt", 0, 3, states_17,
+	 "\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{274, "pass_stmt", 0, 2, states_18,
+	 "\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{275, "flow_stmt", 0, 2, states_19,
+	 "\000\000\000\000\000\000\000\000\360\000\000\000\000\000\000\000\000\000\000\000\000\001"},
+	{276, "break_stmt", 0, 2, states_20,
+	 "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{277, "continue_stmt", 0, 2, states_21,
+	 "\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{278, "return_stmt", 0, 3, states_22,
+	 "\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{279, "yield_stmt", 0, 2, states_23,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"},
+	{280, "raise_stmt", 0, 7, states_24,
+	 "\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{281, "import_stmt", 0, 2, states_25,
+	 "\000\000\000\000\000\000\000\000\000\024\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{282, "import_name", 0, 3, states_26,
+	 "\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{283, "import_from", 0, 8, states_27,
+	 "\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{284, "import_as_name", 0, 4, states_28,
+	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{285, "dotted_as_name", 0, 4, states_29,
+	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{286, "import_as_names", 0, 3, states_30,
+	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{287, "dotted_as_names", 0, 2, states_31,
+	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{288, "dotted_name", 0, 2, states_32,
+	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{289, "global_stmt", 0, 3, states_33,
+	 "\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000"},
+	{290, "exec_stmt", 0, 7, states_34,
+	 "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000"},
+	{291, "assert_stmt", 0, 5, states_35,
+	 "\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000"},
+	{292, "compound_stmt", 0, 2, states_36,
+	 "\000\010\020\000\000\000\000\000\000\000\000\220\023\000\000\000\000\000\000\000\002\000"},
+	{293, "if_stmt", 0, 8, states_37,
+	 "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
+	{294, "while_stmt", 0, 8, states_38,
+	 "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
+	{295, "for_stmt", 0, 10, states_39,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000"},
+	{296, "try_stmt", 0, 13, states_40,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
+	{297, "with_stmt", 0, 6, states_41,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"},
+	{298, "with_var", 0, 3, states_42,
+	 "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000"},
+	{299, "except_clause", 0, 5, states_43,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
+	{300, "suite", 0, 5, states_44,
+	 "\004\040\040\000\000\000\000\124\360\024\114\000\000\040\010\000\200\041\044\015\000\001"},
+	{301, "testlist_safe", 0, 5, states_45,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{302, "old_test", 0, 2, states_46,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{303, "old_lambdef", 0, 5, states_47,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000"},
+	{304, "test", 0, 6, states_48,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{305, "or_test", 0, 2, states_49,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\015\000\000"},
+	{306, "and_test", 0, 2, states_50,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\015\000\000"},
+	{307, "not_test", 0, 3, states_51,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\015\000\000"},
+	{308, "comparison", 0, 2, states_52,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{309, "comp_op", 0, 4, states_53,
+	 "\000\000\000\000\000\000\000\000\000\000\040\000\000\000\310\077\000\000\000\000\000\000"},
+	{310, "expr", 0, 2, states_54,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{311, "xor_expr", 0, 2, states_55,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{312, "and_expr", 0, 2, states_56,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{313, "shift_expr", 0, 2, states_57,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{314, "arith_expr", 0, 2, states_58,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{315, "term", 0, 2, states_59,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{316, "factor", 0, 3, states_60,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{317, "power", 0, 4, states_61,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\044\015\000\000"},
+	{318, "atom", 0, 11, states_62,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\044\015\000\000"},
+	{319, "listmaker", 0, 5, states_63,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{320, "testlist_gexp", 0, 5, states_64,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{321, "lambdef", 0, 5, states_65,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000"},
+	{322, "trailer", 0, 7, states_66,
+	 "\000\040\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\004\000\000\000"},
+	{323, "subscriptlist", 0, 3, states_67,
+	 "\000\040\240\000\000\000\000\000\000\040\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{324, "subscript", 0, 7, states_68,
+	 "\000\040\240\000\000\000\000\000\000\040\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{325, "sliceop", 0, 3, states_69,
+	 "\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{326, "exprlist", 0, 3, states_70,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"},
+	{327, "testlist", 0, 3, states_71,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{328, "dictmaker", 0, 5, states_72,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{329, "classdef", 0, 8, states_73,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000"},
+	{330, "arglist", 0, 8, states_74,
+	 "\000\040\040\300\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{331, "argument", 0, 4, states_75,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{332, "list_iter", 0, 2, states_76,
+	 "\000\000\000\000\000\000\000\000\000\000\000\020\001\000\000\000\000\000\000\000\000\000"},
+	{333, "list_for", 0, 6, states_77,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000"},
+	{334, "list_if", 0, 4, states_78,
+	 "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
+	{335, "gen_iter", 0, 2, states_79,
+	 "\000\000\000\000\000\000\000\000\000\000\000\020\001\000\000\000\000\000\000\000\000\000"},
+	{336, "gen_for", 0, 6, states_80,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000"},
+	{337, "gen_if", 0, 4, states_81,
+	 "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
+	{338, "testlist1", 0, 2, states_82,
+	 "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
+	{339, "encoding_decl", 0, 2, states_83,
+	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{340, "yield_expr", 0, 3, states_84,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"},
 };
-static label labels[168] = {
+static label labels[169] = {
 	{0, "EMPTY"},
 	{256, 0},
 	{4, 0},
-	{267, 0},
-	{291, 0},
+	{268, 0},
+	{292, 0},
 	{257, 0},
-	{266, 0},
+	{267, 0},
 	{0, 0},
 	{258, 0},
-	{326, 0},
+	{327, 0},
 	{259, 0},
 	{50, 0},
-	{287, 0},
+	{288, 0},
 	{7, 0},
-	{329, 0},
+	{330, 0},
 	{8, 0},
 	{260, 0},
 	{261, 0},
+	{329, 0},
+	{262, 0},
 	{1, "def"},
 	{1, 0},
-	{262, 0},
-	{11, 0},
-	{299, 0},
 	{263, 0},
+	{11, 0},
+	{300, 0},
 	{264, 0},
+	{265, 0},
 	{22, 0},
-	{303, 0},
+	{304, 0},
 	{12, 0},
 	{16, 0},
 	{36, 0},
-	{265, 0},
-	{268, 0},
-	{13, 0},
+	{266, 0},
 	{269, 0},
-	{271, 0},
+	{13, 0},
+	{270, 0},
 	{272, 0},
 	{273, 0},
 	{274, 0},
-	{280, 0},
-	{288, 0},
+	{275, 0},
+	{281, 0},
 	{289, 0},
 	{290, 0},
-	{270, 0},
-	{339, 0},
+	{291, 0},
+	{271, 0},
+	{340, 0},
 	{37, 0},
 	{38, 0},
 	{39, 0},
@@ -2009,64 +2024,63 @@
 	{1, "print"},
 	{35, 0},
 	{1, "del"},
-	{325, 0},
+	{326, 0},
 	{1, "pass"},
-	{275, 0},
 	{276, 0},
 	{277, 0},
-	{279, 0},
 	{278, 0},
+	{280, 0},
+	{279, 0},
 	{1, "break"},
 	{1, "continue"},
 	{1, "return"},
 	{1, "raise"},
-	{281, 0},
 	{282, 0},
+	{283, 0},
 	{1, "import"},
-	{286, 0},
+	{287, 0},
 	{1, "from"},
 	{23, 0},
-	{285, 0},
-	{283, 0},
-	{1, "as"},
+	{286, 0},
 	{284, 0},
+	{1, "as"},
+	{285, 0},
 	{1, "global"},
 	{1, "exec"},
-	{309, 0},
+	{310, 0},
 	{1, "in"},
 	{1, "assert"},
-	{292, 0},
 	{293, 0},
 	{294, 0},
 	{295, 0},
 	{296, 0},
-	{328, 0},
+	{297, 0},
 	{1, "if"},
 	{1, "elif"},
 	{1, "else"},
 	{1, "while"},
 	{1, "for"},
 	{1, "try"},
-	{298, 0},
+	{299, 0},
 	{1, "finally"},
 	{1, "with"},
-	{297, 0},
+	{298, 0},
 	{1, "except"},
 	{5, 0},
 	{6, 0},
-	{300, 0},
 	{301, 0},
-	{304, 0},
 	{302, 0},
-	{1, "lambda"},
-	{320, 0},
 	{305, 0},
-	{1, "or"},
+	{303, 0},
+	{1, "lambda"},
+	{321, 0},
 	{306, 0},
+	{1, "or"},
+	{307, 0},
 	{1, "and"},
 	{1, "not"},
-	{307, 0},
 	{308, 0},
+	{309, 0},
 	{20, 0},
 	{21, 0},
 	{28, 0},
@@ -2075,53 +2089,53 @@
 	{29, 0},
 	{29, 0},
 	{1, "is"},
-	{310, 0},
-	{18, 0},
 	{311, 0},
-	{33, 0},
+	{18, 0},
 	{312, 0},
-	{19, 0},
+	{33, 0},
 	{313, 0},
-	{34, 0},
+	{19, 0},
 	{314, 0},
+	{34, 0},
+	{315, 0},
 	{14, 0},
 	{15, 0},
-	{315, 0},
+	{316, 0},
 	{17, 0},
 	{24, 0},
 	{48, 0},
 	{32, 0},
-	{316, 0},
 	{317, 0},
-	{321, 0},
-	{319, 0},
-	{9, 0},
 	{318, 0},
+	{322, 0},
+	{320, 0},
+	{9, 0},
+	{319, 0},
 	{10, 0},
 	{26, 0},
-	{327, 0},
+	{328, 0},
 	{27, 0},
 	{25, 0},
-	{337, 0},
+	{338, 0},
 	{2, 0},
 	{3, 0},
-	{332, 0},
-	{335, 0},
-	{322, 0},
+	{333, 0},
+	{336, 0},
 	{323, 0},
 	{324, 0},
+	{325, 0},
 	{1, "class"},
-	{330, 0},
 	{331, 0},
-	{333, 0},
+	{332, 0},
 	{334, 0},
-	{336, 0},
-	{338, 0},
+	{335, 0},
+	{337, 0},
+	{339, 0},
 	{1, "yield"},
 };
 grammar _PyParser_Grammar = {
-	84,
+	85,
 	dfas,
-	{168, labels},
+	{169, labels},
 	256
 };

Modified: python/branches/trunk-math/Python/import.c
==============================================================================
--- python/branches/trunk-math/Python/import.c	(original)
+++ python/branches/trunk-math/Python/import.c	Thu Feb 28 21:09:17 2008
@@ -22,6 +22,11 @@
 extern "C" { 
 #endif
 
+#ifdef MS_WINDOWS
+/* for stat.st_mode */
+typedef unsigned short mode_t;
+#endif
+
 extern time_t PyOS_GetLastModificationTime(char *, FILE *);
 						/* In getmtime.c */
 
@@ -829,7 +834,7 @@
 /* Helper to open a bytecode file for writing in exclusive mode */
 
 static FILE *
-open_exclusive(char *filename)
+open_exclusive(char *filename, mode_t mode)
 {
 #if defined(O_EXCL)&&defined(O_CREAT)&&defined(O_WRONLY)&&defined(O_TRUNC)
 	/* Use O_EXCL to avoid a race condition when another process tries to
@@ -845,9 +850,9 @@
 				|O_BINARY   /* necessary for Windows */
 #endif
 #ifdef __VMS
-                        , 0666, "ctxt=bin", "shr=nil"
+                        , mode, "ctxt=bin", "shr=nil"
 #else
-                        , 0666
+                        , mode
 #endif
 		  );
 	if (fd < 0)
@@ -866,11 +871,13 @@
    remove the file. */
 
 static void
-write_compiled_module(PyCodeObject *co, char *cpathname, time_t mtime)
+write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
 {
 	FILE *fp;
+	time_t mtime = srcstat->st_mtime;
+	mode_t mode = srcstat->st_mode;
 
-	fp = open_exclusive(cpathname);
+	fp = open_exclusive(cpathname, mode);
 	if (fp == NULL) {
 		if (Py_VerboseFlag)
 			PySys_WriteStderr(
@@ -907,17 +914,16 @@
 static PyObject *
 load_source_module(char *name, char *pathname, FILE *fp)
 {
-	time_t mtime;
+	struct stat st;
 	FILE *fpc;
 	char buf[MAXPATHLEN+1];
 	char *cpathname;
 	PyCodeObject *co;
 	PyObject *m;
-
-	mtime = PyOS_GetLastModificationTime(pathname, fp);
-	if (mtime == (time_t)(-1)) {
+	
+	if (fstat(fileno(fp), &st) != 0) {
 		PyErr_Format(PyExc_RuntimeError,
-			     "unable to get modification time from '%s'",
+			     "unable to get file status from '%s'",
 			     pathname);
 		return NULL;
 	}
@@ -926,7 +932,7 @@
 	   in 4 bytes. This will be fine until sometime in the year 2038,
 	   when a 4-byte signed time_t will overflow.
 	 */
-	if (mtime >> 32) {
+	if (st.st_mtime >> 32) {
 		PyErr_SetString(PyExc_OverflowError,
 			"modification time overflows a 4 byte field");
 		return NULL;
@@ -935,7 +941,7 @@
 	cpathname = make_compiled_pathname(pathname, buf,
 					   (size_t)MAXPATHLEN + 1);
 	if (cpathname != NULL &&
-	    (fpc = check_compiled_module(pathname, mtime, cpathname))) {
+	    (fpc = check_compiled_module(pathname, st.st_mtime, cpathname))) {
 		co = read_compiled_module(cpathname, fpc);
 		fclose(fpc);
 		if (co == NULL)
@@ -955,7 +961,7 @@
 		if (cpathname) {
 			PyObject *ro = PySys_GetObject("dont_write_bytecode");
 			if (ro == NULL || !PyObject_IsTrue(ro))
-				write_compiled_module(co, cpathname, mtime);
+				write_compiled_module(co, cpathname, &st);
 		}
 	}
 	m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname);

Modified: python/branches/trunk-math/Python/mystrtoul.c
==============================================================================
--- python/branches/trunk-math/Python/mystrtoul.c	(original)
+++ python/branches/trunk-math/Python/mystrtoul.c	Thu Feb 28 21:09:17 2008
@@ -5,14 +5,6 @@
 #define _SGI_MP_SOURCE
 #endif
 
-/* Convert a possibly signed character to a nonnegative int */
-/* XXX This assumes characters are 8 bits wide */
-#ifdef __CHAR_UNSIGNED__
-#define Py_CHARMASK(c)		(c)
-#else
-#define Py_CHARMASK(c)		((c) & 0xff)
-#endif
-
 /* strtol and strtoul, renamed to avoid conflicts */
 
 

Modified: python/branches/trunk-math/Python/peephole.c
==============================================================================
--- python/branches/trunk-math/Python/peephole.c	(original)
+++ python/branches/trunk-math/Python/peephole.c	Thu Feb 28 21:09:17 2008
@@ -317,7 +317,7 @@
 	if (codestr == NULL)
 		goto exitUnchanged;
 	codestr = (unsigned char *)memcpy(codestr, 
-                                        PyString_AS_STRING(code), codelen);
+					  PyString_AS_STRING(code), codelen);
 
 	/* Verify that RETURN_VALUE terminates the codestring.	This allows
 	   the various transformation patterns to look ahead several

Modified: python/branches/trunk-math/Python/pystrtod.c
==============================================================================
--- python/branches/trunk-math/Python/pystrtod.c	(original)
+++ python/branches/trunk-math/Python/pystrtod.c	Thu Feb 28 21:09:17 2008
@@ -186,6 +186,15 @@
 }
 
 
+/* From the C99 standard, section 7.19.6:
+The exponent always contains at least two digits, and only as many more digits
+as necessary to represent the exponent.
+*/
+#define MIN_EXPONENT_DIGITS 2
+
+/* see FORMATBUFLEN in unicodeobject.c */
+#define FLOAT_FORMATBUFLEN 120
+
 /**
  * PyOS_ascii_formatd:
  * @buffer: A buffer to place the resulting string in
@@ -197,8 +206,10 @@
  * Converts a #gdouble to a string, using the '.' as
  * decimal point. To format the number you pass in
  * a printf()-style format string. Allowed conversion
- * specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. 
+ * specifiers are 'e', 'E', 'f', 'F', 'g', 'G', and 'n'.
  * 
+ * 'n' is the same as 'g', except it uses the current locale.
+ *
  * Return value: The pointer to the buffer with the converted string.
  **/
 char *
@@ -207,17 +218,23 @@
 		   const char *format, 
 		   double      d)
 {
-	struct lconv *locale_data;
-	const char *decimal_point;
-	size_t decimal_point_len, rest_len;
 	char *p;
 	char format_char;
+	size_t format_len = strlen(format);
+
+	/* For type 'n', we need to make a copy of the format string, because
+	   we're going to modify 'n' -> 'g', and format is const char*, so we
+	   can't modify it directly.  FLOAT_FORMATBUFLEN should be longer than
+	   we ever need this to be.  There's an upcoming check to ensure it's
+	   big enough. */
+	char tmp_format[FLOAT_FORMATBUFLEN];
 
 /* 	g_return_val_if_fail (buffer != NULL, NULL); */
 /* 	g_return_val_if_fail (format[0] == '%', NULL); */
 /* 	g_return_val_if_fail (strpbrk (format + 1, "'l%") == NULL, NULL); */
 
-	format_char = format[strlen(format) - 1];
+	/* The last character in the format string must be the format char */
+	format_char = format[format_len - 1];
 
 /* 	g_return_val_if_fail (format_char == 'e' || format_char == 'E' || */
 /* 			      format_char == 'f' || format_char == 'F' || */
@@ -227,43 +244,126 @@
 	if (format[0] != '%')
 		return NULL;
 
+	/* I'm not sure why this test is here.  It's ensuring that the format
+	   string after the first character doesn't have a single quote, a
+	   lowercase l, or a percent. This is the reverse of the commented-out
+	   test about 10 lines ago. */
 	if (strpbrk(format + 1, "'l%"))
 		return NULL;
 
 	if (!(format_char == 'e' || format_char == 'E' || 
 	      format_char == 'f' || format_char == 'F' || 
-	      format_char == 'g' || format_char == 'G'))
+	      format_char == 'g' || format_char == 'G' ||
+	      format_char == 'n'))
 		return NULL;
 
+	/* Map 'n' format_char to 'g', by copying the format string and
+	   replacing the final 'n' with a 'g' */
+	if (format_char == 'n') {
+		if (format_len + 1 >= sizeof(tmp_format)) {
+			/* The format won't fit in our copy.  Error out.  In
+			   practice, this will never happen and will be detected
+			   by returning NULL */
+			return NULL;
+		}
+		strcpy(tmp_format, format);
+		tmp_format[format_len - 1] = 'g';
+		format = tmp_format;
+	}
 
+	/* Have PyOS_snprintf do the hard work */
 	PyOS_snprintf(buffer, buf_len, format, d);
 
-	locale_data = localeconv();
-	decimal_point = locale_data->decimal_point;
-	decimal_point_len = strlen(decimal_point);
-
-	assert(decimal_point_len != 0);
-
-	if (decimal_point[0] != '.' || 
-	    decimal_point[1] != 0)
-	{
-		p = buffer;
-
-		if (*p == '+' || *p == '-')
-			p++;
-
-		while (isdigit((unsigned char)*p))
-			p++;
-
-		if (strncmp(p, decimal_point, decimal_point_len) == 0)
-		{
-			*p = '.';
-			p++;
-			if (decimal_point_len > 1) {
-				rest_len = strlen(p + (decimal_point_len - 1));
-				memmove(p, p + (decimal_point_len - 1), 
-					rest_len);
-				p[rest_len] = 0;
+	/* Get the current local, and find the decimal point character (or
+	   string?).  Convert that string back to a dot.  Do not do this if
+	   using the 'n' (number) format code. */
+	if (format_char != 'n') {
+		struct lconv *locale_data = localeconv();
+		const char *decimal_point = locale_data->decimal_point;
+		size_t decimal_point_len = strlen(decimal_point);
+		size_t rest_len;
+
+		assert(decimal_point_len != 0);
+
+		if (decimal_point[0] != '.' || decimal_point[1] != 0) {
+			p = buffer;
+
+			if (*p == '+' || *p == '-')
+				p++;
+
+			while (isdigit(Py_CHARMASK(*p)))
+				p++;
+
+			if (strncmp(p, decimal_point, decimal_point_len) == 0) {
+				*p = '.';
+				p++;
+				if (decimal_point_len > 1) {
+					rest_len = strlen(p +
+						      (decimal_point_len - 1));
+					memmove(p, p + (decimal_point_len - 1),
+						rest_len);
+					p[rest_len] = 0;
+				}
+			}
+		}
+	}
+
+	/* If an exponent exists, ensure that the exponent is at least
+	   MIN_EXPONENT_DIGITS digits, providing the buffer is large enough
+	   for the extra zeros.  Also, if there are more than
+	   MIN_EXPONENT_DIGITS, remove as many zeros as possible until we get
+	   back to MIN_EXPONENT_DIGITS */
+	p = strpbrk(buffer, "eE");
+	if (p && (*(p + 1) == '-' || *(p + 1) == '+')) {
+		char *start = p + 2;
+		int exponent_digit_cnt = 0;
+		int leading_zero_cnt = 0;
+		int in_leading_zeros = 1;
+		int significant_digit_cnt;
+
+		p += 2;
+		while (*p && isdigit(Py_CHARMASK(*p))) {
+			if (in_leading_zeros && *p == '0')
+				++leading_zero_cnt;
+			if (*p != '0')
+				in_leading_zeros = 0;
+			++p;
+			++exponent_digit_cnt;
+		}
+
+		significant_digit_cnt = exponent_digit_cnt - leading_zero_cnt;
+		if (exponent_digit_cnt == MIN_EXPONENT_DIGITS) {
+			/* If there are 2 exactly digits, we're done,
+			   regardless of what they contain */
+		}
+		else if (exponent_digit_cnt > MIN_EXPONENT_DIGITS) {
+			int extra_zeros_cnt;
+
+			/* There are more than 2 digits in the exponent.  See
+			   if we can delete some of the leading zeros */
+			if (significant_digit_cnt < MIN_EXPONENT_DIGITS)
+				significant_digit_cnt = MIN_EXPONENT_DIGITS;
+			extra_zeros_cnt = exponent_digit_cnt - significant_digit_cnt;
+
+			/* Delete extra_zeros_cnt worth of characters from the
+			   front of the exponent */
+			assert(extra_zeros_cnt >= 0);
+
+			/* Add one to significant_digit_cnt to copy the
+			   trailing 0 byte, thus setting the length */
+			memmove(start,
+				start + extra_zeros_cnt,
+				significant_digit_cnt + 1);
+		}
+		else {
+			/* If there are fewer than 2 digits, add zeros
+			   until there are 2, if there's enough room */
+			int zeros = MIN_EXPONENT_DIGITS - exponent_digit_cnt;
+			if (start + zeros + exponent_digit_cnt + 1
+			      < buffer + buf_len) {
+				memmove(start + zeros, start,
+					exponent_digit_cnt + 1);
+				memset(start, '0', zeros);
 			}
 		}
 	}

Modified: python/branches/trunk-math/Python/pythonrun.c
==============================================================================
--- python/branches/trunk-math/Python/pythonrun.c	(original)
+++ python/branches/trunk-math/Python/pythonrun.c	Thu Feb 28 21:09:17 2008
@@ -1701,8 +1701,14 @@
 		   not enough space left on the stack */
 		alloca(PYOS_STACK_MARGIN * sizeof(void*));
 		return 0;
-	} __except (EXCEPTION_EXECUTE_HANDLER) {
-		/* just ignore all errors */
+	} __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ?
+		        EXCEPTION_EXECUTE_HANDLER : 
+		        EXCEPTION_CONTINUE_SEARCH) {
+		int errcode = _resetstkoflw();
+		if (errcode)
+		{
+			Py_FatalError("Could not reset the stack!");
+		}
 	}
 	return 1;
 }

Modified: python/branches/trunk-math/Python/symtable.c
==============================================================================
--- python/branches/trunk-math/Python/symtable.c	(original)
+++ python/branches/trunk-math/Python/symtable.c	Thu Feb 28 21:09:17 2008
@@ -931,8 +931,8 @@
 			return 0;
 		if (s->v.FunctionDef.args->defaults)
 			VISIT_SEQ(st, expr, s->v.FunctionDef.args->defaults);
-		if (s->v.FunctionDef.decorators)
-			VISIT_SEQ(st, expr, s->v.FunctionDef.decorators);
+		if (s->v.FunctionDef.decorator_list)
+			VISIT_SEQ(st, expr, s->v.FunctionDef.decorator_list);
 		if (!symtable_enter_block(st, s->v.FunctionDef.name, 
 					  FunctionBlock, (void *)s, s->lineno))
 			return 0;
@@ -946,6 +946,8 @@
 		if (!symtable_add_def(st, s->v.ClassDef.name, DEF_LOCAL))
 			return 0;
 		VISIT_SEQ(st, expr, s->v.ClassDef.bases);
+		if (s->v.ClassDef.decorator_list)
+			VISIT_SEQ(st, expr, s->v.ClassDef.decorator_list);
 		if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock, 
 					  (void *)s, s->lineno))
 			return 0;

Modified: python/branches/trunk-math/Tools/compiler/ast.txt
==============================================================================
--- python/branches/trunk-math/Tools/compiler/ast.txt	(original)
+++ python/branches/trunk-math/Tools/compiler/ast.txt	Thu Feb 28 21:09:17 2008
@@ -14,7 +14,7 @@
 Decorators: nodes!
 Function: decorators&, name*, argnames*, defaults!, flags*, doc*, code
 Lambda: argnames*, defaults!, flags*, code
-Class: name*, bases!, doc*, code
+Class: name*, bases!, doc*, code, decorators& = None
 Pass: 
 Break: 
 Continue: 
@@ -97,7 +97,7 @@
         self.kwargs = 1
 
 init(GenExpr):
-    self.argnames = ['[outmost-iterable]']
+    self.argnames = ['.0']
     self.varargs = self.kwargs = None
 
 init(GenExprFor):

Modified: python/branches/trunk-math/Tools/compiler/astgen.py
==============================================================================
--- python/branches/trunk-math/Tools/compiler/astgen.py	(original)
+++ python/branches/trunk-math/Tools/compiler/astgen.py	Thu Feb 28 21:09:17 2008
@@ -8,7 +8,6 @@
 """
 
 import fileinput
-import getopt
 import re
 import sys
 from StringIO import StringIO

Modified: python/branches/trunk-math/Tools/compiler/dumppyc.py
==============================================================================
--- python/branches/trunk-math/Tools/compiler/dumppyc.py	(original)
+++ python/branches/trunk-math/Tools/compiler/dumppyc.py	Thu Feb 28 21:09:17 2008
@@ -1,7 +1,6 @@
 #! /usr/bin/env python
 
 import marshal
-import os
 import dis
 import types
 

Modified: python/branches/trunk-math/Tools/faqwiz/faqw.py
==============================================================================
--- python/branches/trunk-math/Tools/faqwiz/faqw.py	(original)
+++ python/branches/trunk-math/Tools/faqwiz/faqw.py	Thu Feb 28 21:09:17 2008
@@ -20,7 +20,7 @@
 try:
     FAQDIR = "/usr/people/guido/python/FAQ"
     SRCDIR = "/usr/people/guido/python/src/Tools/faqwiz"
-    import os, sys, time, operator
+    import os, sys
     os.chdir(FAQDIR)
     sys.path.insert(0, SRCDIR)
     import faqwiz

Modified: python/branches/trunk-math/Tools/modulator/Tkextra.py
==============================================================================
--- python/branches/trunk-math/Tools/modulator/Tkextra.py	(original)
+++ python/branches/trunk-math/Tools/modulator/Tkextra.py	Thu Feb 28 21:09:17 2008
@@ -218,7 +218,6 @@
                   0, 'Save', 'Save as text')
 
 def _test():
-    import sys
     global mainWidget
     mainWidget = Frame()
     Pack.config(mainWidget)

Modified: python/branches/trunk-math/Tools/pybench/systimes.py
==============================================================================
--- python/branches/trunk-math/Tools/pybench/systimes.py	(original)
+++ python/branches/trunk-math/Tools/pybench/systimes.py	Thu Feb 28 21:09:17 2008
@@ -31,7 +31,7 @@
     the author. All Rights Reserved.
 
 """
-import time, sys, struct
+import time, sys
 
 #
 # Note: Please keep this module compatible to Python 1.5.2.

Modified: python/branches/trunk-math/Tools/pynche/ChipViewer.py
==============================================================================
--- python/branches/trunk-math/Tools/pynche/ChipViewer.py	(original)
+++ python/branches/trunk-math/Tools/pynche/ChipViewer.py	Thu Feb 28 21:09:17 2008
@@ -13,7 +13,6 @@
 selected and nearest ChipWidgets.
 """
 
-from types import StringType
 from Tkinter import *
 import ColorDB
 

Modified: python/branches/trunk-math/Tools/pynche/TypeinViewer.py
==============================================================================
--- python/branches/trunk-math/Tools/pynche/TypeinViewer.py	(original)
+++ python/branches/trunk-math/Tools/pynche/TypeinViewer.py	Thu Feb 28 21:09:17 2008
@@ -12,8 +12,6 @@
 you must hit Return or Tab to select the color.
 """
 
-import sys
-import re
 from Tkinter import *
 
 

Modified: python/branches/trunk-math/Tools/scripts/logmerge.py
==============================================================================
--- python/branches/trunk-math/Tools/scripts/logmerge.py	(original)
+++ python/branches/trunk-math/Tools/scripts/logmerge.py	Thu Feb 28 21:09:17 2008
@@ -34,7 +34,7 @@
 from their output.
 """
 
-import os, sys, errno, getopt, re
+import sys, errno, getopt, re
 
 sep1 = '='*77 + '\n'                    # file separator
 sep2 = '-'*28 + '\n'                    # revision separator

Modified: python/branches/trunk-math/Tools/scripts/nm2def.py
==============================================================================
--- python/branches/trunk-math/Tools/scripts/nm2def.py	(original)
+++ python/branches/trunk-math/Tools/scripts/nm2def.py	Thu Feb 28 21:09:17 2008
@@ -34,7 +34,7 @@
 option to produce this format (since it is the original v7 Unix format).
 
 """
-import os,re,sys
+import os, sys
 
 PYTHONLIB = 'libpython'+sys.version[:3]+'.a'
 PC_PYTHONLIB = 'Python'+sys.version[0]+sys.version[2]+'.dll'

Modified: python/branches/trunk-math/Tools/scripts/pindent.py
==============================================================================
--- python/branches/trunk-math/Tools/scripts/pindent.py	(original)
+++ python/branches/trunk-math/Tools/scripts/pindent.py	Thu Feb 28 21:09:17 2008
@@ -81,7 +81,6 @@
 TABSIZE = 8
 EXPANDTABS = 0
 
-import os
 import re
 import sys
 

Modified: python/branches/trunk-math/Tools/scripts/pysource.py
==============================================================================
--- python/branches/trunk-math/Tools/scripts/pysource.py	(original)
+++ python/branches/trunk-math/Tools/scripts/pysource.py	Thu Feb 28 21:09:17 2008
@@ -20,7 +20,7 @@
 __all__ = ["has_python_ext", "looks_like_python", "can_be_compiled", "walk_python_files"]
 
 
-import sys, os, re
+import os, re
 
 binary_re = re.compile('[\x00-\x08\x0E-\x1F\x7F]')
 

Modified: python/branches/trunk-math/Tools/scripts/reindent.py
==============================================================================
--- python/branches/trunk-math/Tools/scripts/reindent.py	(original)
+++ python/branches/trunk-math/Tools/scripts/reindent.py	Thu Feb 28 21:09:17 2008
@@ -4,10 +4,11 @@
 
 """reindent [-d][-r][-v] [ path ... ]
 
--d (--dryrun)  Dry run.  Analyze, but don't make any changes to, files.
--r (--recurse) Recurse.  Search for all .py files in subdirectories too.
--v (--verbose) Verbose.  Print informative msgs; else no output.
--h (--help)    Help.     Print this usage information and exit.
+-d (--dryrun)   Dry run.   Analyze, but don't make any changes to, files.
+-r (--recurse)  Recurse.   Search for all .py files in subdirectories too.
+-n (--nobackup) No backup. Does not make a ".bak" file before reindenting.
+-v (--verbose)  Verbose.   Print informative msgs; else no output.
+-h (--help)     Help.      Print this usage information and exit.
 
 Change Python (.py) files to use 4-space indents and no hard tab characters.
 Also trim excess spaces and tabs from ends of lines, and remove empty lines
@@ -31,17 +32,23 @@
 The hard part of reindenting is figuring out what to do with comment
 lines.  So long as the input files get a clean bill of health from
 tabnanny.py, reindent should do a good job.
+
+The backup file is a copy of the one that is being reindented. The ".bak"
+file is generated with shutil.copy(), but some corner cases regarding
+user/group and permissions could leave the backup file more readable that
+you'd prefer. You can always use the --nobackup option to prevent this.
 """
 
 __version__ = "1"
 
 import tokenize
-import os
+import os, shutil
 import sys
 
-verbose = 0
-recurse = 0
-dryrun  = 0
+verbose    = 0
+recurse    = 0
+dryrun     = 0
+makebackup = True
 
 def usage(msg=None):
     if msg is not None:
@@ -57,10 +64,10 @@
 
 def main():
     import getopt
-    global verbose, recurse, dryrun
+    global verbose, recurse, dryrun, makebackup
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "drvh",
-                                   ["dryrun", "recurse", "verbose", "help"])
+        opts, args = getopt.getopt(sys.argv[1:], "drnvh",
+                        ["dryrun", "recurse", "nobackup", "verbose", "help"])
     except getopt.error, msg:
         usage(msg)
         return
@@ -69,6 +76,8 @@
             dryrun += 1
         elif o in ('-r', '--recurse'):
             recurse += 1
+        elif o in ('-n', '--nobackup'):
+            makebackup = False
         elif o in ('-v', '--verbose'):
             verbose += 1
         elif o in ('-h', '--help'):
@@ -112,11 +121,10 @@
                 print "But this is a dry run, so leaving it alone."
         if not dryrun:
             bak = file + ".bak"
-            if os.path.exists(bak):
-                os.remove(bak)
-            os.rename(file, bak)
-            if verbose:
-                print "renamed", file, "to", bak
+            if makebackup:
+                shutil.copyfile(file, bak)
+                if verbose:
+                    print "backed up", file, "to", bak
             f = open(file, "w")
             r.write(f)
             f.close()

Modified: python/branches/trunk-math/Tools/scripts/xxci.py
==============================================================================
--- python/branches/trunk-math/Tools/scripts/xxci.py	(original)
+++ python/branches/trunk-math/Tools/scripts/xxci.py	Thu Feb 28 21:09:17 2008
@@ -7,7 +7,6 @@
 import sys
 import os
 from stat import *
-import commands
 import fnmatch
 
 EXECMAGIC = '\001\140\000\010'

Modified: python/branches/trunk-math/Tools/ssl/get-remote-certificate.py
==============================================================================
--- python/branches/trunk-math/Tools/ssl/get-remote-certificate.py	(original)
+++ python/branches/trunk-math/Tools/ssl/get-remote-certificate.py	Thu Feb 28 21:09:17 2008
@@ -6,7 +6,7 @@
 #
 # By Bill Janssen.
 
-import sys, os
+import sys
 
 def fetch_server_certificate (host, port):
 

Modified: python/branches/trunk-math/Tools/unicode/gencodec.py
==============================================================================
--- python/branches/trunk-math/Tools/unicode/gencodec.py	(original)
+++ python/branches/trunk-math/Tools/unicode/gencodec.py	Thu Feb 28 21:09:17 2008
@@ -26,7 +26,7 @@
 
 """#"
 
-import re, os, time, marshal, codecs
+import re, os, marshal, codecs
 
 # Maximum allowed size of charmap tables
 MAX_TABLE_SIZE = 8192

Modified: python/branches/trunk-math/Tools/webchecker/wcgui.py
==============================================================================
--- python/branches/trunk-math/Tools/webchecker/wcgui.py	(original)
+++ python/branches/trunk-math/Tools/webchecker/wcgui.py	Thu Feb 28 21:09:17 2008
@@ -63,7 +63,6 @@
 from Tkinter import *
 import tktools
 import webchecker
-import random
 
 # Override some for a weaker platform
 if sys.platform == 'mac':

Modified: python/branches/trunk-math/Tools/webchecker/wsgui.py
==============================================================================
--- python/branches/trunk-math/Tools/webchecker/wsgui.py	(original)
+++ python/branches/trunk-math/Tools/webchecker/wsgui.py	Thu Feb 28 21:09:17 2008
@@ -7,9 +7,7 @@
 """
 
 from Tkinter import *
-import Tkinter
 import websucker
-import sys
 import os
 import threading
 import Queue

Modified: python/branches/trunk-math/setup.py
==============================================================================
--- python/branches/trunk-math/setup.py	(original)
+++ python/branches/trunk-math/setup.py	Thu Feb 28 21:09:17 2008
@@ -417,6 +417,9 @@
                                libraries=math_libs) )
         exts.append( Extension('datetime', ['datetimemodule.c', 'timemodule.c'],
                                libraries=math_libs) )
+        # code that will be builtins in the future, but conflict with the
+        #  current builtins
+        exts.append( Extension('future_builtins', ['future_builtins.c']) )
         # random number generator implemented in C
         exts.append( Extension("_random", ["_randommodule.c"]) )
         # fast iterator tools implemented in C


More information about the Python-checkins mailing list