[Python-checkins] r53040 - in python/branches/p3yk-noslice: BROKEN Demo/classes/Complex.py Demo/classes/Rat.py Demo/parser/unparse.py Demo/pysvr/pysvr.py Demo/rpc/nfsclient.py Demo/rpc/xdr.py Demo/scripts/lpwatch.py Demo/scripts/primes.py Demo/scripts/update.py Demo/sockets/gopher.py Demo/sockets/rpythond.py Demo/tkinter/guido/ShellWindow.py Doc/Makefile Doc/api/concrete.tex Doc/api/exceptions.tex Doc/api/refcounts.dat Doc/dist/dist.tex Doc/ext/extending.tex Doc/howto/doanddont.tex Doc/howto/functional.rst Doc/howto/regex.tex Doc/inst/inst.tex Doc/lib/asttable.tex Doc/lib/email-unpack.py Doc/lib/libasyncore.tex Doc/lib/libatexit.tex Doc/lib/libbase64.tex Doc/lib/libbsddb.tex Doc/lib/libcfgparser.tex Doc/lib/libcommands.tex Doc/lib/libconsts.tex Doc/lib/libcsv.tex Doc/lib/libctypes.tex Doc/lib/libdatetime.tex Doc/lib/libdecimal.tex Doc/lib/libdis.tex Doc/lib/libetree.tex Doc/lib/libexcs.tex Doc/lib/libfpectl.tex Doc/lib/libfuncs.tex Doc/lib/libfunctools.tex Doc/lib/libgetopt.tex Doc/lib/libhashlib.tex Doc/lib/libheapq.tex Doc/lib/libhotshot.tex Doc/lib/libhttplib.tex Doc/lib/libimp.tex Doc/lib/libitertools.tex Doc/lib/liblogging.tex Doc/lib/libmsilib.tex Doc/lib/liboperator.tex Doc/lib/libos.tex Doc/lib/libparser.tex Doc/lib/libpdb.tex Doc/lib/libpickle.tex Doc/lib/libpopen2.tex Doc/lib/libprofile.tex Doc/lib/libpyexpat.tex Doc/lib/librexec.tex Doc/lib/libsmtplib.tex Doc/lib/libsocket.tex Doc/lib/libsqlite3.tex Doc/lib/libstdtypes.tex Doc/lib/libstdwin.tex Doc/lib/libstring.tex Doc/lib/libsubprocess.tex Doc/lib/libtempfile.tex Doc/lib/libtimeit.tex Doc/lib/libtraceback.tex Doc/lib/libunittest.tex Doc/lib/liburlparse.tex Doc/lib/libuuid.tex Doc/lib/libwinreg.tex Doc/lib/libwsgiref.tex Doc/lib/libxmlrpclib.tex Doc/lib/sqlite3/executescript.py Doc/lib/tkinter.tex Doc/perl/python.perl Doc/ref/ref2.tex Doc/ref/ref3.tex Doc/ref/ref4.tex Doc/ref/ref5.tex Doc/ref/ref6.tex Doc/ref/ref8.tex Doc/ref/reswords.py Doc/tools/py2texi.el Doc/tut/tut.tex Doc/whatsnew/whatsnew25.tex Doc/whatsnew/whatsnew26.tex Grammar/Grammar Include/Python-ast.h Include/abstract.h Include/code.h Include/eval.h Include/funcobject.h Include/graminit.h Include/iterobject.h Include/modsupport.h Include/object.h Include/opcode.h Include/pyport.h Include/symtable.h Include/token.h Lib/Bastion.py Lib/ConfigParser.py Lib/Queue.py Lib/SimpleXMLRPCServer.py Lib/StringIO.py Lib/UserDict.py Lib/UserString.py Lib/_strptime.py Lib/atexit.py Lib/base64.py Lib/bdb.py Lib/bsddb/__init__.py Lib/bsddb/dbtables.py Lib/bsddb/test/test_basics.py Lib/bsddb/test/test_compat.py Lib/bsddb/test/test_dbobj.py Lib/bsddb/test/test_dbshelve.py Lib/bsddb/test/test_recno.py Lib/bsddb/test/test_thread.py Lib/cProfile.py Lib/cgi.py Lib/code.py Lib/codecs.py Lib/colorsys.py Lib/compiler/ast.py Lib/compiler/pyassem.py Lib/compiler/pycodegen.py Lib/compiler/transformer.py Lib/ctypes/__init__.py Lib/ctypes/test/__init__.py Lib/ctypes/test/test_bitfields.py Lib/ctypes/test/test_callbacks.py Lib/ctypes/test/test_cast.py Lib/ctypes/test/test_simplesubclasses.py Lib/ctypes/test/test_structures.py Lib/ctypes/test/test_win32.py Lib/decimal.py Lib/distutils/command/bdist_rpm.py Lib/distutils/command/build_ext.py Lib/distutils/command/install_egg_info.py Lib/distutils/command/register.py Lib/distutils/command/wininst-8.exe Lib/distutils/sysconfig.py Lib/distutils/unixccompiler.py Lib/distutils/version.py Lib/doctest.py Lib/email/base64mime.py Lib/email/charset.py Lib/email/generator.py Lib/email/header.py Lib/email/message.py Lib/email/quoprimime.py Lib/email/test/test_email.py Lib/email/test/test_email_renamed.py Lib/email/utils.py Lib/encodings/__init__.py Lib/encodings/bz2_codec.py Lib/encodings/utf_8_sig.py Lib/encodings/zlib_codec.py Lib/ftplib.py Lib/functools.py Lib/genericpath.py Lib/gzip.py Lib/hashlib.py Lib/httplib.py Lib/idlelib/CodeContext.py Lib/idlelib/ColorDelegator.py Lib/idlelib/EditorWindow.py Lib/idlelib/HyperParser.py Lib/idlelib/NEWS.txt Lib/idlelib/PyShell.py Lib/idlelib/ScriptBinding.py Lib/idlelib/run.py Lib/ihooks.py Lib/imputil.py Lib/inspect.py Lib/keyword.py Lib/lib-tk/Tix.py Lib/lib-tk/Tkinter.py Lib/lib-tk/tkMessageBox.py Lib/lib-tk/tkSimpleDialog.py Lib/lib-tk/turtle.py Lib/logging/__init__.py Lib/logging/config.py Lib/logging/handlers.py Lib/macpath.py Lib/mailbox.py Lib/modulefinder.py Lib/ntpath.py Lib/opcode.py Lib/optparse.py Lib/os.py Lib/os2emxpath.py Lib/pdb.py Lib/plat-irix5/flp.py Lib/plat-irix5/panel.py Lib/plat-irix6/flp.py Lib/plat-irix6/panel.py Lib/plat-mac/FrameWork.py Lib/plat-mac/aetypes.py Lib/plat-mac/appletrawmain.py Lib/plat-mac/buildtools.py Lib/plat-mac/cfmfile.py Lib/plat-mac/gensuitemodule.py Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py Lib/plat-mac/macerrors.py Lib/plat-mac/pimp.py Lib/plat-mac/plistlib.py Lib/plat-riscos/riscosenviron.py Lib/plat-riscos/rourl2path.py Lib/plat-sunos5/STROPTS.py Lib/posixpath.py Lib/pprint.py Lib/profile.py Lib/pstats.py Lib/pty.py Lib/pyclbr.py Lib/pydoc.py Lib/rexec.py Lib/runpy.py Lib/sgmllib.py Lib/site.py Lib/smtplib.py Lib/socket.py Lib/sqlite3/test/types.py Lib/subprocess.py Lib/symbol.py Lib/symtable.py Lib/tarfile.py Lib/test/README Lib/test/crashers/bogus_code_obj.py Lib/test/crashers/bogus_sre_bytecode.py Lib/test/crashers/infinite_loop_re.py Lib/test/crashers/loosing_mro_ref.py Lib/test/list_tests.py Lib/test/mapping_tests.py Lib/test/output/test_MimeWriter Lib/test/output/test_cProfile Lib/test/output/test_cgi Lib/test/output/test_class Lib/test/output/test_cookie Lib/test/output/test_extcall Lib/test/output/test_global Lib/test/output/test_grammar Lib/test/output/test_httplib Lib/test/output/test_math Lib/test/output/test_mmap Lib/test/output/test_nis Lib/test/output/test_opcodes Lib/test/output/test_openpty Lib/test/output/test_poll Lib/test/output/test_profile Lib/test/output/test_regex Lib/test/output/test_scope Lib/test/output/test_tokenize Lib/test/output/test_types Lib/test/output/test_xdrlib Lib/test/outstanding_bugs.py Lib/test/pickletester.py Lib/test/sgml_input.html Lib/test/string_tests.py Lib/test/test_MimeWriter.py Lib/test/test_StringIO.py Lib/test/test___all__.py Lib/test/test___future__.py Lib/test/test_array.py Lib/test/test_ast.py Lib/test/test_binascii.py Lib/test/test_binop.py Lib/test/test_bisect.py Lib/test/test_bool.py Lib/test/test_bsddb3.py Lib/test/test_buffer.py Lib/test/test_bufio.py Lib/test/test_builtin.py Lib/test/test_bytes.py Lib/test/test_bz2.py Lib/test/test_calendar.py Lib/test/test_cfgparser.py Lib/test/test_cgi.py Lib/test/test_class.py Lib/test/test_code.py Lib/test/test_codecencodings_cn.py Lib/test/test_codecs.py Lib/test/test_codeop.py Lib/test/test_compare.py Lib/test/test_compile.py Lib/test/test_compiler.py Lib/test/test_complex_args.py Lib/test/test_contextlib.py Lib/test/test_cookie.py Lib/test/test_copy.py Lib/test/test_datetime.py Lib/test/test_dbm.py Lib/test/test_decimal.py Lib/test/test_descr.py Lib/test/test_descrtut.py Lib/test/test_dict.py Lib/test/test_dis.py Lib/test/test_doctest.py Lib/test/test_enumerate.py Lib/test/test_exceptions.py Lib/test/test_fcntl.py Lib/test/test_format.py Lib/test/test_frozen.py Lib/test/test_funcattrs.py Lib/test/test_functools.py Lib/test/test_future.py Lib/test/test_gc.py Lib/test/test_gdbm.py Lib/test/test_genericpath.py Lib/test/test_getopt.py Lib/test/test_global.py Lib/test/test_grammar.py Lib/test/test_gzip.py Lib/test/test_heapq.py Lib/test/test_httplib.py Lib/test/test_imp.py Lib/test/test_import.py Lib/test/test_importhooks.py Lib/test/test_inspect.py Lib/test/test_iter.py Lib/test/test_itertools.py Lib/test/test_keywordonlyarg.py Lib/test/test_long.py Lib/test/test_mailbox.py Lib/test/test_marshal.py Lib/test/test_math.py Lib/test/test_mmap.py Lib/test/test_modulefinder.py Lib/test/test_multibytecodec.py Lib/test/test_mutants.py Lib/test/test_new.py Lib/test/test_nis.py Lib/test/test_opcodes.py Lib/test/test_openpty.py Lib/test/test_operations.py Lib/test/test_operator.py Lib/test/test_os.py Lib/test/test_parser.py Lib/test/test_peepholer.py Lib/test/test_pep352.py Lib/test/test_poll.py Lib/test/test_pyclbr.py Lib/test/test_rfc822.py Lib/test/test_richcmp.py Lib/test/test_scope.py Lib/test/test_set.py Lib/test/test_sets.py Lib/test/test_sgmllib.py Lib/test/test_sha.py Lib/test/test_site.py Lib/test/test_slice.py Lib/test/test_socket.py Lib/test/test_sort.py Lib/test/test_structmembers.py Lib/test/test_subprocess.py Lib/test/test_support.py Lib/test/test_syntax.py Lib/test/test_tarfile.py Lib/test/test_tempfile.py Lib/test/test_time.py Lib/test/test_tokenize.py Lib/test/test_traceback.py Lib/test/test_transformer.py Lib/test/test_tuple.py Lib/test/test_types.py Lib/test/test_unicode.py Lib/test/test_unicode_file.py Lib/test/test_unpack.py Lib/test/test_urllib.py Lib/test/test_urllibnet.py Lib/test/test_userdict.py Lib/test/test_weakref.py Lib/test/test_wsgiref.py Lib/test/test_xdrlib.py Lib/test/test_xmlrpc.py Lib/test/time_hashlib.py Lib/test/tokenize_tests.txt Lib/timeit.py Lib/token.py Lib/tokenize.py Lib/trace.py Lib/traceback.py Lib/urllib.py Lib/urllib2.py Lib/uu.py Lib/uuid.py Lib/webbrowser.py Lib/wsgiref/headers.py Lib/wsgiref/simple_server.py Lib/wsgiref/util.py Lib/xdrlib.py Lib/xml/dom/minidom.py Lib/xmlrpclib.py Mac/BuildScript/build-installer.py Mac/BuildScript/scripts/postflight.documentation Mac/BuildScript/scripts/postflight.patch-profile Mac/Makefile.in Mac/PythonLauncher/FileSettings.m Mac/README Mac/Tools/fixapplepython23.py Makefile.pre.in Misc/ACKS Misc/HISTORY Misc/NEWS Misc/SpecialBuilds.txt Misc/Vim/python.vim Misc/Vim/vim_syntax.py Misc/Vim/vimrc Misc/cheatsheet Misc/python-mode.el Misc/vgrindefs Modules/_bsddb.c Modules/_ctypes/_ctypes.c Modules/_ctypes/_ctypes_test.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c Modules/_ctypes/libffi/src/x86/sysv.S Modules/_ctypes/libffi_msvc/ffi.c Modules/_ctypes/libffi_msvc/ffi.h Modules/_ctypes/libffi_msvc/ffitarget.h Modules/_ctypes/libffi_msvc/win64.asm Modules/_ctypes/stgdict.c Modules/_cursesmodule.c Modules/_functoolsmodule.c Modules/_sre.c Modules/_ssl.c Modules/_testcapimodule.c Modules/almodule.c Modules/arraymodule.c Modules/audioop.c Modules/binascii.c Modules/bz2module.c Modules/cPickle.c Modules/cStringIO.c Modules/cgen.py Modules/cjkcodecs/_codecs_cn.c Modules/cjkcodecs/_codecs_iso2022.c Modules/cjkcodecs/cjkcodecs.h Modules/datetimemodule.c Modules/dbmmodule.c Modules/gcmodule.c Modules/itertoolsmodule.c Modules/linuxaudiodev.c Modules/main.c Modules/mathmodule.c Modules/mmapmodule.c Modules/ossaudiodev.c Modules/parsermodule.c Modules/posixmodule.c Modules/pyexpat.c Modules/readline.c Modules/resource.c Modules/socketmodule.c Modules/socketmodule.h Modules/symtablemodule.c Modules/threadmodule.c Modules/unicodedata.c Objects/abstract.c Objects/boolobject.c Objects/bufferobject.c Objects/bytesobject.c Objects/cellobject.c Objects/classobject.c Objects/codeobject.c Objects/complexobject.c Objects/dictobject.c Objects/exceptions.c Objects/fileobject.c Objects/floatobject.c Objects/funcobject.c Objects/intobject.c Objects/iterobject.c Objects/listobject.c Objects/longobject.c Objects/methodobject.c Objects/object.c Objects/obmalloc.c Objects/setobject.c Objects/sliceobject.c Objects/stringlib/partition.h Objects/stringobject.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c PC/VC6/_bsddb.dsp PC/VC6/_ctypes.dsp PC/VC6/_ctypes_test.dsp PC/VC6/_elementtree.dsp PC/VC6/_socket.dsp PC/VC6/_sqlite3.dsp PC/VC6/_ssl.dsp PC/VC6/_ssl.mak PC/VC6/_testcapi.dsp PC/VC6/_tkinter.dsp PC/VC6/bz2.dsp PC/VC6/make_versioninfo.dsp PC/VC6/pcbuild.dsw PC/VC6/pyexpat.dsp PC/VC6/python.dsp PC/VC6/pythoncore.dsp PC/VC6/pythonw.dsp PC/VC6/readme.txt PC/VC6/select.dsp PC/VC6/unicodedata.dsp PC/VC6/w9xpopen.dsp PC/VC6/winsound.dsp PC/VC6/zlib.dsp PC/_msi.c PC/_winreg.c PC/bdist_wininst/wininst-8.sln PC/bdist_wininst/wininst-8.vcproj PC/example_nt/example.vcproj PC/pyconfig.h PCbuild/_ctypes.vcproj PCbuild/amd64_ml64.bat PCbuild/pythoncore.vcproj PCbuild8/_ctypes.vcproj PCbuild8/_ctypes_test.vcproj PCbuild8/_elementtree.vcproj PCbuild8/_msi.vcproj PCbuild8/_sqlite3.vcproj PCbuild8/make_buildinfo.c PCbuild8/make_buildinfo.vcproj PCbuild8/pcbuild.sln PCbuild8/python.vcproj PCbuild8/pythoncore.vcproj PCbuild8/pythoncore_pgo.vcproj PCbuild8/pythoncore_pgo_link.txt PCbuild8/pythonw.vcproj PCbuild8/readme.txt PCbuild8/select.vcproj PCbuild8/unicodedata.vcproj PCbuild8/w9xpopen.vcproj PCbuild8/winsound.vcproj Parser/Python.asdl Parser/asdl.py Parser/asdl_c.py Parser/parser.c Parser/parsetok.c Parser/tokenizer.c Python/Python-ast.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/errors.c Python/frozen.c Python/getargs.c Python/graminit.c Python/import.c Python/marshal.c Python/modsupport.c Python/mystrtoul.c Python/peephole.c Python/pystate.c Python/pythonrun.c Python/structmember.c Python/symtable.c Python/sysmodule.c README Tools/compiler/ast.txt Tools/compiler/astgen.py Tools/modulator/modulator.py Tools/msi/msi.py Tools/msi/uuids.py Tools/pybench/pybench.py Tools/scripts/byext.py Tools/scripts/findnocoding.py Tools/scripts/fixdiv.py Tools/scripts/h2py.py Tools/scripts/pysource.py configure configure.in pyconfig.h.in setup.py

thomas.wouters python-checkins at python.org
Fri Dec 15 05:28:21 CET 2006


Author: thomas.wouters
Date: Fri Dec 15 05:21:50 2006
New Revision: 53040

Added:
   python/branches/p3yk-noslice/Doc/howto/functional.rst
      - copied unchanged from r53019, python/branches/p3yk/Doc/howto/functional.rst
   python/branches/p3yk-noslice/Doc/whatsnew/whatsnew26.tex
      - copied unchanged from r53019, python/branches/p3yk/Doc/whatsnew/whatsnew26.tex
   python/branches/p3yk-noslice/Lib/distutils/command/wininst-8.exe
      - copied unchanged from r53019, python/branches/p3yk/Lib/distutils/command/wininst-8.exe
   python/branches/p3yk-noslice/Lib/genericpath.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/genericpath.py
   python/branches/p3yk-noslice/Lib/test/crashers/bogus_sre_bytecode.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/crashers/bogus_sre_bytecode.py
   python/branches/p3yk-noslice/Lib/test/crashers/infinite_loop_re.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/crashers/infinite_loop_re.py
   python/branches/p3yk-noslice/Lib/test/crashers/loosing_mro_ref.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/crashers/loosing_mro_ref.py
   python/branches/p3yk-noslice/Lib/test/sgml_input.html
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/sgml_input.html
   python/branches/p3yk-noslice/Lib/test/test_buffer.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/test_buffer.py
   python/branches/p3yk-noslice/Lib/test/test_complex_args.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/test_complex_args.py
   python/branches/p3yk-noslice/Lib/test/test_genericpath.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/test_genericpath.py
   python/branches/p3yk-noslice/Lib/test/test_keywordonlyarg.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/test_keywordonlyarg.py
   python/branches/p3yk-noslice/Lib/test/test_modulefinder.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/test_modulefinder.py
   python/branches/p3yk-noslice/Lib/test/test_structmembers.py
      - copied unchanged from r53019, python/branches/p3yk/Lib/test/test_structmembers.py
   python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/win64.asm
      - copied unchanged from r53019, python/branches/p3yk/Modules/_ctypes/libffi_msvc/win64.asm
   python/branches/p3yk-noslice/PC/VC6/_ctypes.dsp
      - copied unchanged from r53019, python/branches/p3yk/PC/VC6/_ctypes.dsp
   python/branches/p3yk-noslice/PC/VC6/_ctypes_test.dsp
      - copied unchanged from r53019, python/branches/p3yk/PC/VC6/_ctypes_test.dsp
   python/branches/p3yk-noslice/PC/VC6/_elementtree.dsp
      - copied unchanged from r53019, python/branches/p3yk/PC/VC6/_elementtree.dsp
   python/branches/p3yk-noslice/PC/VC6/_sqlite3.dsp
      - copied unchanged from r53019, python/branches/p3yk/PC/VC6/_sqlite3.dsp
   python/branches/p3yk-noslice/PC/bdist_wininst/wininst-8.sln
      - copied unchanged from r53019, python/branches/p3yk/PC/bdist_wininst/wininst-8.sln
   python/branches/p3yk-noslice/PC/bdist_wininst/wininst-8.vcproj
      - copied unchanged from r53019, python/branches/p3yk/PC/bdist_wininst/wininst-8.vcproj
   python/branches/p3yk-noslice/PCbuild/amd64_ml64.bat
      - copied unchanged from r53019, python/branches/p3yk/PCbuild/amd64_ml64.bat
Removed:
   python/branches/p3yk-noslice/BROKEN
   python/branches/p3yk-noslice/Lib/test/output/test_MimeWriter
   python/branches/p3yk-noslice/Lib/test/output/test_cgi
   python/branches/p3yk-noslice/Lib/test/output/test_cookie
   python/branches/p3yk-noslice/Lib/test/output/test_global
   python/branches/p3yk-noslice/Lib/test/output/test_grammar
   python/branches/p3yk-noslice/Lib/test/output/test_httplib
   python/branches/p3yk-noslice/Lib/test/output/test_math
   python/branches/p3yk-noslice/Lib/test/output/test_mmap
   python/branches/p3yk-noslice/Lib/test/output/test_nis
   python/branches/p3yk-noslice/Lib/test/output/test_opcodes
   python/branches/p3yk-noslice/Lib/test/output/test_openpty
   python/branches/p3yk-noslice/Lib/test/output/test_poll
   python/branches/p3yk-noslice/Lib/test/output/test_regex
   python/branches/p3yk-noslice/Lib/test/output/test_scope
   python/branches/p3yk-noslice/Lib/test/output/test_types
   python/branches/p3yk-noslice/Lib/test/output/test_xdrlib
   python/branches/p3yk-noslice/PC/VC6/zlib.dsp
   python/branches/p3yk-noslice/PCbuild8/pythoncore_pgo.vcproj
   python/branches/p3yk-noslice/PCbuild8/pythoncore_pgo_link.txt
Modified:
   python/branches/p3yk-noslice/   (props changed)
   python/branches/p3yk-noslice/Demo/classes/Complex.py
   python/branches/p3yk-noslice/Demo/classes/Rat.py
   python/branches/p3yk-noslice/Demo/parser/unparse.py
   python/branches/p3yk-noslice/Demo/pysvr/pysvr.py
   python/branches/p3yk-noslice/Demo/rpc/nfsclient.py
   python/branches/p3yk-noslice/Demo/rpc/xdr.py
   python/branches/p3yk-noslice/Demo/scripts/lpwatch.py
   python/branches/p3yk-noslice/Demo/scripts/primes.py
   python/branches/p3yk-noslice/Demo/scripts/update.py
   python/branches/p3yk-noslice/Demo/sockets/gopher.py
   python/branches/p3yk-noslice/Demo/sockets/rpythond.py
   python/branches/p3yk-noslice/Demo/tkinter/guido/ShellWindow.py
   python/branches/p3yk-noslice/Doc/Makefile
   python/branches/p3yk-noslice/Doc/api/concrete.tex
   python/branches/p3yk-noslice/Doc/api/exceptions.tex
   python/branches/p3yk-noslice/Doc/api/refcounts.dat
   python/branches/p3yk-noslice/Doc/dist/dist.tex
   python/branches/p3yk-noslice/Doc/ext/extending.tex
   python/branches/p3yk-noslice/Doc/howto/doanddont.tex
   python/branches/p3yk-noslice/Doc/howto/regex.tex
   python/branches/p3yk-noslice/Doc/inst/inst.tex
   python/branches/p3yk-noslice/Doc/lib/asttable.tex
   python/branches/p3yk-noslice/Doc/lib/email-unpack.py
   python/branches/p3yk-noslice/Doc/lib/libasyncore.tex
   python/branches/p3yk-noslice/Doc/lib/libatexit.tex
   python/branches/p3yk-noslice/Doc/lib/libbase64.tex
   python/branches/p3yk-noslice/Doc/lib/libbsddb.tex
   python/branches/p3yk-noslice/Doc/lib/libcfgparser.tex
   python/branches/p3yk-noslice/Doc/lib/libcommands.tex
   python/branches/p3yk-noslice/Doc/lib/libconsts.tex
   python/branches/p3yk-noslice/Doc/lib/libcsv.tex
   python/branches/p3yk-noslice/Doc/lib/libctypes.tex
   python/branches/p3yk-noslice/Doc/lib/libdatetime.tex
   python/branches/p3yk-noslice/Doc/lib/libdecimal.tex
   python/branches/p3yk-noslice/Doc/lib/libdis.tex
   python/branches/p3yk-noslice/Doc/lib/libetree.tex
   python/branches/p3yk-noslice/Doc/lib/libexcs.tex
   python/branches/p3yk-noslice/Doc/lib/libfpectl.tex
   python/branches/p3yk-noslice/Doc/lib/libfuncs.tex
   python/branches/p3yk-noslice/Doc/lib/libfunctools.tex
   python/branches/p3yk-noslice/Doc/lib/libgetopt.tex
   python/branches/p3yk-noslice/Doc/lib/libhashlib.tex
   python/branches/p3yk-noslice/Doc/lib/libheapq.tex
   python/branches/p3yk-noslice/Doc/lib/libhotshot.tex
   python/branches/p3yk-noslice/Doc/lib/libhttplib.tex
   python/branches/p3yk-noslice/Doc/lib/libimp.tex
   python/branches/p3yk-noslice/Doc/lib/libitertools.tex
   python/branches/p3yk-noslice/Doc/lib/liblogging.tex
   python/branches/p3yk-noslice/Doc/lib/libmsilib.tex
   python/branches/p3yk-noslice/Doc/lib/liboperator.tex
   python/branches/p3yk-noslice/Doc/lib/libos.tex
   python/branches/p3yk-noslice/Doc/lib/libparser.tex
   python/branches/p3yk-noslice/Doc/lib/libpdb.tex
   python/branches/p3yk-noslice/Doc/lib/libpickle.tex
   python/branches/p3yk-noslice/Doc/lib/libpopen2.tex
   python/branches/p3yk-noslice/Doc/lib/libprofile.tex
   python/branches/p3yk-noslice/Doc/lib/libpyexpat.tex
   python/branches/p3yk-noslice/Doc/lib/librexec.tex
   python/branches/p3yk-noslice/Doc/lib/libsmtplib.tex
   python/branches/p3yk-noslice/Doc/lib/libsocket.tex
   python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex
   python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex
   python/branches/p3yk-noslice/Doc/lib/libstdwin.tex
   python/branches/p3yk-noslice/Doc/lib/libstring.tex
   python/branches/p3yk-noslice/Doc/lib/libsubprocess.tex
   python/branches/p3yk-noslice/Doc/lib/libtempfile.tex
   python/branches/p3yk-noslice/Doc/lib/libtimeit.tex
   python/branches/p3yk-noslice/Doc/lib/libtraceback.tex
   python/branches/p3yk-noslice/Doc/lib/libunittest.tex
   python/branches/p3yk-noslice/Doc/lib/liburlparse.tex
   python/branches/p3yk-noslice/Doc/lib/libuuid.tex
   python/branches/p3yk-noslice/Doc/lib/libwinreg.tex
   python/branches/p3yk-noslice/Doc/lib/libwsgiref.tex
   python/branches/p3yk-noslice/Doc/lib/libxmlrpclib.tex
   python/branches/p3yk-noslice/Doc/lib/sqlite3/executescript.py
   python/branches/p3yk-noslice/Doc/lib/tkinter.tex
   python/branches/p3yk-noslice/Doc/perl/python.perl
   python/branches/p3yk-noslice/Doc/ref/ref2.tex
   python/branches/p3yk-noslice/Doc/ref/ref3.tex
   python/branches/p3yk-noslice/Doc/ref/ref4.tex
   python/branches/p3yk-noslice/Doc/ref/ref5.tex
   python/branches/p3yk-noslice/Doc/ref/ref6.tex
   python/branches/p3yk-noslice/Doc/ref/ref8.tex
   python/branches/p3yk-noslice/Doc/ref/reswords.py
   python/branches/p3yk-noslice/Doc/tools/py2texi.el
   python/branches/p3yk-noslice/Doc/tut/tut.tex
   python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex
   python/branches/p3yk-noslice/Grammar/Grammar
   python/branches/p3yk-noslice/Include/Python-ast.h
   python/branches/p3yk-noslice/Include/abstract.h
   python/branches/p3yk-noslice/Include/code.h
   python/branches/p3yk-noslice/Include/eval.h
   python/branches/p3yk-noslice/Include/funcobject.h
   python/branches/p3yk-noslice/Include/graminit.h
   python/branches/p3yk-noslice/Include/iterobject.h
   python/branches/p3yk-noslice/Include/modsupport.h
   python/branches/p3yk-noslice/Include/object.h
   python/branches/p3yk-noslice/Include/opcode.h
   python/branches/p3yk-noslice/Include/pyport.h
   python/branches/p3yk-noslice/Include/symtable.h
   python/branches/p3yk-noslice/Include/token.h
   python/branches/p3yk-noslice/Lib/Bastion.py
   python/branches/p3yk-noslice/Lib/ConfigParser.py
   python/branches/p3yk-noslice/Lib/Queue.py
   python/branches/p3yk-noslice/Lib/SimpleXMLRPCServer.py
   python/branches/p3yk-noslice/Lib/StringIO.py
   python/branches/p3yk-noslice/Lib/UserDict.py
   python/branches/p3yk-noslice/Lib/UserString.py
   python/branches/p3yk-noslice/Lib/_strptime.py
   python/branches/p3yk-noslice/Lib/atexit.py
   python/branches/p3yk-noslice/Lib/base64.py
   python/branches/p3yk-noslice/Lib/bdb.py
   python/branches/p3yk-noslice/Lib/bsddb/__init__.py
   python/branches/p3yk-noslice/Lib/bsddb/dbtables.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_compat.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py
   python/branches/p3yk-noslice/Lib/cProfile.py
   python/branches/p3yk-noslice/Lib/cgi.py
   python/branches/p3yk-noslice/Lib/code.py
   python/branches/p3yk-noslice/Lib/codecs.py
   python/branches/p3yk-noslice/Lib/colorsys.py
   python/branches/p3yk-noslice/Lib/compiler/ast.py
   python/branches/p3yk-noslice/Lib/compiler/pyassem.py
   python/branches/p3yk-noslice/Lib/compiler/pycodegen.py
   python/branches/p3yk-noslice/Lib/compiler/transformer.py
   python/branches/p3yk-noslice/Lib/ctypes/__init__.py
   python/branches/p3yk-noslice/Lib/ctypes/test/__init__.py
   python/branches/p3yk-noslice/Lib/ctypes/test/test_bitfields.py
   python/branches/p3yk-noslice/Lib/ctypes/test/test_callbacks.py
   python/branches/p3yk-noslice/Lib/ctypes/test/test_cast.py
   python/branches/p3yk-noslice/Lib/ctypes/test/test_simplesubclasses.py
   python/branches/p3yk-noslice/Lib/ctypes/test/test_structures.py
   python/branches/p3yk-noslice/Lib/ctypes/test/test_win32.py
   python/branches/p3yk-noslice/Lib/decimal.py
   python/branches/p3yk-noslice/Lib/distutils/command/bdist_rpm.py
   python/branches/p3yk-noslice/Lib/distutils/command/build_ext.py
   python/branches/p3yk-noslice/Lib/distutils/command/install_egg_info.py
   python/branches/p3yk-noslice/Lib/distutils/command/register.py
   python/branches/p3yk-noslice/Lib/distutils/sysconfig.py
   python/branches/p3yk-noslice/Lib/distutils/unixccompiler.py
   python/branches/p3yk-noslice/Lib/distutils/version.py
   python/branches/p3yk-noslice/Lib/doctest.py
   python/branches/p3yk-noslice/Lib/email/base64mime.py
   python/branches/p3yk-noslice/Lib/email/charset.py
   python/branches/p3yk-noslice/Lib/email/generator.py
   python/branches/p3yk-noslice/Lib/email/header.py
   python/branches/p3yk-noslice/Lib/email/message.py
   python/branches/p3yk-noslice/Lib/email/quoprimime.py
   python/branches/p3yk-noslice/Lib/email/test/test_email.py
   python/branches/p3yk-noslice/Lib/email/test/test_email_renamed.py
   python/branches/p3yk-noslice/Lib/email/utils.py
   python/branches/p3yk-noslice/Lib/encodings/__init__.py
   python/branches/p3yk-noslice/Lib/encodings/bz2_codec.py
   python/branches/p3yk-noslice/Lib/encodings/utf_8_sig.py
   python/branches/p3yk-noslice/Lib/encodings/zlib_codec.py
   python/branches/p3yk-noslice/Lib/ftplib.py
   python/branches/p3yk-noslice/Lib/functools.py
   python/branches/p3yk-noslice/Lib/gzip.py
   python/branches/p3yk-noslice/Lib/hashlib.py
   python/branches/p3yk-noslice/Lib/httplib.py
   python/branches/p3yk-noslice/Lib/idlelib/CodeContext.py
   python/branches/p3yk-noslice/Lib/idlelib/ColorDelegator.py
   python/branches/p3yk-noslice/Lib/idlelib/EditorWindow.py
   python/branches/p3yk-noslice/Lib/idlelib/HyperParser.py
   python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt
   python/branches/p3yk-noslice/Lib/idlelib/PyShell.py
   python/branches/p3yk-noslice/Lib/idlelib/ScriptBinding.py
   python/branches/p3yk-noslice/Lib/idlelib/run.py
   python/branches/p3yk-noslice/Lib/ihooks.py
   python/branches/p3yk-noslice/Lib/imputil.py
   python/branches/p3yk-noslice/Lib/inspect.py
   python/branches/p3yk-noslice/Lib/keyword.py
   python/branches/p3yk-noslice/Lib/lib-tk/Tix.py
   python/branches/p3yk-noslice/Lib/lib-tk/Tkinter.py
   python/branches/p3yk-noslice/Lib/lib-tk/tkMessageBox.py
   python/branches/p3yk-noslice/Lib/lib-tk/tkSimpleDialog.py
   python/branches/p3yk-noslice/Lib/lib-tk/turtle.py
   python/branches/p3yk-noslice/Lib/logging/__init__.py
   python/branches/p3yk-noslice/Lib/logging/config.py
   python/branches/p3yk-noslice/Lib/logging/handlers.py
   python/branches/p3yk-noslice/Lib/macpath.py
   python/branches/p3yk-noslice/Lib/mailbox.py
   python/branches/p3yk-noslice/Lib/modulefinder.py
   python/branches/p3yk-noslice/Lib/ntpath.py
   python/branches/p3yk-noslice/Lib/opcode.py
   python/branches/p3yk-noslice/Lib/optparse.py
   python/branches/p3yk-noslice/Lib/os.py
   python/branches/p3yk-noslice/Lib/os2emxpath.py
   python/branches/p3yk-noslice/Lib/pdb.py
   python/branches/p3yk-noslice/Lib/plat-irix5/flp.py
   python/branches/p3yk-noslice/Lib/plat-irix5/panel.py
   python/branches/p3yk-noslice/Lib/plat-irix6/flp.py
   python/branches/p3yk-noslice/Lib/plat-irix6/panel.py
   python/branches/p3yk-noslice/Lib/plat-mac/FrameWork.py
   python/branches/p3yk-noslice/Lib/plat-mac/aetypes.py
   python/branches/p3yk-noslice/Lib/plat-mac/appletrawmain.py
   python/branches/p3yk-noslice/Lib/plat-mac/buildtools.py
   python/branches/p3yk-noslice/Lib/plat-mac/cfmfile.py
   python/branches/p3yk-noslice/Lib/plat-mac/gensuitemodule.py
   python/branches/p3yk-noslice/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py
   python/branches/p3yk-noslice/Lib/plat-mac/macerrors.py
   python/branches/p3yk-noslice/Lib/plat-mac/pimp.py
   python/branches/p3yk-noslice/Lib/plat-mac/plistlib.py
   python/branches/p3yk-noslice/Lib/plat-riscos/riscosenviron.py
   python/branches/p3yk-noslice/Lib/plat-riscos/rourl2path.py
   python/branches/p3yk-noslice/Lib/plat-sunos5/STROPTS.py
   python/branches/p3yk-noslice/Lib/posixpath.py
   python/branches/p3yk-noslice/Lib/pprint.py
   python/branches/p3yk-noslice/Lib/profile.py
   python/branches/p3yk-noslice/Lib/pstats.py
   python/branches/p3yk-noslice/Lib/pty.py
   python/branches/p3yk-noslice/Lib/pyclbr.py
   python/branches/p3yk-noslice/Lib/pydoc.py
   python/branches/p3yk-noslice/Lib/rexec.py
   python/branches/p3yk-noslice/Lib/runpy.py
   python/branches/p3yk-noslice/Lib/sgmllib.py
   python/branches/p3yk-noslice/Lib/site.py
   python/branches/p3yk-noslice/Lib/smtplib.py
   python/branches/p3yk-noslice/Lib/socket.py
   python/branches/p3yk-noslice/Lib/sqlite3/test/types.py
   python/branches/p3yk-noslice/Lib/subprocess.py
   python/branches/p3yk-noslice/Lib/symbol.py
   python/branches/p3yk-noslice/Lib/symtable.py
   python/branches/p3yk-noslice/Lib/tarfile.py
   python/branches/p3yk-noslice/Lib/test/README
   python/branches/p3yk-noslice/Lib/test/crashers/bogus_code_obj.py
   python/branches/p3yk-noslice/Lib/test/list_tests.py
   python/branches/p3yk-noslice/Lib/test/mapping_tests.py
   python/branches/p3yk-noslice/Lib/test/output/test_cProfile
   python/branches/p3yk-noslice/Lib/test/output/test_class
   python/branches/p3yk-noslice/Lib/test/output/test_extcall
   python/branches/p3yk-noslice/Lib/test/output/test_profile
   python/branches/p3yk-noslice/Lib/test/output/test_tokenize
   python/branches/p3yk-noslice/Lib/test/outstanding_bugs.py
   python/branches/p3yk-noslice/Lib/test/pickletester.py
   python/branches/p3yk-noslice/Lib/test/string_tests.py
   python/branches/p3yk-noslice/Lib/test/test_MimeWriter.py
   python/branches/p3yk-noslice/Lib/test/test_StringIO.py
   python/branches/p3yk-noslice/Lib/test/test___all__.py
   python/branches/p3yk-noslice/Lib/test/test___future__.py
   python/branches/p3yk-noslice/Lib/test/test_array.py
   python/branches/p3yk-noslice/Lib/test/test_ast.py
   python/branches/p3yk-noslice/Lib/test/test_binascii.py
   python/branches/p3yk-noslice/Lib/test/test_binop.py
   python/branches/p3yk-noslice/Lib/test/test_bisect.py
   python/branches/p3yk-noslice/Lib/test/test_bool.py
   python/branches/p3yk-noslice/Lib/test/test_bsddb3.py
   python/branches/p3yk-noslice/Lib/test/test_bufio.py
   python/branches/p3yk-noslice/Lib/test/test_builtin.py
   python/branches/p3yk-noslice/Lib/test/test_bytes.py
   python/branches/p3yk-noslice/Lib/test/test_bz2.py
   python/branches/p3yk-noslice/Lib/test/test_calendar.py
   python/branches/p3yk-noslice/Lib/test/test_cfgparser.py
   python/branches/p3yk-noslice/Lib/test/test_cgi.py
   python/branches/p3yk-noslice/Lib/test/test_class.py
   python/branches/p3yk-noslice/Lib/test/test_code.py
   python/branches/p3yk-noslice/Lib/test/test_codecencodings_cn.py
   python/branches/p3yk-noslice/Lib/test/test_codecs.py
   python/branches/p3yk-noslice/Lib/test/test_codeop.py
   python/branches/p3yk-noslice/Lib/test/test_compare.py
   python/branches/p3yk-noslice/Lib/test/test_compile.py
   python/branches/p3yk-noslice/Lib/test/test_compiler.py
   python/branches/p3yk-noslice/Lib/test/test_contextlib.py
   python/branches/p3yk-noslice/Lib/test/test_cookie.py
   python/branches/p3yk-noslice/Lib/test/test_copy.py
   python/branches/p3yk-noslice/Lib/test/test_datetime.py
   python/branches/p3yk-noslice/Lib/test/test_dbm.py
   python/branches/p3yk-noslice/Lib/test/test_decimal.py
   python/branches/p3yk-noslice/Lib/test/test_descr.py
   python/branches/p3yk-noslice/Lib/test/test_descrtut.py
   python/branches/p3yk-noslice/Lib/test/test_dict.py
   python/branches/p3yk-noslice/Lib/test/test_dis.py
   python/branches/p3yk-noslice/Lib/test/test_doctest.py
   python/branches/p3yk-noslice/Lib/test/test_enumerate.py
   python/branches/p3yk-noslice/Lib/test/test_exceptions.py
   python/branches/p3yk-noslice/Lib/test/test_fcntl.py
   python/branches/p3yk-noslice/Lib/test/test_format.py
   python/branches/p3yk-noslice/Lib/test/test_frozen.py
   python/branches/p3yk-noslice/Lib/test/test_funcattrs.py
   python/branches/p3yk-noslice/Lib/test/test_functools.py
   python/branches/p3yk-noslice/Lib/test/test_future.py
   python/branches/p3yk-noslice/Lib/test/test_gc.py
   python/branches/p3yk-noslice/Lib/test/test_gdbm.py
   python/branches/p3yk-noslice/Lib/test/test_getopt.py
   python/branches/p3yk-noslice/Lib/test/test_global.py
   python/branches/p3yk-noslice/Lib/test/test_grammar.py
   python/branches/p3yk-noslice/Lib/test/test_gzip.py
   python/branches/p3yk-noslice/Lib/test/test_heapq.py
   python/branches/p3yk-noslice/Lib/test/test_httplib.py
   python/branches/p3yk-noslice/Lib/test/test_imp.py
   python/branches/p3yk-noslice/Lib/test/test_import.py
   python/branches/p3yk-noslice/Lib/test/test_importhooks.py
   python/branches/p3yk-noslice/Lib/test/test_inspect.py
   python/branches/p3yk-noslice/Lib/test/test_iter.py
   python/branches/p3yk-noslice/Lib/test/test_itertools.py
   python/branches/p3yk-noslice/Lib/test/test_long.py
   python/branches/p3yk-noslice/Lib/test/test_mailbox.py
   python/branches/p3yk-noslice/Lib/test/test_marshal.py
   python/branches/p3yk-noslice/Lib/test/test_math.py
   python/branches/p3yk-noslice/Lib/test/test_mmap.py
   python/branches/p3yk-noslice/Lib/test/test_multibytecodec.py
   python/branches/p3yk-noslice/Lib/test/test_mutants.py
   python/branches/p3yk-noslice/Lib/test/test_new.py
   python/branches/p3yk-noslice/Lib/test/test_nis.py
   python/branches/p3yk-noslice/Lib/test/test_opcodes.py
   python/branches/p3yk-noslice/Lib/test/test_openpty.py
   python/branches/p3yk-noslice/Lib/test/test_operations.py
   python/branches/p3yk-noslice/Lib/test/test_operator.py
   python/branches/p3yk-noslice/Lib/test/test_os.py
   python/branches/p3yk-noslice/Lib/test/test_parser.py
   python/branches/p3yk-noslice/Lib/test/test_peepholer.py
   python/branches/p3yk-noslice/Lib/test/test_pep352.py
   python/branches/p3yk-noslice/Lib/test/test_poll.py
   python/branches/p3yk-noslice/Lib/test/test_pyclbr.py
   python/branches/p3yk-noslice/Lib/test/test_rfc822.py
   python/branches/p3yk-noslice/Lib/test/test_richcmp.py
   python/branches/p3yk-noslice/Lib/test/test_scope.py
   python/branches/p3yk-noslice/Lib/test/test_set.py
   python/branches/p3yk-noslice/Lib/test/test_sets.py
   python/branches/p3yk-noslice/Lib/test/test_sgmllib.py
   python/branches/p3yk-noslice/Lib/test/test_sha.py
   python/branches/p3yk-noslice/Lib/test/test_site.py
   python/branches/p3yk-noslice/Lib/test/test_slice.py
   python/branches/p3yk-noslice/Lib/test/test_socket.py
   python/branches/p3yk-noslice/Lib/test/test_sort.py
   python/branches/p3yk-noslice/Lib/test/test_subprocess.py
   python/branches/p3yk-noslice/Lib/test/test_support.py
   python/branches/p3yk-noslice/Lib/test/test_syntax.py
   python/branches/p3yk-noslice/Lib/test/test_tarfile.py
   python/branches/p3yk-noslice/Lib/test/test_tempfile.py
   python/branches/p3yk-noslice/Lib/test/test_time.py
   python/branches/p3yk-noslice/Lib/test/test_tokenize.py
   python/branches/p3yk-noslice/Lib/test/test_traceback.py
   python/branches/p3yk-noslice/Lib/test/test_transformer.py
   python/branches/p3yk-noslice/Lib/test/test_tuple.py
   python/branches/p3yk-noslice/Lib/test/test_types.py
   python/branches/p3yk-noslice/Lib/test/test_unicode.py
   python/branches/p3yk-noslice/Lib/test/test_unicode_file.py
   python/branches/p3yk-noslice/Lib/test/test_unpack.py
   python/branches/p3yk-noslice/Lib/test/test_urllib.py
   python/branches/p3yk-noslice/Lib/test/test_urllibnet.py
   python/branches/p3yk-noslice/Lib/test/test_userdict.py
   python/branches/p3yk-noslice/Lib/test/test_weakref.py
   python/branches/p3yk-noslice/Lib/test/test_wsgiref.py
   python/branches/p3yk-noslice/Lib/test/test_xdrlib.py
   python/branches/p3yk-noslice/Lib/test/test_xmlrpc.py
   python/branches/p3yk-noslice/Lib/test/time_hashlib.py
   python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt
   python/branches/p3yk-noslice/Lib/timeit.py
   python/branches/p3yk-noslice/Lib/token.py
   python/branches/p3yk-noslice/Lib/tokenize.py
   python/branches/p3yk-noslice/Lib/trace.py
   python/branches/p3yk-noslice/Lib/traceback.py
   python/branches/p3yk-noslice/Lib/urllib.py
   python/branches/p3yk-noslice/Lib/urllib2.py
   python/branches/p3yk-noslice/Lib/uu.py
   python/branches/p3yk-noslice/Lib/uuid.py
   python/branches/p3yk-noslice/Lib/webbrowser.py
   python/branches/p3yk-noslice/Lib/wsgiref/headers.py
   python/branches/p3yk-noslice/Lib/wsgiref/simple_server.py
   python/branches/p3yk-noslice/Lib/wsgiref/util.py
   python/branches/p3yk-noslice/Lib/xdrlib.py
   python/branches/p3yk-noslice/Lib/xml/dom/minidom.py
   python/branches/p3yk-noslice/Lib/xmlrpclib.py
   python/branches/p3yk-noslice/Mac/BuildScript/build-installer.py
   python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.documentation
   python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.patch-profile
   python/branches/p3yk-noslice/Mac/Makefile.in
   python/branches/p3yk-noslice/Mac/PythonLauncher/FileSettings.m
   python/branches/p3yk-noslice/Mac/README
   python/branches/p3yk-noslice/Mac/Tools/fixapplepython23.py
   python/branches/p3yk-noslice/Makefile.pre.in
   python/branches/p3yk-noslice/Misc/ACKS
   python/branches/p3yk-noslice/Misc/HISTORY
   python/branches/p3yk-noslice/Misc/NEWS
   python/branches/p3yk-noslice/Misc/SpecialBuilds.txt
   python/branches/p3yk-noslice/Misc/Vim/python.vim
   python/branches/p3yk-noslice/Misc/Vim/vim_syntax.py
   python/branches/p3yk-noslice/Misc/Vim/vimrc
   python/branches/p3yk-noslice/Misc/cheatsheet
   python/branches/p3yk-noslice/Misc/python-mode.el
   python/branches/p3yk-noslice/Misc/vgrindefs
   python/branches/p3yk-noslice/Modules/_bsddb.c
   python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c
   python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c
   python/branches/p3yk-noslice/Modules/_ctypes/callbacks.c
   python/branches/p3yk-noslice/Modules/_ctypes/callproc.c
   python/branches/p3yk-noslice/Modules/_ctypes/cfield.c
   python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
   python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/x86/sysv.S
   python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.c
   python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.h
   python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffitarget.h
   python/branches/p3yk-noslice/Modules/_ctypes/stgdict.c
   python/branches/p3yk-noslice/Modules/_cursesmodule.c
   python/branches/p3yk-noslice/Modules/_functoolsmodule.c
   python/branches/p3yk-noslice/Modules/_sre.c
   python/branches/p3yk-noslice/Modules/_ssl.c
   python/branches/p3yk-noslice/Modules/_testcapimodule.c
   python/branches/p3yk-noslice/Modules/almodule.c
   python/branches/p3yk-noslice/Modules/arraymodule.c
   python/branches/p3yk-noslice/Modules/audioop.c
   python/branches/p3yk-noslice/Modules/binascii.c
   python/branches/p3yk-noslice/Modules/bz2module.c
   python/branches/p3yk-noslice/Modules/cPickle.c
   python/branches/p3yk-noslice/Modules/cStringIO.c
   python/branches/p3yk-noslice/Modules/cgen.py
   python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_cn.c
   python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_iso2022.c
   python/branches/p3yk-noslice/Modules/cjkcodecs/cjkcodecs.h
   python/branches/p3yk-noslice/Modules/datetimemodule.c
   python/branches/p3yk-noslice/Modules/dbmmodule.c
   python/branches/p3yk-noslice/Modules/gcmodule.c
   python/branches/p3yk-noslice/Modules/itertoolsmodule.c
   python/branches/p3yk-noslice/Modules/linuxaudiodev.c
   python/branches/p3yk-noslice/Modules/main.c
   python/branches/p3yk-noslice/Modules/mathmodule.c
   python/branches/p3yk-noslice/Modules/mmapmodule.c
   python/branches/p3yk-noslice/Modules/ossaudiodev.c
   python/branches/p3yk-noslice/Modules/parsermodule.c
   python/branches/p3yk-noslice/Modules/posixmodule.c
   python/branches/p3yk-noslice/Modules/pyexpat.c
   python/branches/p3yk-noslice/Modules/readline.c
   python/branches/p3yk-noslice/Modules/resource.c
   python/branches/p3yk-noslice/Modules/socketmodule.c
   python/branches/p3yk-noslice/Modules/socketmodule.h
   python/branches/p3yk-noslice/Modules/symtablemodule.c
   python/branches/p3yk-noslice/Modules/threadmodule.c
   python/branches/p3yk-noslice/Modules/unicodedata.c
   python/branches/p3yk-noslice/Objects/abstract.c
   python/branches/p3yk-noslice/Objects/boolobject.c
   python/branches/p3yk-noslice/Objects/bufferobject.c
   python/branches/p3yk-noslice/Objects/bytesobject.c
   python/branches/p3yk-noslice/Objects/cellobject.c
   python/branches/p3yk-noslice/Objects/classobject.c
   python/branches/p3yk-noslice/Objects/codeobject.c
   python/branches/p3yk-noslice/Objects/complexobject.c
   python/branches/p3yk-noslice/Objects/dictobject.c
   python/branches/p3yk-noslice/Objects/exceptions.c
   python/branches/p3yk-noslice/Objects/fileobject.c
   python/branches/p3yk-noslice/Objects/floatobject.c
   python/branches/p3yk-noslice/Objects/funcobject.c
   python/branches/p3yk-noslice/Objects/intobject.c
   python/branches/p3yk-noslice/Objects/iterobject.c
   python/branches/p3yk-noslice/Objects/listobject.c
   python/branches/p3yk-noslice/Objects/longobject.c
   python/branches/p3yk-noslice/Objects/methodobject.c
   python/branches/p3yk-noslice/Objects/object.c
   python/branches/p3yk-noslice/Objects/obmalloc.c
   python/branches/p3yk-noslice/Objects/setobject.c
   python/branches/p3yk-noslice/Objects/sliceobject.c
   python/branches/p3yk-noslice/Objects/stringlib/partition.h
   python/branches/p3yk-noslice/Objects/stringobject.c
   python/branches/p3yk-noslice/Objects/tupleobject.c
   python/branches/p3yk-noslice/Objects/typeobject.c
   python/branches/p3yk-noslice/Objects/unicodeobject.c
   python/branches/p3yk-noslice/Objects/weakrefobject.c
   python/branches/p3yk-noslice/PC/VC6/_bsddb.dsp   (contents, props changed)
   python/branches/p3yk-noslice/PC/VC6/_socket.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/_ssl.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/_ssl.mak
   python/branches/p3yk-noslice/PC/VC6/_testcapi.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/_tkinter.dsp   (contents, props changed)
   python/branches/p3yk-noslice/PC/VC6/bz2.dsp   (contents, props changed)
   python/branches/p3yk-noslice/PC/VC6/make_versioninfo.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/pcbuild.dsw   (contents, props changed)
   python/branches/p3yk-noslice/PC/VC6/pyexpat.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/python.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/pythoncore.dsp   (contents, props changed)
   python/branches/p3yk-noslice/PC/VC6/pythonw.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/readme.txt
   python/branches/p3yk-noslice/PC/VC6/select.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/unicodedata.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/w9xpopen.dsp   (props changed)
   python/branches/p3yk-noslice/PC/VC6/winsound.dsp   (props changed)
   python/branches/p3yk-noslice/PC/_msi.c
   python/branches/p3yk-noslice/PC/_winreg.c
   python/branches/p3yk-noslice/PC/example_nt/example.vcproj
   python/branches/p3yk-noslice/PC/pyconfig.h
   python/branches/p3yk-noslice/PCbuild/_ctypes.vcproj
   python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj
   python/branches/p3yk-noslice/PCbuild8/_ctypes.vcproj
   python/branches/p3yk-noslice/PCbuild8/_ctypes_test.vcproj
   python/branches/p3yk-noslice/PCbuild8/_elementtree.vcproj
   python/branches/p3yk-noslice/PCbuild8/_msi.vcproj
   python/branches/p3yk-noslice/PCbuild8/_sqlite3.vcproj
   python/branches/p3yk-noslice/PCbuild8/make_buildinfo.c
   python/branches/p3yk-noslice/PCbuild8/make_buildinfo.vcproj
   python/branches/p3yk-noslice/PCbuild8/pcbuild.sln
   python/branches/p3yk-noslice/PCbuild8/python.vcproj
   python/branches/p3yk-noslice/PCbuild8/pythoncore.vcproj
   python/branches/p3yk-noslice/PCbuild8/pythonw.vcproj
   python/branches/p3yk-noslice/PCbuild8/readme.txt
   python/branches/p3yk-noslice/PCbuild8/select.vcproj
   python/branches/p3yk-noslice/PCbuild8/unicodedata.vcproj
   python/branches/p3yk-noslice/PCbuild8/w9xpopen.vcproj
   python/branches/p3yk-noslice/PCbuild8/winsound.vcproj
   python/branches/p3yk-noslice/Parser/Python.asdl
   python/branches/p3yk-noslice/Parser/asdl.py
   python/branches/p3yk-noslice/Parser/asdl_c.py
   python/branches/p3yk-noslice/Parser/parser.c
   python/branches/p3yk-noslice/Parser/parsetok.c
   python/branches/p3yk-noslice/Parser/tokenizer.c
   python/branches/p3yk-noslice/Python/Python-ast.c
   python/branches/p3yk-noslice/Python/ast.c
   python/branches/p3yk-noslice/Python/bltinmodule.c
   python/branches/p3yk-noslice/Python/ceval.c
   python/branches/p3yk-noslice/Python/compile.c
   python/branches/p3yk-noslice/Python/errors.c
   python/branches/p3yk-noslice/Python/frozen.c
   python/branches/p3yk-noslice/Python/getargs.c
   python/branches/p3yk-noslice/Python/graminit.c
   python/branches/p3yk-noslice/Python/import.c
   python/branches/p3yk-noslice/Python/marshal.c
   python/branches/p3yk-noslice/Python/modsupport.c
   python/branches/p3yk-noslice/Python/mystrtoul.c
   python/branches/p3yk-noslice/Python/peephole.c   (contents, props changed)
   python/branches/p3yk-noslice/Python/pystate.c
   python/branches/p3yk-noslice/Python/pythonrun.c
   python/branches/p3yk-noslice/Python/structmember.c
   python/branches/p3yk-noslice/Python/symtable.c
   python/branches/p3yk-noslice/Python/sysmodule.c
   python/branches/p3yk-noslice/README
   python/branches/p3yk-noslice/Tools/compiler/ast.txt
   python/branches/p3yk-noslice/Tools/compiler/astgen.py
   python/branches/p3yk-noslice/Tools/modulator/modulator.py
   python/branches/p3yk-noslice/Tools/msi/msi.py
   python/branches/p3yk-noslice/Tools/msi/uuids.py
   python/branches/p3yk-noslice/Tools/pybench/pybench.py
   python/branches/p3yk-noslice/Tools/scripts/byext.py   (props changed)
   python/branches/p3yk-noslice/Tools/scripts/findnocoding.py
   python/branches/p3yk-noslice/Tools/scripts/fixdiv.py
   python/branches/p3yk-noslice/Tools/scripts/h2py.py
   python/branches/p3yk-noslice/Tools/scripts/pysource.py
   python/branches/p3yk-noslice/configure
   python/branches/p3yk-noslice/configure.in
   python/branches/p3yk-noslice/pyconfig.h.in
   python/branches/p3yk-noslice/setup.py
Log:

Merge p3yk changes into branch.



Deleted: /python/branches/p3yk-noslice/BROKEN
==============================================================================
--- /python/branches/p3yk-noslice/BROKEN	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1 +0,0 @@
-(Nothing is broken at the moment AFAIK.)

Modified: python/branches/p3yk-noslice/Demo/classes/Complex.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/classes/Complex.py	(original)
+++ python/branches/p3yk-noslice/Demo/classes/Complex.py	Fri Dec 15 05:21:50 2006
@@ -165,7 +165,7 @@
         other = ToComplex(other)
         return cmp(other, self)
 
-    def __nonzero__(self):
+    def __bool__(self):
         return not (self.re == self.im == 0)
 
     abs = radius = __abs__

Modified: python/branches/p3yk-noslice/Demo/classes/Rat.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/classes/Rat.py	(original)
+++ python/branches/p3yk-noslice/Demo/classes/Rat.py	Fri Dec 15 05:21:50 2006
@@ -223,7 +223,7 @@
         return cmp(Rat(a), b)
 
     # a != 0
-    def __nonzero__(a):
+    def __bool__(a):
         return a.__num != 0
 
     # coercion

Modified: python/branches/p3yk-noslice/Demo/parser/unparse.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/parser/unparse.py	(original)
+++ python/branches/p3yk-noslice/Demo/parser/unparse.py	Fri Dec 15 05:21:50 2006
@@ -123,16 +123,6 @@
             self.write(", ")
             self.dispatch(t.msg)
 
-    def _Exec(self, t):
-        self.fill("exec ")
-        self.dispatch(t.body)
-        if t.globals:
-            self.write(" in ")
-            self.dispatch(t.globals)
-        if t.locals:
-            self.write(", ")
-            self.dispatch(t.locals)
-
     def _Print(self, t):
         self.fill("print ")
         do_comma = False
@@ -223,6 +213,9 @@
 
     def _FunctionDef(self, t):
         self.write("\n")
+        for deco in t.decorators:
+            self.fill("@")
+            self.dispatch(deco)
         self.fill("def "+t.name + "(")
         self.dispatch(t.args)
         self.write(")")

Modified: python/branches/p3yk-noslice/Demo/pysvr/pysvr.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/pysvr/pysvr.py	(original)
+++ python/branches/p3yk-noslice/Demo/pysvr/pysvr.py	Fri Dec 15 05:21:50 2006
@@ -108,7 +108,7 @@
         sys.stdout = sys.stderr = stdout
         sys.stdin = stdin
         try:
-            exec code in globals
+            exec(code, globals)
         except SystemExit, how:
             raise SystemExit, how, sys.exc_info()[2]
         except:

Modified: python/branches/p3yk-noslice/Demo/rpc/nfsclient.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/rpc/nfsclient.py	(original)
+++ python/branches/p3yk-noslice/Demo/rpc/nfsclient.py	Fri Dec 15 05:21:50 2006
@@ -163,7 +163,7 @@
         ra = (dir, 0, 2000)
         while 1:
             (status, rest) = self.Readdir(ra)
-            if status <> NFS_OK:
+            if status != NFS_OK:
                 break
             entries, eof = rest
             last_cookie = None

Modified: python/branches/p3yk-noslice/Demo/rpc/xdr.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/rpc/xdr.py	(original)
+++ python/branches/p3yk-noslice/Demo/rpc/xdr.py	Fri Dec 15 05:21:50 2006
@@ -78,7 +78,7 @@
         self.pack_uint(0)
 
     def pack_farray(self, n, list, pack_item):
-        if len(list) <> n:
+        if len(list) != n:
             raise ValueError, 'wrong array size'
         for item in list:
             pack_item(item)
@@ -183,7 +183,7 @@
         while 1:
             x = self.unpack_uint()
             if x == 0: break
-            if x <> 1:
+            if x != 1:
                 raise RuntimeError, '0 or 1 expected, got %r' % (x, )
             item = unpack_item()
             list.append(item)

Modified: python/branches/p3yk-noslice/Demo/scripts/lpwatch.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/scripts/lpwatch.py	(original)
+++ python/branches/p3yk-noslice/Demo/scripts/lpwatch.py	Fri Dec 15 05:21:50 2006
@@ -74,7 +74,7 @@
             ubytes = ubytes + bytes
             users[user] = ujobs, ubytes
         else:
-            if fields and fields[0] <> 'Rank':
+            if fields and fields[0] != 'Rank':
                 line = string.strip(line)
                 if line == 'no entries':
                     line = name + ': idle'
@@ -84,7 +84,7 @@
     #
     if totaljobs:
         line = '%d K' % ((totalbytes+1023)/1024)
-        if totaljobs <> len(users):
+        if totaljobs != len(users):
             line = line + ' (%d jobs)' % totaljobs
         if len(users) == 1:
             line = line + ' for %s' % (users.keys()[0],)

Modified: python/branches/p3yk-noslice/Demo/scripts/primes.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/scripts/primes.py	(original)
+++ python/branches/p3yk-noslice/Demo/scripts/primes.py	Fri Dec 15 05:21:50 2006
@@ -18,7 +18,7 @@
     while i <= max:
         for p in primes:
             if i%p == 0 or p*p > i: break
-        if i%p <> 0:
+        if i%p != 0:
             primes.append(i)
             if i >= min: print i
         i = i+2

Modified: python/branches/p3yk-noslice/Demo/scripts/update.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/scripts/update.py	(original)
+++ python/branches/p3yk-noslice/Demo/scripts/update.py	Fri Dec 15 05:21:50 2006
@@ -83,7 +83,7 @@
             print 'Funny line:', line,
             continue
         filename, lineno = prog.group(1, 2)
-        if not curfile or filename <> curfile.filename:
+        if not curfile or filename != curfile.filename:
             if curfile: curfile.finish()
             curfile = FileObj(filename)
         curfile.process(lineno, line[n:])

Modified: python/branches/p3yk-noslice/Demo/sockets/gopher.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/sockets/gopher.py	(original)
+++ python/branches/p3yk-noslice/Demo/sockets/gopher.py	Fri Dec 15 05:21:50 2006
@@ -246,7 +246,7 @@
 def browse_telnet(selector, host, port):
     if selector:
         print 'Log in as', repr(selector)
-    if type(port) <> type(''):
+    if type(port) != type(''):
         port = repr(port)
     sts = os.system('set -x; exec telnet ' + host + ' ' + port)
     if sts:

Modified: python/branches/p3yk-noslice/Demo/sockets/rpythond.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/sockets/rpythond.py	(original)
+++ python/branches/p3yk-noslice/Demo/sockets/rpythond.py	Fri Dec 15 05:21:50 2006
@@ -40,7 +40,7 @@
     sys.stdout = sys.stderr = fakefile = StringIO.StringIO()
     try:
         try:
-            exec request in {}, {}
+            exec(request, {}, {})
         except:
             print
             traceback.print_exc(100)

Modified: python/branches/p3yk-noslice/Demo/tkinter/guido/ShellWindow.py
==============================================================================
--- python/branches/p3yk-noslice/Demo/tkinter/guido/ShellWindow.py	(original)
+++ python/branches/p3yk-noslice/Demo/tkinter/guido/ShellWindow.py	Fri Dec 15 05:21:50 2006
@@ -115,11 +115,11 @@
                 os.close(i)
             except os.error:
                 pass
-        if os.dup(p2cread) <> 0:
+        if os.dup(p2cread) != 0:
             sys.stderr.write('popen2: bad read dup\n')
-        if os.dup(c2pwrite) <> 1:
+        if os.dup(c2pwrite) != 1:
             sys.stderr.write('popen2: bad write dup\n')
-        if os.dup(c2pwrite) <> 2:
+        if os.dup(c2pwrite) != 2:
             sys.stderr.write('popen2: bad write dup\n')
         for i in range(3, MAXFD):
             try:

Modified: python/branches/p3yk-noslice/Doc/Makefile
==============================================================================
--- python/branches/p3yk-noslice/Doc/Makefile	(original)
+++ python/branches/p3yk-noslice/Doc/Makefile	Fri Dec 15 05:21:50 2006
@@ -122,7 +122,7 @@
 
 # The end of this should reflect the major/minor version numbers of
 # the release:
-WHATSNEW=whatsnew25
+WHATSNEW=whatsnew26
 
 # what's what
 MANDVIFILES=	paper-$(PAPER)/api.dvi paper-$(PAPER)/ext.dvi \

Modified: python/branches/p3yk-noslice/Doc/api/concrete.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/api/concrete.tex	(original)
+++ python/branches/p3yk-noslice/Doc/api/concrete.tex	Fri Dec 15 05:21:50 2006
@@ -602,15 +602,15 @@
 \end{cfuncdesc}
 
 \begin{cfuncdesc}{PyObject*}{PyString_FromString}{const char *v}
-  Return a new string object with the value \var{v} on success, and
-  \NULL{} on failure.  The parameter \var{v} must not be \NULL{}; it
-  will not be checked.
+  Return a new string object with a copy of the string \var{v} as value
+  on success, and \NULL{} on failure.  The parameter \var{v} must not be
+  \NULL{}; it will not be checked.
 \end{cfuncdesc}
 
 \begin{cfuncdesc}{PyObject*}{PyString_FromStringAndSize}{const char *v,
                                                          Py_ssize_t len}
-  Return a new string object with the value \var{v} and length
-  \var{len} on success, and \NULL{} on failure.  If \var{v} is
+  Return a new string object with a copy of the string \var{v} as value
+  and length \var{len} on success, and \NULL{} on failure.  If \var{v} is
   \NULL{}, the contents of the string are uninitialized.
 \end{cfuncdesc}
 
@@ -2879,10 +2879,10 @@
 Various date and time objects are supplied by the \module{datetime}
 module.  Before using any of these functions, the header file
 \file{datetime.h} must be included in your source (note that this is
-not include by \file{Python.h}), and macro \cfunction{PyDateTime_IMPORT()}
-must be invoked.  The macro arranges to put a pointer to a C structure
-in a static variable \code{PyDateTimeAPI}, which is used by the following
-macros.
+not included by \file{Python.h}), and the macro
+\cfunction{PyDateTime_IMPORT} must be invoked.  The macro puts a
+pointer to a C structure into a static variable, 
+\code{PyDateTimeAPI}, that is used by the following macros.
 
 Type-check macros:
 
@@ -3080,9 +3080,9 @@
 \cfunction{PyObject_IsTrue()}, \cfunction{PyObject_Print()}, and
 \cfunction{PyObject_GetIter()})
 or the abstract number protocol (including
-\cfunction{PyNumber_Add()}, \cfunction{PyNumber_Subtract()},
+\cfunction{PyNumber_And()}, \cfunction{PyNumber_Subtract()},
 \cfunction{PyNumber_Or()}, \cfunction{PyNumber_Xor()},
-\cfunction{PyNumber_InPlaceAdd()}, \cfunction{PyNumber_InPlaceSubtract()},
+\cfunction{PyNumber_InPlaceAnd()}, \cfunction{PyNumber_InPlaceSubtract()},
 \cfunction{PyNumber_InPlaceOr()}, and \cfunction{PyNumber_InPlaceXor()}).
 
 \begin{ctypedesc}{PySetObject}

Modified: python/branches/p3yk-noslice/Doc/api/exceptions.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/api/exceptions.tex	(original)
+++ python/branches/p3yk-noslice/Doc/api/exceptions.tex	Fri Dec 15 05:21:50 2006
@@ -325,7 +325,7 @@
   default effect for \constant{SIGINT}\ttindex{SIGINT} is to raise the
   \withsubitem{(built-in exception)}{\ttindex{KeyboardInterrupt}}
   \exception{KeyboardInterrupt} exception.  If an exception is raised
-  the error indicator is set and the function returns \code{1};
+  the error indicator is set and the function returns \code{-1};
   otherwise the function returns \code{0}.  The error indicator may or
   may not be cleared if it was previously set.
 \end{cfuncdesc}

Modified: python/branches/p3yk-noslice/Doc/api/refcounts.dat
==============================================================================
--- python/branches/p3yk-noslice/Doc/api/refcounts.dat	(original)
+++ python/branches/p3yk-noslice/Doc/api/refcounts.dat	Fri Dec 15 05:21:50 2006
@@ -712,10 +712,6 @@
 PyNumber_Check:PyObject*:o:0:
 PyNumber_Check:int:::
 
-PyNumber_Coerce:int:::
-PyNumber_Coerce:PyObject**:p1:+1:
-PyNumber_Coerce:PyObject**:p2:+1:
-
 PyNumber_Divide:PyObject*::+1:
 PyNumber_Divide:PyObject*:o1:0:
 PyNumber_Divide:PyObject*:o2:0:

Modified: python/branches/p3yk-noslice/Doc/dist/dist.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/dist/dist.tex	(original)
+++ python/branches/p3yk-noslice/Doc/dist/dist.tex	Fri Dec 15 05:21:50 2006
@@ -3607,6 +3607,11 @@
 
 % todo
 
+\section{\module{distutils.command.bdist_msi} --- Build a Microsoft Installer binary package}
+\declaremodule[distutils.command.bdistmsi]{standard}{distutils.command.bdist_msi}
+\modulesynopsis{Build a binary distribution as a Windows MSI file}
+
+% todo
 
 \section{\module{distutils.command.bdist_rpm} --- Build a binary distribution as a Redhat RPM and SRPM}
 \declaremodule[distutils.command.bdistrpm]{standard}{distutils.command.bdist_rpm}

Modified: python/branches/p3yk-noslice/Doc/ext/extending.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ext/extending.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ext/extending.tex	Fri Dec 15 05:21:50 2006
@@ -220,6 +220,8 @@
     PyObject *m;
 
     m = Py_InitModule("spam", SpamMethods);
+    if (m == NULL)
+        return;
 
     SpamError = PyErr_NewException("spam.error", NULL, NULL);
     Py_INCREF(SpamError);
@@ -364,9 +366,9 @@
 created module based upon the table (an array of \ctype{PyMethodDef}
 structures) that was passed as its second argument.
 \cfunction{Py_InitModule()} returns a pointer to the module object
-that it creates (which is unused here).  It aborts with a fatal error
-if the module could not be initialized satisfactorily, so the caller
-doesn't need to check for errors.
+that it creates (which is unused here).  It may abort with a fatal error
+for certain errors, or return \NULL{} if the module could not be
+initialized satisfactorily.
 
 When embedding Python, the \cfunction{initspam()} function is not
 called automatically unless there's an entry in the
@@ -1275,6 +1277,8 @@
     PyObject *c_api_object;
 
     m = Py_InitModule("spam", SpamMethods);
+    if (m == NULL)
+        return;
 
     /* Initialize the C API pointer array */
     PySpam_API[PySpam_System_NUM] = (void *)PySpam_System;
@@ -1361,7 +1365,9 @@
 {
     PyObject *m;
 
-    Py_InitModule("client", ClientMethods);
+    m = Py_InitModule("client", ClientMethods);
+    if (m == NULL)
+        return;
     if (import_spam() < 0)
         return;
     /* additional initialization can happen here */

Modified: python/branches/p3yk-noslice/Doc/howto/doanddont.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/howto/doanddont.tex	(original)
+++ python/branches/p3yk-noslice/Doc/howto/doanddont.tex	Fri Dec 15 05:21:50 2006
@@ -81,7 +81,7 @@
 
 \end{itemize}
 
-\subsection{Unadorned \keyword{exec}, \function{execfile} and friends}
+\subsection{Unadorned \function{exec}, \function{execfile} and friends}
 
 The word ``unadorned'' refers to the use without an explicit dictionary,
 in which case those constructs evaluate code in the {\em current} environment.
@@ -93,10 +93,10 @@
 
 \begin{verbatim}
 >>> for name in sys.argv[1:]:
->>>     exec "%s=1" % name
+>>>     exec("%s=1" % name)
 >>> def func(s, **kw):
 >>>     for var, val in kw.items():
->>>         exec "s.%s=val" % var  # invalid!
+>>>         exec("s.%s=val" % var)  # invalid!
 >>> execfile("handler.py")
 >>> handle()
 \end{verbatim}
@@ -289,19 +289,7 @@
 aware of for some reason: \function{min()} and \function{max()} can
 find the minimum/maximum of any sequence with comparable semantics,
 for example, yet many people write their own
-\function{max()}/\function{min()}. Another highly useful function is
-\function{reduce()}. A classical use of \function{reduce()}
-is something like
-
-\begin{verbatim}
-import sys, operator
-nums = map(float, sys.argv[1:])
-print reduce(operator.add, nums)/len(nums)
-\end{verbatim}
-
-This cute little script prints the average of all numbers given on the
-command line. The \function{reduce()} adds up all the numbers, and
-the rest is just some pre- and postprocessing.
+\function{max()}/\function{min()}.
 
 On the same note, note that \function{float()}, \function{int()} and
 \function{long()} all accept arguments of type string, and so are

Modified: python/branches/p3yk-noslice/Doc/howto/regex.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/howto/regex.tex	(original)
+++ python/branches/p3yk-noslice/Doc/howto/regex.tex	Fri Dec 15 05:21:50 2006
@@ -367,7 +367,7 @@
 strings, and displays whether the RE matches or fails.
 \file{redemo.py} can be quite useful when trying to debug a
 complicated RE.  Phil Schwartz's
-\ulink{Kodos}{http://kodos.sourceforge.net} is also an interactive
+\ulink{Kodos}{http://www.phil-schwartz.com/kodos.spy} is also an interactive
 tool for developing and testing RE patterns.  This HOWTO will use the
 standard Python interpreter for its examples.
 

Modified: python/branches/p3yk-noslice/Doc/inst/inst.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/inst/inst.tex	(original)
+++ python/branches/p3yk-noslice/Doc/inst/inst.tex	Fri Dec 15 05:21:50 2006
@@ -632,7 +632,7 @@
 installation base directory when you run the setup script.  For example,
 
 \begin{verbatim}
-python setup.py --install-base=/tmp
+python setup.py install --install-base=/tmp
 \end{verbatim}
 
 would install pure modules to \filevar{/tmp/python/lib} in the first

Modified: python/branches/p3yk-noslice/Doc/lib/asttable.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/asttable.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/asttable.tex	Fri Dec 15 05:21:50 2006
@@ -36,9 +36,6 @@
 \lineiii{}{\member{expr}}{}
 \hline 
 
-\lineiii{Backquote}{\member{expr}}{}
-\hline 
-
 \lineiii{Bitand}{\member{nodes}}{}
 \hline 
 

Modified: python/branches/p3yk-noslice/Doc/lib/email-unpack.py
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/email-unpack.py	(original)
+++ python/branches/p3yk-noslice/Doc/lib/email-unpack.py	Fri Dec 15 05:21:50 2006
@@ -37,7 +37,7 @@
         os.mkdir(opts.directory)
     except OSError, e:
         # Ignore directory exists error
-        if e.errno <> errno.EEXIST:
+        if e.errno != errno.EEXIST:
             raise
 
     fp = open(msgfile)

Modified: python/branches/p3yk-noslice/Doc/lib/libasyncore.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libasyncore.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libasyncore.tex	Fri Dec 15 05:21:50 2006
@@ -198,9 +198,11 @@
 \end{methoddesc}
 
 \begin{methoddesc}{bind}{address}
-  Bind the socket to \var{address}.  The socket must not already
-  be bound.  (The format of \var{address} depends on the address
-  family --- see above.)
+  Bind the socket to \var{address}.  The socket must not already be
+  bound.  (The format of \var{address} depends on the address family
+  --- see above.)  To mark the socket as re-usable (setting the
+  \constant{SO_REUSEADDR} option), call the \class{dispatcher}
+  object's \method{set_reuse_addr()} method.
 \end{methoddesc}
 
 \begin{methoddesc}{accept}{}

Modified: python/branches/p3yk-noslice/Doc/lib/libatexit.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libatexit.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libatexit.tex	Fri Dec 15 05:21:50 2006
@@ -44,6 +44,10 @@
 traceback is printed (unless \exception{SystemExit} is raised) and the
 exception information is saved.  After all exit handlers have had a
 chance to run the last exception to be raised is re-raised.
+
+\versionchanged[This function now returns \var{func} which makes it
+                possible to use it as a decorator without binding the
+		original name to \code{None}]{2.6}
 \end{funcdesc}
 
 
@@ -92,3 +96,15 @@
 # or:
 atexit.register(goodbye, adjective='nice', name='Donny')
 \end{verbatim}
+
+Usage as a decorator:
+
+\begin{verbatim}
+import atexit
+
+ at atexit.register
+def goodbye():
+    print "You are now leaving the Python sector."
+\end{verbatim}
+
+This obviously only works with functions that don't take arguments.

Modified: python/branches/p3yk-noslice/Doc/lib/libbase64.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libbase64.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libbase64.tex	Fri Dec 15 05:21:50 2006
@@ -21,7 +21,7 @@
 decoding to and from file-like objects as well as strings, but only
 using the Base64 standard alphabet.
 
-The modern interface provides:
+The modern interface, which was introduced in Python 2.4, provides:
 
 \begin{funcdesc}{b64encode}{s\optional{, altchars}}
 Encode a string use Base64.

Modified: python/branches/p3yk-noslice/Doc/lib/libbsddb.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libbsddb.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libbsddb.tex	Fri Dec 15 05:21:50 2006
@@ -19,21 +19,23 @@
 3.3 thru 4.4.
 
 \begin{seealso}
-  \seeurl{http://pybsddb.sourceforge.net/}{The website with documentation
-  for the \module{bsddb.db} python Berkeley DB interface that closely mirrors
-  the Sleepycat object oriented interface provided in Berkeley DB 3 and 4.}
-  \seeurl{http://www.sleepycat.com/}{Sleepycat Software produces the
-  Berkeley DB library.}
+  \seeurl{http://pybsddb.sourceforge.net/}
+         {The website with documentation for the \module{bsddb.db}
+          Python Berkeley DB interface that closely mirrors the object
+          oriented interface provided in Berkeley DB 3 and 4.}
+
+  \seeurl{http://www.oracle.com/database/berkeley-db/}
+         {The Berkeley DB library.}
 \end{seealso}
 
 A more modern DB, DBEnv and DBSequence object interface is available in the
-\module{bsddb.db} module which closely matches the Sleepycat Berkeley DB C API
+\module{bsddb.db} module which closely matches the Berkeley DB C API
 documented at the above URLs.  Additional features provided by the
 \module{bsddb.db} API include fine tuning, transactions, logging, and
 multiprocess concurrent database access.
 
 The following is a description of the legacy \module{bsddb} interface
-compatible with the old python bsddb module.  Starting in Python 2.5 this
+compatible with the old Python bsddb module.  Starting in Python 2.5 this
 interface should be safe for multithreaded access.  The \module{bsddb.db}
 API is recommended for threading users as it provides better control.
 

Modified: python/branches/p3yk-noslice/Doc/lib/libcfgparser.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libcfgparser.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libcfgparser.tex	Fri Dec 15 05:21:50 2006
@@ -48,11 +48,20 @@
 may be passed into the \method{get()} method which will override all
 others.
 
-\begin{classdesc}{RawConfigParser}{\optional{defaults}}
+Sections are normally stored in a builtin dictionary. An alternative
+dictionary type can be passed to the \class{ConfigParser} constructor.
+For example, if a dictionary type is passed that sorts its keys,
+the sections will be sorted on write-back, as will be the keys within
+each section.
+
+\begin{classdesc}{RawConfigParser}{\optional{defaults\optional{, dict_type}}}
 The basic configuration object.  When \var{defaults} is given, it is
-initialized into the dictionary of intrinsic defaults.  This class
-does not support the magical interpolation behavior.
+initialized into the dictionary of intrinsic defaults.  When \var{dict_type}
+is given, it will be used to create the dictionary objects for the list
+of sections, for the options within a section, and for the default values.
+This class does not support the magical interpolation behavior.
 \versionadded{2.3}
+\versionchanged[\var{dict_type} was added]{2.6}
 \end{classdesc}
 
 \begin{classdesc}{ConfigParser}{\optional{defaults}}

Modified: python/branches/p3yk-noslice/Doc/lib/libcommands.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libcommands.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libcommands.tex	Fri Dec 15 05:21:50 2006
@@ -12,6 +12,11 @@
 return any output generated by the command and, optionally, the exit
 status.
 
+The \module{subprocess} module provides more powerful facilities for
+spawning new processes and retrieving their results.  Using the
+\module{subprocess} module is preferable to using the \module{commands}
+module.
+
 The \module{commands} module defines the following functions:
 
 
@@ -51,3 +56,7 @@
 >>> commands.getstatus('/bin/ls')
 '-rwxr-xr-x  1 root        13352 Oct 14  1994 /bin/ls'
 \end{verbatim}
+
+\begin{seealso}
+  \seemodule{subprocess}{Module for spawning and managing subprocesses.}
+\end{seealso}

Modified: python/branches/p3yk-noslice/Doc/lib/libconsts.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libconsts.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libconsts.tex	Fri Dec 15 05:21:50 2006
@@ -26,6 +26,8 @@
 \end{datadesc}
 
 \begin{datadesc}{Ellipsis}
-  Special value used in conjunction with extended slicing syntax.
+  The same as \code{...}.
+  Special value used mostly in conjunction with extended slicing syntax
+  for user-defined container data types.
   % XXX Someone who understands extended slicing should fill in here.
 \end{datadesc}

Modified: python/branches/p3yk-noslice/Doc/lib/libcsv.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libcsv.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libcsv.tex	Fri Dec 15 05:21:50 2006
@@ -64,9 +64,9 @@
 class or one of the strings returned by the \function{list_dialects}
 function.  The other optional {}\var{fmtparam} keyword arguments can be
 given to override individual formatting parameters in the current
-dialect.  For more information about the dialect and formatting
+dialect.  For full details about the dialect and formatting
 parameters, see section~\ref{csv-fmt-params}, ``Dialects and Formatting
-Parameters'' for details of these parameters.
+Parameters''.
 
 All data read are returned as strings.  No automatic data type
 conversion is performed.
@@ -96,10 +96,10 @@
 of a subclass of the \class{Dialect} class or one of the strings
 returned by the \function{list_dialects} function.  The other optional
 {}\var{fmtparam} keyword arguments can be given to override individual
-formatting parameters in the current dialect.  For more information
+formatting parameters in the current dialect.  For full details
 about the dialect and formatting parameters, see
-section~\ref{csv-fmt-params}, ``Dialects and Formatting Parameters'' for
-details of these parameters.  To make it as easy as possible to
+section~\ref{csv-fmt-params}, ``Dialects and Formatting Parameters''.
+To make it as easy as possible to
 interface with modules which implement the DB API, the value
 \constant{None} is written as the empty string.  While this isn't a
 reversible transformation, it makes it easier to dump SQL NULL data values
@@ -113,9 +113,8 @@
 or Unicode object. The dialect can be specified either by passing a
 sub-class of \class{Dialect}, or by \var{fmtparam} keyword arguments,
 or both, with keyword arguments overriding parameters of the dialect.
-For more information about the dialect and formatting parameters, see
-section~\ref{csv-fmt-params}, ``Dialects and Formatting Parameters''
-for details of these parameters.
+For full details about the dialect and formatting parameters, see
+section~\ref{csv-fmt-params}, ``Dialects and Formatting Parameters''.
 \end{funcdesc}
 
 \begin{funcdesc}{unregister_dialect}{name}
@@ -197,12 +196,13 @@
 
 \begin{classdesc}{excel}{}
 The \class{excel} class defines the usual properties of an Excel-generated
-CSV file.
+CSV file.  It is registered with the dialect name \code{'excel'}.
 \end{classdesc}
 
 \begin{classdesc}{excel_tab}{}
 The \class{excel_tab} class defines the usual properties of an
-Excel-generated TAB-delimited file.
+Excel-generated TAB-delimited file.  It is registered with the dialect name
+\code{'excel-tab'}.
 \end{classdesc}
 
 \begin{classdesc}{Sniffer}{}
@@ -345,6 +345,7 @@
 \begin{memberdesc}[csv reader]{line_num}
  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.
+ \versionadded{2.5}
 \end{memberdesc}
 
 

Modified: python/branches/p3yk-noslice/Doc/lib/libctypes.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libctypes.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libctypes.tex	Fri Dec 15 05:21:50 2006
@@ -1821,7 +1821,7 @@
 \begin{quote}
 \begin{verbatim}>>> from ctypes import c_int, WINFUNCTYPE, windll
 >>> from ctypes.wintypes import HWND, LPCSTR, UINT
->>> prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, c_uint)
+>>> prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, UINT)
 >>> paramflags = (1, "hwnd", 0), (1, "text", "Hi"), (1, "caption", None), (1, "flags", 0)
 >>> MessageBox = prototype(("MessageBoxA", windll.user32), paramflags)
 >>>\end{verbatim}
@@ -1848,7 +1848,7 @@
 
 Here is the wrapping with \code{ctypes}:
 \begin{quote}
-\begin{verbatim}>>> from ctypes import POINTER, WINFUNCTYPE, windll
+\begin{verbatim}>>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError
 >>> from ctypes.wintypes import BOOL, HWND, RECT
 >>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))
 >>> paramflags = (1, "hwnd"), (2, "lprect")
@@ -2299,12 +2299,10 @@
 or error information for a function or method call.
 \end{classdesc*}
 
-\code{py{\_}object} : classdesc*
-\begin{quote}
-
-Represents the C \code{PyObject *} datatype.  Calling this with an
-without an argument creates a \code{NULL} \code{PyObject *} pointer.
-\end{quote}
+\begin{classdesc*}{py_object}
+Represents the C \code{PyObject *} datatype.  Calling this without an
+argument creates a \code{NULL} \code{PyObject *} pointer.
+\end{classdesc*}
 
 The \code{ctypes.wintypes} module provides quite some other Windows
 specific data types, for example \code{HWND}, \code{WPARAM}, or \code{DWORD}.
@@ -2440,5 +2438,6 @@
 
 \subsubsection{Arrays and pointers\label{ctypes-arrays-pointers}}
 
-XXX
+Not yet written - please see section~\ref{ctypes-pointers}, pointers and
+section~\ref{ctypes-arrays}, arrays in the tutorial.
 

Modified: python/branches/p3yk-noslice/Doc/lib/libdatetime.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libdatetime.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libdatetime.tex	Fri Dec 15 05:21:50 2006
@@ -1421,19 +1421,21 @@
 varies across platforms.  Regardless of platform, years before 1900
 cannot be used.
 
-\subsection{Examples}
-
-\subsubsection{Creating Datetime Objects from Formatted Strings}
-
-The \class{datetime} class does not directly support parsing formatted time
-strings.  You can use \function{time.strptime} to do the parsing and create
-a \class{datetime} object from the tuple it returns:
-
-\begin{verbatim}
->>> s = "2005-12-06T12:13:14"
->>> from datetime import datetime
->>> from time import strptime
->>> datetime(*strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6])
-datetime.datetime(2005, 12, 6, 12, 13, 14)
-\end{verbatim}
-
+%%% This example is obsolete, since strptime is now supported by datetime.
+% 
+% \subsection{Examples}
+% 
+% \subsubsection{Creating Datetime Objects from Formatted Strings}
+% 
+% The \class{datetime} class does not directly support parsing formatted time
+% strings.  You can use \function{time.strptime} to do the parsing and create
+% a \class{datetime} object from the tuple it returns:
+% 
+% \begin{verbatim}
+% >>> s = "2005-12-06T12:13:14"
+% >>> from datetime import datetime
+% >>> from time import strptime
+% >>> datetime(*strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6])
+% datetime.datetime(2005, 12, 6, 12, 13, 14)
+% \end{verbatim}
+% 

Modified: python/branches/p3yk-noslice/Doc/lib/libdecimal.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libdecimal.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libdecimal.tex	Fri Dec 15 05:21:50 2006
@@ -435,36 +435,37 @@
 the \function{getcontext()} and \function{setcontext()} functions:
 
 \begin{funcdesc}{getcontext}{}
-  Return the current context for the active thread.                                          
+  Return the current context for the active thread.
 \end{funcdesc}            
 
 \begin{funcdesc}{setcontext}{c}
-  Set the current context for the active thread to \var{c}.                                          
+  Set the current context for the active thread to \var{c}.
 \end{funcdesc}  
 
 Beginning with Python 2.5, you can also use the \keyword{with} statement
-to temporarily change the active context. For example the following code
-increases the current decimal precision by 2 places, performs a
-calculation, and then automatically restores the previous context:
+and the \function{localcontext()} function to temporarily change the
+active context.
 
-\begin{verbatim}
-from __future__ import with_statement
-import decimal
-
-with decimal.getcontext() as ctx:
-    ctx.prec += 2   # add 2 more digits of precision
-    calculate_something()
+\begin{funcdesc}{localcontext}{\optional{c}}
+  Return a context manager that will set the current context for
+  the active thread to a copy of \var{c} on entry to the with-statement
+  and restore the previous context when exiting the with-statement. If
+  no context is specified, a copy of the current context is used.
+  \versionadded{2.5}
+
+  For example, the following code sets the current decimal precision
+  to 42 places, performs a calculation, and then automatically restores
+  the previous context:
+\begin{verbatim}
+    from __future__ import with_statement
+    from decimal import localcontext
+
+    with localcontext() as ctx:
+        ctx.prec = 42   # Perform a high precision calculation
+        s = calculate_something()
+    s = +s  # Round the final result back to the default precision
 \end{verbatim}
-
-The context that's active in the body of the \keyword{with} statement is
-a \emph{copy} of the context you provided to the \keyword{with}
-statement, so modifying its attributes doesn't affect anything except
-that temporary copy.
-
-You can use any decimal context in a \keyword{with} statement, but if
-you just want to make a temporary change to some aspect of the current
-context, it's easiest to just use \function{getcontext()} as shown
-above.
+\end{funcdesc}
 
 New contexts can also be created using the \class{Context} constructor
 described below. In addition, the module provides three pre-made

Modified: python/branches/p3yk-noslice/Doc/lib/libdis.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libdis.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libdis.tex	Fri Dec 15 05:21:50 2006
@@ -165,10 +165,6 @@
 Implements \code{TOS = not TOS}.
 \end{opcodedesc}
 
-\begin{opcodedesc}{UNARY_CONVERT}{}
-Implements \code{TOS = `TOS`}.
-\end{opcodedesc}
-
 \begin{opcodedesc}{UNARY_INVERT}{}
 Implements \code{TOS = \~{}TOS}.
 \end{opcodedesc}
@@ -359,11 +355,6 @@
 This opcode implements \code{from module import *}.
 \end{opcodedesc}
 
-\begin{opcodedesc}{EXEC_STMT}{}
-Implements \code{exec TOS2,TOS1,TOS}.  The compiler fills
-missing optional parameters with \code{None}.
-\end{opcodedesc}
-
 \begin{opcodedesc}{POP_BLOCK}{}
 Removes one block from the block stack.  Per frame, there is a 
 stack of blocks, denoting nested loops, try statements, and such.
@@ -452,6 +443,10 @@
 Works as \code{BUILD_TUPLE}, but creates a list.
 \end{opcodedesc}
 
+\begin{opcodedesc}{BUILD_SET}{count}
+Works as \code{BUILD_TUPLE}, but creates a set.
+\end{opcodedesc}
+
 \begin{opcodedesc}{BUILD_MAP}{zero}
 Pushes a new empty dictionary object onto the stack.  The argument is
 ignored and set to zero by the compiler.

Modified: python/branches/p3yk-noslice/Doc/lib/libetree.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libetree.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libetree.tex	Fri Dec 15 05:21:50 2006
@@ -1,45 +1,34 @@
-\section{\module{elementtree} --- The xml.etree.ElementTree Module}
-\declaremodule{standard}{elementtree}
+\section{\module{xml.etree.ElementTree} --- The ElementTree XML API}
+\declaremodule{standard}{xml.etree.ElementTree}
 \moduleauthor{Fredrik Lundh}{fredrik at pythonware.com}
-\modulesynopsis{This module provides implementations
-of the Element and ElementTree types, plus support classes.
+\modulesynopsis{Implementation of the ElementTree API.}
 
-A C version of this API is available as xml.etree.cElementTree.}
 \versionadded{2.5}
 
-
-\subsection{Overview\label{elementtree-overview}}
-
 The Element type is a flexible container object, designed to store
 hierarchical data structures in memory. The type can be described as a
 cross between a list and a dictionary.
 
 Each element has a number of properties associated with it:
-\begin{itemize}
-\item {} 
-a tag which is a string identifying what kind of data
-this element represents (the element type, in other words).
-
-\item {} 
-a number of attributes, stored in a Python dictionary.
-
-\item {} 
-a text string.
-
-\item {} 
-an optional tail string.
-
-\item {} 
-a number of child elements, stored in a Python sequence
 
+\begin{itemize}
+  \item a tag which is a string identifying what kind of data
+        this element represents (the element type, in other words).
+  \item a number of attributes, stored in a Python dictionary.
+  \item a text string.
+  \item an optional tail string.
+  \item a number of child elements, stored in a Python sequence
 \end{itemize}
 
 To create an element instance, use the Element or SubElement factory
 functions.
 
-The ElementTree class can be used to wrap an element
+The \class{ElementTree} class can be used to wrap an element
 structure, and convert it from and to XML.
 
+A C implementation of this API is available as
+\module{xml.etree.cElementTree}.
+
 
 \subsection{Functions\label{elementtree-functions}}
 

Modified: python/branches/p3yk-noslice/Doc/lib/libexcs.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libexcs.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libexcs.tex	Fri Dec 15 05:21:50 2006
@@ -293,10 +293,10 @@
 \begin{excdesc}{SyntaxError}
 % XXXJH xref to these functions?
   Raised when the parser encounters a syntax error.  This may occur in
-  an \keyword{import} statement, in an \keyword{exec} statement, in a call
-  to the built-in function \function{eval()} or \function{input()}, or
-  when reading the initial script or standard input (also
-  interactively).
+  an \keyword{import} statement, in a call to the built-in functions
+  \function{exec()}, \function{execfile()}, \function{eval()} or
+  \function{input()}, or when reading the initial script or standard
+  input (also interactively).
 
   Instances of this class have attributes \member{filename},
   \member{lineno}, \member{offset} and \member{text} for easier access

Modified: python/branches/p3yk-noslice/Doc/lib/libfpectl.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libfpectl.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libfpectl.tex	Fri Dec 15 05:21:50 2006
@@ -7,6 +7,11 @@
 \sectionauthor{Lee Busby}{busby1 at llnl.gov}
 \modulesynopsis{Provide control for floating point exception handling.}
 
+\note{The \module{fpectl} module is not built by default, and its usage
+      is discouraged and may be dangerous except in the hands of
+      experts.  See also the section \ref{fpectl-limitations} on
+      limitations for more details.}
+
 Most computers carry out floating point operations\index{IEEE-754}
 in conformance with the so-called IEEE-754 standard.
 On any real computer,
@@ -95,7 +100,7 @@
 \end{verbatim}
 
 
-\subsection{Limitations and other considerations}
+\subsection{Limitations and other considerations \label{fpectl-limitations}}
 
 Setting up a given processor to trap IEEE-754 floating point
 errors currently requires custom code on a per-architecture basis.

Modified: python/branches/p3yk-noslice/Doc/lib/libfuncs.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libfuncs.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libfuncs.tex	Fri Dec 15 05:21:50 2006
@@ -178,7 +178,7 @@
 \begin{funcdesc}{compile}{string, filename, kind\optional{,
                           flags\optional{, dont_inherit}}}
   Compile the \var{string} into a code object.  Code objects can be
-  executed by an \keyword{exec} statement or evaluated by a call to
+  executed by a call to \function{exec()} or evaluated by a call to
   \function{eval()}.  The \var{filename} argument should
   give the file from which the code was read; pass some recognizable value
   if it wasn't read from a file (\code{'<string>'} is commonly used).
@@ -366,7 +366,7 @@
   compiled passing \code{'eval'} as the \var{kind} argument.
 
   Hints: dynamic execution of statements is supported by the
-  \keyword{exec} statement.  Execution of statements from a file is
+  \function{exec()} function.  Execution of statements from a file is
   supported by the \function{execfile()} function.  The
   \function{globals()} and \function{locals()} functions returns the
   current global and local dictionary, respectively, which may be
@@ -374,13 +374,47 @@
   \function{execfile()}.
 \end{funcdesc}
 
+
+\begin{funcdesc}{exec}{object\optional{, globals\optional{, locals}}}
+  This function supports dynamic execution of Python code.
+  \var{object} must be either a string, an open file object, or
+  a code object.  If it is a string, the string is parsed as a suite of
+  Python statements which is then executed (unless a syntax error
+  occurs).  If it is an open file, the file is parsed until \EOF{} and
+  executed.  If it is a code object, it is simply executed.  In all
+  cases, the code that's executed is expected to be valid as file
+  input (see the section ``File input'' in the Reference Manual).
+  Be aware that the \keyword{return} and \keyword{yield} statements may
+  not be used outside of function definitions even within the context of
+  code passed to the \function{exec()} function.
+  The return value is \code{None}.
+
+  In all cases, if the optional parts are omitted, the code is executed
+  in the current scope.  If only \var{globals} is provided, it must be
+  a dictionary, which will be used for both the global and the local
+  variables.  If \var{globals} and \var{locals} are given, they are used
+  for the global and local variables, respectively.  If provided,
+  \var{locals} can be any mapping object.
+
+  If the \var{globals} dictionary does not contain a value for the
+  key \code{__builtins__}, a reference to the dictionary of the built-in
+  module \module{__builtin__} is inserted under that key.  That way you
+  can control what builtins are available to the executed code by
+  inserting your own \code{__builtins__} dictionary into \var{globals}
+  before passing it to \function{exec()}.
+
+  \note{The built-in functions \function{globals()} and \function{locals()}
+        return the current global and local dictionary, respectively, which
+	may be useful to pass around for use as the second and third
+	argument to \function{exec()}.}
+\end{funcdesc}
+
 \begin{funcdesc}{execfile}{filename\optional{, globals\optional{, locals}}}
-  This function is similar to the
-  \keyword{exec} statement, but parses a file instead of a string.  It
+  This function is similar to the \function{exec()} function, but parses a
+  file given by the file name instead of a string.  It
   is different from the \keyword{import} statement in that it does not
   use the module administration --- it reads the file unconditionally
-  and does not create a new module.\footnote{It is used relatively
-  rarely so does not warrant being made into a statement.}
+  and does not create a new module.
 
   The arguments are a file name and two optional dictionaries.  The file is
   parsed and evaluated as a sequence of Python statements (similarly to a
@@ -774,7 +808,7 @@
 
 \begin{verbatim}
 class C(object):
-    def __init__(self): self.__x = None
+    def __init__(self): self._x = None
     def getx(self): return self._x
     def setx(self, value): self._x = value
     def delx(self): del self._x
@@ -836,19 +870,6 @@
 \end{verbatim}
 \end{funcdesc}
 
-\begin{funcdesc}{reduce}{function, sequence\optional{, initializer}}
-  Apply \var{function} of two arguments cumulatively to the items of
-  \var{sequence}, from left to right, so as to reduce the sequence to
-  a single value.  For example, \code{reduce(lambda x, y: x+y, [1, 2,
-  3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}.  The left argument,
-  \var{x}, is the accumulated value and the right argument, \var{y},
-  is the update value from the \var{sequence}.  If the optional
-  \var{initializer} is present, it is placed before the items of the
-  sequence in the calculation, and serves as a default when the
-  sequence is empty.  If \var{initializer} is not given and
-  \var{sequence} contains only one item, the first item is returned.
-\end{funcdesc}
-
 \begin{funcdesc}{reload}{module}
   Reload a previously imported \var{module}.  The
   argument must be a module object, so it must have been successfully
@@ -1058,8 +1079,6 @@
   The \var{sequence}'s items are normally numbers, and are not allowed
   to be strings.  The fast, correct way to concatenate sequence of
   strings is by calling \code{''.join(\var{sequence})}.
-  Note that \code{sum(range(\var{n}), \var{m})} is equivalent to
-  \code{reduce(operator.add, range(\var{n}), \var{m})}
   \versionadded{2.3}
 \end{funcdesc}
 
@@ -1243,12 +1262,6 @@
   argument).
 \end{funcdesc}
 
-\begin{funcdesc}{coerce}{x, y}
-  Return a tuple consisting of the two numeric arguments converted to
-  a common type, using the same rules as used by arithmetic
-  operations. If coercion is not possible, raise \exception{TypeError}.
-\end{funcdesc}
-
 \begin{funcdesc}{intern}{string}
   Enter \var{string} in the table of ``interned'' strings and return
   the interned string -- which is \var{string} itself or a copy.

Modified: python/branches/p3yk-noslice/Doc/lib/libfunctools.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libfunctools.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libfunctools.tex	Fri Dec 15 05:21:50 2006
@@ -51,6 +51,19 @@
   \end{verbatim}
 \end{funcdesc}
 
+\begin{funcdesc}{reduce}{function, sequence\optional{, initializer}}
+  Apply \var{function} of two arguments cumulatively to the items of
+  \var{sequence}, from left to right, so as to reduce the sequence to
+  a single value.  For example, \code{reduce(lambda x, y: x+y, [1, 2,
+  3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}.  The left argument,
+  \var{x}, is the accumulated value and the right argument, \var{y},
+  is the update value from the \var{sequence}.  If the optional
+  \var{initializer} is present, it is placed before the items of the
+  sequence in the calculation, and serves as a default when the
+  sequence is empty.  If \var{initializer} is not given and
+  \var{sequence} contains only one item, the first item is returned.
+\end{funcdesc}
+
 \begin{funcdesc}{update_wrapper}
 {wrapper, wrapped\optional{, assigned}\optional{, updated}}
 Update a wrapper function to look like the wrapped function. The optional

Modified: python/branches/p3yk-noslice/Doc/lib/libgetopt.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libgetopt.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libgetopt.tex	Fri Dec 15 05:21:50 2006
@@ -126,8 +126,9 @@
 def main():
     try:
         opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
-    except getopt.GetoptError:
+    except getopt.GetoptError, err:
         # print help information and exit:
+        print str(err) # will print something like "option -a not recognized"
         usage()
         sys.exit(2)
     output = None
@@ -135,11 +136,13 @@
     for o, a in opts:
         if o == "-v":
             verbose = True
-        if o in ("-h", "--help"):
+        elif o in ("-h", "--help"):
             usage()
             sys.exit()
-        if o in ("-o", "--output"):
+        elif o in ("-o", "--output"):
             output = a
+        else:
+            assert False, "unhandled option"
     # ...
 
 if __name__ == "__main__":

Modified: python/branches/p3yk-noslice/Doc/lib/libhashlib.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libhashlib.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libhashlib.tex	Fri Dec 15 05:21:50 2006
@@ -86,8 +86,8 @@
 
 \begin{methoddesc}[hash]{digest}{}
 Return the digest of the strings passed to the \method{update()}
-method so far.  This is a 16-byte string which may contain
-non-\ASCII{} characters, including null bytes.
+method so far.  This is a string of \member{digest_size} bytes which may
+contain non-\ASCII{} characters, including null bytes.
 \end{methoddesc}
 
 \begin{methoddesc}[hash]{hexdigest}{}

Modified: python/branches/p3yk-noslice/Doc/lib/libheapq.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libheapq.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libheapq.tex	Fri Dec 15 05:21:50 2006
@@ -76,14 +76,14 @@
 >>> for item in data:
 ...     heappush(heap, item)
 ...
->>> sorted = []
+>>> ordered = []
 >>> while heap:
-...     sorted.append(heappop(heap))
+...     ordered.append(heappop(heap))
 ...
->>> print sorted
+>>> print ordered
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 >>> data.sort()
->>> print data == sorted
+>>> print data == ordered
 True
 >>>
 \end{verbatim}

Modified: python/branches/p3yk-noslice/Doc/lib/libhotshot.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libhotshot.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libhotshot.tex	Fri Dec 15 05:21:50 2006
@@ -61,7 +61,7 @@
 \end{methoddesc}
 
 \begin{methoddesc}{run}{cmd}
-Profile an \keyword{exec}-compatible string in the script environment.
+Profile an \function{exec()}-compatible string in the script environment.
 The globals from the \refmodule[main]{__main__} module are used as
 both the globals and locals for the script.
 \end{methoddesc}
@@ -76,7 +76,7 @@
 
 
 \begin{methoddesc}{runctx}{cmd, globals, locals}
-Evaluate an \keyword{exec}-compatible string in a specific environment.
+Profile an \function{exec()}-compatible string in a specific environment.
 The string is compiled before profiling begins.
 \end{methoddesc}
 

Modified: python/branches/p3yk-noslice/Doc/lib/libhttplib.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libhttplib.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libhttplib.tex	Fri Dec 15 05:21:50 2006
@@ -304,9 +304,14 @@
 This will send a request to the server using the HTTP request method
 \var{method} and the selector \var{url}.  If the \var{body} argument is
 present, it should be a string of data to send after the headers are finished.
+Alternatively, it may be an open file object, in which case the
+contents of the file is sent; this file object should support
+\code{fileno()} and \code{read()} methods.
 The header Content-Length is automatically set to the correct value.
 The \var{headers} argument should be a mapping of extra HTTP headers to send
 with the request.
+
+\versionchanged[\var{body} can be a file object]{2.6}
 \end{methoddesc}
 
 \begin{methoddesc}{getresponse}{}

Modified: python/branches/p3yk-noslice/Doc/lib/libimp.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libimp.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libimp.tex	Fri Dec 15 05:21:50 2006
@@ -161,10 +161,10 @@
 
 \begin{funcdesc}{init_builtin}{name}
 Initialize the built-in module called \var{name} and return its module
-object.  If the module was already initialized, it will be initialized
-\emph{again}.  A few modules cannot be initialized twice --- attempting
-to initialize these again will raise an \exception{ImportError}
-exception.  If there is no
+object along with storing it in \code{sys.modules}.  If the module was already
+initialized, it will be initialized \emph{again}.  Re-initialization involves
+the copying of the built-in module's \code{__dict__} from the cached
+module over the module's entry in \code{sys.modules}.  If there is no
 built-in module called \var{name}, \code{None} is returned.
 \end{funcdesc}
 
@@ -208,14 +208,15 @@
 \begin{funcdesc}{load_dynamic}{name, pathname\optional{, file}}
 Load and initialize a module implemented as a dynamically loadable
 shared library and return its module object.  If the module was
-already initialized, it will be initialized \emph{again}.  Some modules
-don't like that and may raise an exception.  The \var{pathname}
-argument must point to the shared library.  The \var{name} argument is
-used to construct the name of the initialization function: an external
-C function called \samp{init\var{name}()} in the shared library is
-called.  The optional \var{file} argument is ignored.  (Note: using
-shared libraries is highly system dependent, and not all systems
-support it.)
+already initialized, it will be initialized \emph{again}.
+Re-initialization involves copying the \code{__dict__} attribute of the cached
+instance of the module over the value used in the module cached in
+\code{sys.modules}.  The \var{pathname} argument must point to the shared
+library.  The \var{name} argument is used to construct the name of the
+initialization function: an external C function called
+\samp{init\var{name}()} in the shared library is called.  The optional
+\var{file} argument is ignored.  (Note: using shared libraries is highly
+system dependent, and not all systems support it.)
 \end{funcdesc}
 
 \begin{funcdesc}{load_source}{name, pathname\optional{, file}}

Modified: python/branches/p3yk-noslice/Doc/lib/libitertools.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libitertools.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libitertools.tex	Fri Dec 15 05:21:50 2006
@@ -474,8 +474,8 @@
     return izip(mapping.iterkeys(), mapping.itervalues())
 
 def nth(iterable, n):
-    "Returns the nth item"
-    return list(islice(iterable, n, n+1))
+    "Returns the nth item or raise IndexError"
+    return list(islice(iterable, n, n+1))[0]
 
 def all(seq, pred=None):
     "Returns True if pred(x) is true for every element in the iterable"

Modified: python/branches/p3yk-noslice/Doc/lib/liblogging.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/liblogging.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/liblogging.tex	Fri Dec 15 05:21:50 2006
@@ -528,8 +528,8 @@
 \method{filter()}.
 \end{methoddesc}
 
-\begin{methoddesc}{makeRecord}{name, lvl, fn, lno, msg, args, exc_info,
-                               func, extra}
+\begin{methoddesc}{makeRecord}{name, lvl, fn, lno, msg, args, exc_info
+                               \optional{, func, extra}}
 This is a factory method which can be overridden in subclasses to create
 specialized \class{LogRecord} instances.
 \versionchanged[\var{func} and \var{extra} were added]{2.5}
@@ -1397,6 +1397,9 @@
                         (if available).}
 \lineii{\%(created)f}  {Time when the \class{LogRecord} was created (as
                         returned by \function{time.time()}).}
+\lineii{\%(relativeCreated)d}  {Time in milliseconds when the LogRecord was
+                        created, relative to the time the logging module was
+                        loaded.}
 \lineii{\%(asctime)s}  {Human-readable time when the \class{LogRecord}
                         was created.  By default this is of the form
                         ``2003-07-08 16:49:45,896'' (the numbers after the
@@ -1479,7 +1482,7 @@
 information to be logged.
 
 \begin{classdesc}{LogRecord}{name, lvl, pathname, lineno, msg, args,
-                             exc_info}
+                             exc_info \optional{, func}}
 Returns an instance of \class{LogRecord} initialized with interesting
 information. The \var{name} is the logger name; \var{lvl} is the
 numeric level; \var{pathname} is the absolute pathname of the source
@@ -1489,7 +1492,9 @@
 which, together with \var{msg}, makes up the user message; and
 \var{exc_info} is the exception tuple obtained by calling
 \function{sys.exc_info() }(or \constant{None}, if no exception information
-is available).
+is available). The \var{func} is the name of the function from which the
+logging call was made. If not specified, it defaults to \var{None}.
+\versionchanged[\var{func} was added]{2.5}
 \end{classdesc}
 
 \begin{methoddesc}{getMessage}{}

Modified: python/branches/p3yk-noslice/Doc/lib/libmsilib.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libmsilib.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libmsilib.tex	Fri Dec 15 05:21:50 2006
@@ -344,8 +344,8 @@
 \subsection{Features\label{features}}
 
 \begin{classdesc}{Feature}{database, id, title, desc, display\optional{,
-    level=1\optional{, parent\optional\{, directory\optional{, 
-    attributes=0}}}}
+    level=1\optional{, parent\optional{, directory\optional{, 
+    attributes=0}}}}}
 
   Add a new record to the \code{Feature} table, using the values
   \var{id}, \var{parent.id}, \var{title}, \var{desc}, \var{display},

Modified: python/branches/p3yk-noslice/Doc/lib/liboperator.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/liboperator.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/liboperator.tex	Fri Dec 15 05:21:50 2006
@@ -55,7 +55,7 @@
 Return the outcome of \keyword{not} \var{o}.  (Note that there is no
 \method{__not__()} method for object instances; only the interpreter
 core defines this operation.  The result is affected by the
-\method{__nonzero__()} and \method{__len__()} methods.)
+\method{__bool__()} and \method{__len__()} methods.)
 \end{funcdesc}
 
 \begin{funcdesc}{truth}{o}

Modified: python/branches/p3yk-noslice/Doc/lib/libos.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libos.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libos.tex	Fri Dec 15 05:21:50 2006
@@ -361,6 +361,10 @@
 errors), \code{None} is returned.
 Availability: Macintosh, \UNIX, Windows.
 
+The \module{subprocess} module provides more powerful facilities for
+spawning new processes and retrieving their results; using that module
+is preferable to using this function.
+
 \versionchanged[This function worked unreliably under Windows in
   earlier versions of Python.  This was due to the use of the
   \cfunction{_popen()} function from the libraries provided with
@@ -375,8 +379,13 @@
 Availability: Macintosh, \UNIX, Windows.
 \end{funcdesc}
 
+There are a number of different \function{popen*()} functions that
+provide slightly different ways to create subprocesses.  Note that the
+\module{subprocess} module is easier to use and more powerful;
+consider using that module before writing code using the
+lower-level \function{popen*()} functions.
 
-For each of the following \function{popen()} variants, if \var{bufsize} is
+For each of the \function{popen*()} variants, if \var{bufsize} is
 specified, it specifies the buffer size for the I/O pipes.
 \var{mode}, if provided, should be the string \code{'b'} or
 \code{'t'}; on Windows this is needed to determine whether the file
@@ -920,6 +929,8 @@
 points.  The result may be either an absolute or relative pathname; if
 it is relative, it may be converted to an absolute pathname using
 \code{os.path.join(os.path.dirname(\var{path}), \var{result})}.
+\versionchanged [If the \var{path} is a Unicode object the result will also
+be a Unicode object]{2.6}
 Availability: Macintosh, \UNIX.
 \end{funcdesc}
 
@@ -1545,7 +1556,13 @@
 \funcline{spawnve}{mode, path, args, env}
 \funcline{spawnvp}{mode, file, args}
 \funcline{spawnvpe}{mode, file, args, env}
-Execute the program \var{path} in a new process.  If \var{mode} is
+Execute the program \var{path} in a new process.  
+
+(Note that the \module{subprocess} module provides more powerful
+facilities for spawning new processes and retrieving their results;
+using that module is preferable to using these functions.)
+
+If \var{mode} is
 \constant{P_NOWAIT}, this function returns the process ID of the new
 process; if \var{mode} is \constant{P_WAIT}, returns the process's
 exit code if it exits normally, or \code{-\var{signal}}, where
@@ -1682,6 +1699,10 @@
 a non-native shell, consult your shell documentation.
 
 Availability: Macintosh, \UNIX, Windows.
+
+The \module{subprocess} module provides more powerful facilities for
+spawning new processes and retrieving their results; using that module
+is preferable to using this function.
 \end{funcdesc}
 
 \begin{funcdesc}{times}{}

Modified: python/branches/p3yk-noslice/Doc/lib/libparser.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libparser.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libparser.tex	Fri Dec 15 05:21:50 2006
@@ -193,8 +193,9 @@
 
 \begin{funcdesc}{compileast}{ast\optional{, filename\code{ = '<ast>'}}}
 The Python byte compiler can be invoked on an AST object to produce
-code objects which can be used as part of an \keyword{exec} statement or
-a call to the built-in \function{eval()}\bifuncindex{eval} function.
+code objects which can be used as part of a call to the built-in
+\function{exec()}\bifuncindex{exec} or \function{eval()}
+\bifuncindex{eval} functions.
 This function provides the interface to the compiler, passing the
 internal parse tree from \var{ast} to the parser, using the
 source file name specified by the \var{filename} parameter.

Modified: python/branches/p3yk-noslice/Doc/lib/libpdb.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libpdb.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libpdb.tex	Fri Dec 15 05:21:50 2006
@@ -79,8 +79,8 @@
 explained below).  The optional \var{globals} and \var{locals}
 arguments specify the environment in which the code is executed; by
 default the dictionary of the module \refmodule[main]{__main__} is
-used.  (See the explanation of the \keyword{exec} statement or the
-\function{eval()} built-in function.)
+used.  (See the explanation of the built-in \function{exec()} or
+\function{eval()} functions.)
 \end{funcdesc}
 
 \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}}

Modified: python/branches/p3yk-noslice/Doc/lib/libpickle.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libpickle.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libpickle.tex	Fri Dec 15 05:21:50 2006
@@ -519,7 +519,7 @@
 version of the object.  The next element of the tuple will provide
 arguments for this callable, and later elements provide additional
 state information that will subsequently be used to fully reconstruct
-the pickled date.
+the pickled data.
 
 In the unpickling environment this object must be either a class, a
 callable registered as a ``safe constructor'' (see below), or it must

Modified: python/branches/p3yk-noslice/Doc/lib/libpopen2.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libpopen2.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libpopen2.tex	Fri Dec 15 05:21:50 2006
@@ -11,10 +11,10 @@
 input/output/error pipes and obtain their return codes under
 \UNIX{} and Windows.
 
-Note that starting with Python 2.0, this functionality is available
-using functions from the \refmodule{os} module which have the same
-names as the factory functions here, but the order of the return
-values is more intuitive in the \refmodule{os} module variants.
+The \module{subprocess} module provides more powerful facilities for
+spawning new processes and retrieving their results.  Using the
+\module{subprocess} module is preferable to using the \module{popen2}
+module.
 
 The primary interface offered by this module is a trio of factory
 functions.  For each of these, if \var{bufsize} is specified, 
@@ -184,3 +184,7 @@
 separate threads to read each of the individual files provided by
 whichever \function{popen*()} function or \class{Popen*} class was
 used.
+
+\begin{seealso}
+  \seemodule{subprocess}{Module for spawning and managing subprocesses.}
+\end{seealso}

Modified: python/branches/p3yk-noslice/Doc/lib/libprofile.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libprofile.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libprofile.tex	Fri Dec 15 05:21:50 2006
@@ -319,9 +319,9 @@
 
 \begin{funcdesc}{run}{command\optional{, filename}}
 
-This function takes a single argument that has can be passed to the
-\keyword{exec} statement, and an optional file name.  In all cases this
-routine attempts to \keyword{exec} its first argument, and gather profiling
+This function takes a single argument that can be passed to the
+\function{exec()} function, and an optional file name.  In all cases this
+routine attempts to \function{exec()} its first argument, and gather profiling
 statistics from the execution. If no file name is present, then this
 function automatically prints a simple profiling report, sorted by the
 standard name string (file/line/function-name) that is presented in

Modified: python/branches/p3yk-noslice/Doc/lib/libpyexpat.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libpyexpat.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libpyexpat.tex	Fri Dec 15 05:21:50 2006
@@ -216,9 +216,10 @@
 
 \begin{memberdesc}[xmlparser]{returns_unicode} 
 If this attribute is set to a non-zero integer, the handler functions
-will be passed Unicode strings.  If \member{returns_unicode} is 0,
-8-bit strings containing UTF-8 encoded data will be passed to the
-handlers.
+will be passed Unicode strings.  If \member{returns_unicode} is
+\constant{False}, 8-bit strings containing UTF-8 encoded data will be
+passed to the handlers.  This is \constant{True} by default when
+Python is built with Unicode support.
 \versionchanged[Can be changed at any time to affect the result
   type]{1.6}
 \end{memberdesc}

Modified: python/branches/p3yk-noslice/Doc/lib/librexec.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/librexec.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/librexec.tex	Fri Dec 15 05:21:50 2006
@@ -11,10 +11,10 @@
 \end{notice}
 
 This module contains the \class{RExec} class, which supports
-\method{r_eval()}, \method{r_execfile()}, \method{r_exec()}, and
+\method{r_exec()}, \method{r_eval()}, \method{r_execfile()}, and
 \method{r_import()} methods, which are restricted versions of the standard
-Python functions \method{eval()}, \method{execfile()} and
-the \keyword{exec} and \keyword{import} statements.
+Python functions \method{exec()}, \method{eval()}, \method{execfile()} and
+the \keyword{import} statement.
 Code executed in this restricted environment will
 only have access to modules and functions that are deemed safe; you
 can subclass \class{RExec} to add or remove capabilities as desired.

Modified: python/branches/p3yk-noslice/Doc/lib/libsmtplib.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsmtplib.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsmtplib.tex	Fri Dec 15 05:21:50 2006
@@ -28,6 +28,18 @@
 included below.
 \end{classdesc}
 
+\begin{classdesc}{SMTP_SSL}{\optional{host\optional{, port\optional{,
+                        local_hostname\optional{,
+                        keyfile\optional{,
+                        certfile}}}}}}
+A \class{SMTP_SSL} instance behaves exactly the same as instances of \class{SMTP}.
+\class{SMTP_SSL} should be used for situations where SSL is required from 
+the beginning of the connection and using \method{starttls()} is not appropriate.
+If \var{host} is not specified, the local host is used. If \var{port} is
+omitted, the standard SMTP-over-SSL port (465) is used. \var{keyfile} and \var{certfile}
+are also optional, and can contain a PEM formatted private key and
+certificate chain file for the SSL connection.
+\end{classdesc}
 
 A nice selection of exceptions is defined as well:
 

Modified: python/branches/p3yk-noslice/Doc/lib/libsocket.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsocket.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsocket.tex	Fri Dec 15 05:21:50 2006
@@ -241,8 +241,8 @@
 This operation assumes that there is a valid address-to-host mapping for
 the host, and the assumption does not always hold.
 Note: \function{gethostname()} doesn't always return the fully qualified
-domain name; use \code{gethostbyaddr(gethostname())}
-(see below).
+domain name; use \code{getfqdn()}
+(see above).
 \end{funcdesc}
 
 \begin{funcdesc}{gethostbyaddr}{ip_address}
@@ -712,14 +712,15 @@
 \end{methoddesc}
 
 \begin{methoddesc}{server}{}
-Returns a string containing the ASN.1 distinguished name identifying the 
-server's certificate.  (See below for an example
-showing what distinguished names look like.)
+Returns a string describing the server's certificate.
+Useful for debugging purposes; do not parse the content of this string
+because its format can't be parsed unambiguously.
 \end{methoddesc}
 
 \begin{methoddesc}{issuer}{}
-Returns a string containing the ASN.1 distinguished name identifying the
-issuer of the server's certificate.
+Returns a string describing the issuer of the server's certificate.
+Useful for debugging purposes; do not parse the content of this string
+because its format can't be parsed unambiguously.
 \end{methoddesc}
 
 \subsection{Example \label{socket-example}}

Modified: python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex	Fri Dec 15 05:21:50 2006
@@ -6,14 +6,16 @@
 \sectionauthor{Gerhard Häring}{gh at ghaering.de}
 \versionadded{2.5}
 
-SQLite is a C library that provides a SQL-language database that
-stores data in disk files without requiring a separate server process.
+SQLite is a C library that provides a lightweight disk-based database
+that doesn't require a separate server process and allows accessing
+the database using a nonstandard variant of the SQL query language.
+Some applications can use SQLite for internal data storage.  It's also
+possible to prototype an application using SQLite and then port the
+code to a larger database such as PostgreSQL or Oracle.
+ 
 pysqlite was written by Gerhard H\"aring and provides a SQL interface
 compliant with the DB-API 2.0 specification described by
-\pep{249}. This means that it should be possible to write the first
-version of your applications using SQLite for data storage.  If
-switching to a larger database such as PostgreSQL or Oracle is
-later necessary, the switch should be relatively easy.
+\pep{249}. 
 
 To use the module, you must first create a \class{Connection} object
 that represents the database.  Here the data will be stored in the 
@@ -34,8 +36,8 @@
 
 # Create table
 c.execute('''create table stocks
-(date timestamp, trans varchar, symbol varchar,
- qty decimal, price decimal)''')
+(date text, trans text, symbol text,
+ qty real, price real)''')
 
 # Insert a row of data
 c.execute("""insert into stocks
@@ -144,11 +146,11 @@
 wait for the lock to go away until raising an exception. The default for the
 timeout parameter is 5.0 (five seconds). 
 
-For the \var{isolation_level} parameter, please see \member{isolation_level}
-\ref{sqlite3-Connection-IsolationLevel} property of \class{Connection} objects.
+For the \var{isolation_level} parameter, please see the \member{isolation_level}
+property of \class{Connection} objects in section~\ref{sqlite3-Connection-IsolationLevel}.
 
 SQLite natively supports only the types TEXT, INTEGER, FLOAT, BLOB and NULL. If
-you want to use other types, like you have to add support for them yourself.
+you want to use other types you must add support for them yourself.
 The \var{detect_types} parameter and the using custom \strong{converters} registered with
 the module-level \function{register_converter} function allow you to easily do that.
 
@@ -195,7 +197,7 @@
     \verbatiminput{sqlite3/complete_statement.py}
 \end{funcdesc}
 
-\begin{funcdesc}{}enable_callback_tracebacks{flag}
+\begin{funcdesc}{enable_callback_tracebacks}{flag}
 By default you will not get any tracebacks in user-defined functions,
 aggregates, converters, authorizer callbacks etc. If you want to debug them,
 you can call this function with \var{flag} as True. Afterwards, you will get
@@ -210,13 +212,14 @@
 \label{sqlite3-Connection-IsolationLevel}
 \begin{memberdesc}{isolation_level}
   Get or set the current isolation level. None for autocommit mode or one of
-  "DEFERRED", "IMMEDIATE" or "EXLUSIVE". See  Controlling Transactions
-  \ref{sqlite3-Controlling-Transactions} for a more detailed explanation.
+  "DEFERRED", "IMMEDIATE" or "EXLUSIVE". See ``Controlling Transactions'', 
+  section~\ref{sqlite3-Controlling-Transactions}, for a more detailed explanation.
 \end{memberdesc}
 
 \begin{methoddesc}{cursor}{\optional{cursorClass}}
   The cursor method accepts a single optional parameter \var{cursorClass}.
-  This is a custom cursor class which must extend \class{sqlite3.Cursor}.
+  If supplied, this must be a custom cursor class that extends 
+  \class{sqlite3.Cursor}.
 \end{methoddesc}
 
 \begin{methoddesc}{execute}{sql, \optional{parameters}}
@@ -242,7 +245,7 @@
 Creates a user-defined function that you can later use from within SQL
 statements under the function name \var{name}. \var{num_params} is the number
 of parameters the function accepts, and \var{func} is a Python callable that is
-called as SQL function.
+called as the SQL function.
 
 The function can return any of the types supported by SQLite: unicode, str,
 int, long, float, buffer and None.
@@ -272,7 +275,7 @@
 
 Creates a collation with the specified \var{name} and \var{callable}. The
 callable will be passed two string arguments. It should return -1 if the first
-is ordered lower than the second, 0 if they are ordered equal and 1 and if the
+is ordered lower than the second, 0 if they are ordered equal and 1 if the
 first is ordered higher than the second.  Note that this controls sorting
 (ORDER BY in SQL) so your comparisons don't affect other SQL operations.
 
@@ -321,20 +324,21 @@
 
 \begin{memberdesc}{row_factory}
   You can change this attribute to a callable that accepts the cursor and
-  the original row as tuple and will return the real result row.  This
-  way, you can implement more advanced ways of returning results, like
-  ones that can also access columns by name.
+  the original row as a tuple and will return the real result row.  This
+  way, you can implement more advanced ways of returning results, such 
+  as returning an object that can also access columns by name.
 
   Example:
 
   \verbatiminput{sqlite3/row_factory.py}
 
-  If the standard tuple types don't suffice for you, and you want name-based
+  If returning a tuple doesn't suffice and you want name-based
   access to columns, you should consider setting \member{row_factory} to the
-  highly-optimized sqlite3.Row type. It provides both
+  highly-optimized \class{sqlite3.Row} type. \class{Row} provides both
   index-based and case-insensitive name-based access to columns with almost
-  no memory overhead. Much better than your own custom dictionary-based
-  approach or even a db_row based solution.
+  no memory overhead. It will probably be better than your own custom 
+  dictionary-based approach or even a db_row based solution.
+  % XXX what's a db_row-based solution?
 \end{memberdesc}
 
 \begin{memberdesc}{text_factory}
@@ -348,7 +352,7 @@
   attribute to \constant{sqlite3.OptimizedUnicode}.
 
   You can also set it to any other callable that accepts a single bytestring
-  parameter and returns the result object.
+  parameter and returns the resulting object.
 
   See the following example code for illustration:
 
@@ -356,7 +360,7 @@
 \end{memberdesc}
 
 \begin{memberdesc}{total_changes}
-  Returns the total number of database rows that have be modified, inserted,
+  Returns the total number of database rows that have been modified, inserted,
   or deleted since the database connection was opened.
 \end{memberdesc}
 
@@ -383,9 +387,9 @@
 
     \verbatiminput{sqlite3/execute_2.py}
 
-    \method{execute} will only execute a single SQL statement. If you try to
+    \method{execute()} will only execute a single SQL statement. If you try to
     execute more than one statement with it, it will raise a Warning. Use
-    \method{executescript} if want to execute multiple SQL statements with one
+    \method{executescript()} if you want to execute multiple SQL statements with one
     call.
 \end{methoddesc}
 
@@ -393,7 +397,7 @@
 \begin{methoddesc}{executemany}{sql, seq_of_parameters}
 Executes a SQL command against all parameter sequences or mappings found in the
 sequence \var{sql}. The \module{sqlite3} module also allows
-to use an iterator yielding parameters instead of a sequence.
+using an iterator yielding parameters instead of a sequence.
 
 \verbatiminput{sqlite3/executemany_1.py}
 
@@ -405,7 +409,7 @@
 \begin{methoddesc}{executescript}{sql_script}
 
 This is a nonstandard convenience method for executing multiple SQL statements
-at once. It issues a COMMIT statement before, then executes the SQL script it
+at once. It issues a COMMIT statement first, then executes the SQL script it
 gets as a parameter.
 
 \var{sql_script} can be a bytestring or a Unicode string.
@@ -462,20 +466,19 @@
 \lineii{BLOB}{buffer}
 \end{tableii}
 
-The type system of the \module{sqlite3} module is extensible in both ways: you can store
+The type system of the \module{sqlite3} module is extensible in two ways: you can store
 additional Python types in a SQLite database via object adaptation, and you can
 let the \module{sqlite3} module convert SQLite types to different Python types via
 converters.
 
 \subsubsection{Using adapters to store additional Python types in SQLite databases}
 
-Like described before, SQLite supports only a limited set of types natively. To
+As described before, SQLite supports only a limited set of types natively. To
 use other Python types with SQLite, you must \strong{adapt} them to one of the sqlite3
-module's supported types for SQLite. So, one of NoneType, int, long, float,
+module's supported types for SQLite: one of NoneType, int, long, float,
 str, unicode, buffer.
 
-The \module{sqlite3} module uses the Python object adaptation, like described in PEP 246
-for this.  The protocol to use is \class{PrepareProtocol}.
+The \module{sqlite3} module uses Python object adaptation, as described in \pep{246} for this.  The protocol to use is \class{PrepareProtocol}.
 
 There are two ways to enable the \module{sqlite3} module to adapt a custom Python type
 to one of the supported ones.
@@ -491,8 +494,8 @@
         self.x, self.y = x, y
 \end{verbatim}
 
-Now you want to store the point in a single SQLite column. You'll have to
-choose one of the supported types first that you use to represent the point in.
+Now you want to store the point in a single SQLite column.  First you'll have to
+choose one of the supported types first to be used for representing the point.
 Let's just use str and separate the coordinates using a semicolon. Then you
 need to give your class a method \code{__conform__(self, protocol)} which must
 return the converted value. The parameter \var{protocol} will be
@@ -505,13 +508,13 @@
 The other possibility is to create a function that converts the type to the
 string representation and register the function with \method{register_adapter}.
 
-    \verbatiminput{sqlite3/adapter_point_2.py}
-
 \begin{notice}
 The type/class to adapt must be a new-style class, i. e. it must have
 \class{object} as one of its bases.
 \end{notice}
 
+    \verbatiminput{sqlite3/adapter_point_2.py}
+
 The \module{sqlite3} module has two default adapters for Python's built-in
 \class{datetime.date} and \class{datetime.datetime} types.  Now let's suppose
 we want to store \class{datetime.datetime} objects not in ISO representation,
@@ -521,16 +524,17 @@
 
 \subsubsection{Converting SQLite values to custom Python types}
 
-Now that's all nice and dandy that you can send custom Python types to SQLite.
+Writing an adapter lets you send custom Python types to SQLite.
 But to make it really useful we need to make the Python to SQLite to Python
-roundtrip work.
+roundtrip work.  
 
 Enter converters.
 
-Let's go back to the Point class. We stored the x and y coordinates separated
-via semicolons as strings in SQLite.
+Let's go back to the \class{Point} class. We stored the x and y
+coordinates separated via semicolons as strings in SQLite.
 
-Let's first define a converter function that accepts the string as a parameter and constructs a Point object from it.
+First, we'll define a converter function that accepts the string as a
+parameter and constructs a \class{Point} object from it.
 
 \begin{notice}
 Converter functions \strong{always} get called with a string, no matter
@@ -556,11 +560,12 @@
  \item Explicitly via the column name
 \end{itemize}
 
-Both ways are described at \ref{sqlite3-Module-Contents} in the text explaining
-the constants \constant{PARSE_DECLTYPES} and \constant{PARSE_COlNAMES}.
+Both ways are described in ``Module Constants'', section~\ref{sqlite3-Module-Contents}, in
+the entries for the constants \constant{PARSE_DECLTYPES} and
+\constant{PARSE_COLNAMES}.
 
 
-The following example illustrates both ways.
+The following example illustrates both approaches.
 
     \verbatiminput{sqlite3/converter_point.py}
 
@@ -569,8 +574,8 @@
 There are default adapters for the date and datetime types in the datetime
 module. They will be sent as ISO dates/ISO timestamps to SQLite.
 
-The default converters are registered under the name "date" for datetime.date
-and under the name "timestamp" for datetime.datetime.
+The default converters are registered under the name "date" for \class{datetime.date}
+and under the name "timestamp" for \class{datetime.datetime}.
 
 This way, you can use date/timestamps from Python without any additional
 fiddling in most cases. The format of the adapters is also compatible with the
@@ -582,12 +587,12 @@
 
 \subsection{Controlling Transactions \label{sqlite3-Controlling-Transactions}}
 
-By default, the \module{sqlite3} module opens transactions implicitly before a DML
-statement (INSERT/UPDATE/DELETE/REPLACE), and commits transactions implicitly
-before a non-DML, non-DQL statement (i. e. anything other than
+By default, the \module{sqlite3} module opens transactions implicitly before a Data Modification Language (DML) 
+statement (i.e. INSERT/UPDATE/DELETE/REPLACE), and commits transactions implicitly
+before a non-DML, non-query statement (i. e. anything other than
 SELECT/INSERT/UPDATE/DELETE/REPLACE).
 
-So if you are within a transaction, and issue a command like \code{CREATE TABLE
+So if you are within a transaction and issue a command like \code{CREATE TABLE
 ...}, \code{VACUUM}, \code{PRAGMA}, the \module{sqlite3} module will commit implicitly
 before executing that command. There are two reasons for doing that. The first
 is that some of these commands don't work within transactions. The other reason
@@ -616,17 +621,17 @@
 
 Using the nonstandard \method{execute}, \method{executemany} and
 \method{executescript} methods of the \class{Connection} object, your code can
-be written more concisely, because you don't have to create the - often
-superfluous \class{Cursor} objects explicitly. Instead, the \class{Cursor}
+be written more concisely because you don't have to create the (often
+superfluous) \class{Cursor} objects explicitly. Instead, the \class{Cursor}
 objects are created implicitly and these shortcut methods return the cursor
-objects. This way, you can for example execute a SELECT statement and iterate
+objects. This way, you can execute a SELECT statement and iterate
 over it directly using only a single call on the \class{Connection} object.
 
     \verbatiminput{sqlite3/shortcut_methods.py}
 
 \subsubsection{Accessing columns by name instead of by index}
 
-One cool feature of the \module{sqlite3} module is the builtin \class{sqlite3.Row} class
+One useful feature of the \module{sqlite3} module is the builtin \class{sqlite3.Row} class
 designed to be used as a row factory.
 
 Rows wrapped with this class can be accessed both by index (like tuples) and

Modified: python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex	Fri Dec 15 05:21:50 2006
@@ -51,7 +51,7 @@
 \item	any empty mapping, for example, \code{\{\}}.
 
 \item	instances of user-defined classes, if the class defines a
-        \method{__nonzero__()} or \method{__len__()} method, when that
+        \method{__bool__()} or \method{__len__()} method, when that
         method returns the integer zero or \class{bool} value
         \code{False}.\footnote{Additional 
 information on these special methods may be found in the
@@ -126,8 +126,7 @@
   \lineiii{>}{strictly greater than}{}
   \lineiii{>=}{greater than or equal}{}
   \lineiii{==}{equal}{}
-  \lineiii{!=}{not equal}{(1)}
-  \lineiii{<>}{not equal}{(1)}
+  \lineiii{!=}{not equal}{}
   \lineiii{is}{object identity}{}
   \lineiii{is not}{negated object identity}{}
 \end{tableiii}
@@ -136,17 +135,6 @@
 \opindex{is}
 \opindex{is not}
 
-\noindent
-Notes:
-
-\begin{description}
-
-\item[(1)]
-\code{<>} and \code{!=} are alternate spellings for the same operator.
-\code{!=} is the preferred spelling; \code{<>} is obsolescent.
-
-\end{description}
-
 Objects of different types, except different numeric types and different string types, never
 compare equal; such objects are ordered consistently but arbitrarily
 (so that sorting a heterogeneous array yields a consistent result).
@@ -771,8 +759,8 @@
 Split the string at the last occurrence of \var{sep}, and return
 a 3-tuple containing the part before the separator, the separator
 itself, and the part after the separator.  If the separator is not
-found, return a 3-tuple containing the string itself, followed by
-two empty strings.
+found, return a 3-tuple containing two empty strings, followed by
+the string itself.
 \versionadded{2.5}
 \end{methoddesc}
 
@@ -834,7 +822,7 @@
                                        start\optional{, end}}}
 Return \code{True} if string starts with the \var{prefix}, otherwise
 return \code{False}.  \var{prefix} can also be a tuple of
-suffixes to look for.  With optional \var{start}, test string beginning at
+prefixes to look for.  With optional \var{start}, test string beginning at
 that position.  With optional \var{end}, stop comparing string at that
 position.
 
@@ -876,6 +864,9 @@
 characters have been mapped through the given translation table, which
 must be a string of length 256.
 
+You can use the \function{maketrans()} helper function in the
+\refmodule{string} module to create a translation table.
+
 For Unicode objects, the \method{translate()} method does not
 accept the optional \var{deletechars} argument.  Instead, it
 returns a copy of the \var{s} where all characters have been mapped
@@ -1410,21 +1401,22 @@
           {(1)}
   \lineiii{\var{a}.clear()}{remove all items from \code{a}}{}
   \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{}
-  \lineiii{\var{a}.has_key(\var{k})}
+  \lineiii{\var{k} in \var{a}}
           {\code{True} if \var{a} has a key \var{k}, else \code{False}}
-          {}
-  \lineiii{\var{k} \code{in} \var{a}}
-          {Equivalent to \var{a}.has_key(\var{k})}
           {(2)}
   \lineiii{\var{k} not in \var{a}}
-          {Equivalent to \code{not} \var{a}.has_key(\var{k})}
+          {Equivalent to \code{not} \var{k} in \var{a}}
           {(2)}
+  \lineiii{\var{a}.has_key(\var{k})}
+          {Equivalent to \var{k} \code{in} \var{a}, use that form in new code}
+          {}
   \lineiii{\var{a}.items()}
           {a copy of \var{a}'s list of (\var{key}, \var{value}) pairs}
           {(3)}
   \lineiii{\var{a}.keys()}{a copy of \var{a}'s list of keys}{(3)}
   \lineiii{\var{a}.update(\optional{\var{b}})}
-          {updates (and overwrites) key/value pairs from \var{b}}
+          {updates \var{a} with key/value pairs from \var{b}, overwriting
+	   existing keys, returns \code{None}}
           {(9)}
   \lineiii{\var{a}.fromkeys(\var{seq}\optional{, \var{value}})}
           {Creates a new dictionary with keys from \var{seq} and values set to \var{value}}
@@ -1682,6 +1674,7 @@
   behavior.
 
   Note that not all file objects are seekable.
+  \versionchanged{Passing float values as offset has been deprecated}[2.6]
 \end{methoddesc}
 
 \begin{methoddesc}[file]{tell}{}
@@ -1984,9 +1977,9 @@
 \withsubitem{(function object attribute)}{\ttindex{func_code}}
 
 A code object can be executed or evaluated by passing it (instead of a
-source string) to the \keyword{exec} statement or the built-in
-\function{eval()} function.
-\stindex{exec}
+source string) to the \function{exec()} or \function{eval()} 
+built-in functions.
+\bifuncindex{exec}
 \bifuncindex{eval}
 
 See the \citetitle[../ref/ref.html]{Python Reference Manual} for more
@@ -2016,12 +2009,12 @@
 
 \subsection{The Ellipsis Object \label{bltin-ellipsis-object}}
 
-This object is used by extended slice notation (see the
+This object is mostly used by extended slice notation (see the
 \citetitle[../ref/ref.html]{Python Reference Manual}).  It supports no
 special operations.  There is exactly one ellipsis object, named
 \constant{Ellipsis} (a built-in name).
 
-It is written as \code{Ellipsis}.
+It is written as \code{Ellipsis} or \code{...}.
 
 \subsection{Boolean Values}
 

Modified: python/branches/p3yk-noslice/Doc/lib/libstdwin.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libstdwin.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libstdwin.tex	Fri Dec 15 05:21:50 2006
@@ -123,8 +123,8 @@
 Hint: the following code tests whether you are on a machine that
 supports more than two colors:
 \begin{verbatim}
-if stdwin.fetchcolor('black') <> \
-          stdwin.fetchcolor('red') <> \
+if stdwin.fetchcolor('black') != \
+          stdwin.fetchcolor('red') != \
           stdwin.fetchcolor('white'):
     print 'color machine'
 else:

Modified: python/branches/p3yk-noslice/Doc/lib/libstring.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libstring.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libstring.tex	Fri Dec 15 05:21:50 2006
@@ -220,7 +220,7 @@
 
 \begin{funcdesc}{maketrans}{from, to}
   Return a translation table suitable for passing to
-  \function{translate()} or \function{regex.compile()}, that will map
+  \function{translate()}, that will map
   each character in \var{from} into the character at the same position
   in \var{to}; \var{from} and \var{to} must have the same length.
 

Modified: python/branches/p3yk-noslice/Doc/lib/libsubprocess.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsubprocess.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsubprocess.tex	Fri Dec 15 05:21:50 2006
@@ -12,9 +12,6 @@
 codes.  This module intends to replace several other, older modules
 and functions, such as:
 
-% XXX Should add pointers to this module to at least the popen2
-% and commands sections.
-
 \begin{verbatim}
 os.system
 os.spawn*

Modified: python/branches/p3yk-noslice/Doc/lib/libtempfile.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libtempfile.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libtempfile.tex	Fri Dec 15 05:21:50 2006
@@ -86,7 +86,12 @@
 prefix; otherwise, a default prefix is used.
 
 If \var{dir} is specified, the file will be created in that directory;
-otherwise, a default directory is used.
+otherwise, a default directory is used.  The default directory is chosen
+from a platform-dependent list, but the user of the application can control
+the directory location by setting the \var{TMPDIR}, \var{TEMP} or \var{TMP}
+environment variables.  There is thus no guarantee that the generated
+filename will have any nice properties, such as not requiring quoting when
+passed to external commands via \code{os.popen()}.
 
 If \var{text} is specified, it indicates whether to open the file in
 binary mode (the default) or text mode.  On some platforms, this makes

Modified: python/branches/p3yk-noslice/Doc/lib/libtimeit.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libtimeit.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libtimeit.tex	Fri Dec 15 05:21:50 2006
@@ -162,13 +162,13 @@
 missing and present object attributes.
 
 \begin{verbatim}
-% timeit.py 'try:' '  str.__nonzero__' 'except AttributeError:' '  pass'
+% timeit.py 'try:' '  str.__bool__' 'except AttributeError:' '  pass'
 100000 loops, best of 3: 15.7 usec per loop
-% timeit.py 'if hasattr(str, "__nonzero__"): pass'
+% timeit.py 'if hasattr(str, "__bool__"): pass'
 100000 loops, best of 3: 4.26 usec per loop
-% timeit.py 'try:' '  int.__nonzero__' 'except AttributeError:' '  pass'
+% timeit.py 'try:' '  int.__bool__' 'except AttributeError:' '  pass'
 1000000 loops, best of 3: 1.43 usec per loop
-% timeit.py 'if hasattr(int, "__nonzero__"): pass'
+% timeit.py 'if hasattr(int, "__bool__"): pass'
 100000 loops, best of 3: 2.23 usec per loop
 \end{verbatim}
 
@@ -176,7 +176,7 @@
 >>> import timeit
 >>> s = """\
 ... try:
-...     str.__nonzero__
+...     str.__bool__
 ... except AttributeError:
 ...     pass
 ... """
@@ -184,14 +184,14 @@
 >>> print "%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)
 17.09 usec/pass
 >>> s = """\
-... if hasattr(str, '__nonzero__'): pass
+... if hasattr(str, '__bool__'): pass
 ... """
 >>> t = timeit.Timer(stmt=s)
 >>> print "%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)
 4.85 usec/pass
 >>> s = """\
 ... try:
-...     int.__nonzero__
+...     int.__bool__
 ... except AttributeError:
 ...     pass
 ... """
@@ -199,7 +199,7 @@
 >>> print "%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)
 1.97 usec/pass
 >>> s = """\
-... if hasattr(int, '__nonzero__'): pass
+... if hasattr(int, '__bool__'): pass
 ... """
 >>> t = timeit.Timer(stmt=s)
 >>> print "%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)

Modified: python/branches/p3yk-noslice/Doc/lib/libtraceback.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libtraceback.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libtraceback.tex	Fri Dec 15 05:21:50 2006
@@ -139,7 +139,7 @@
 def run_user_code(envdir):
     source = raw_input(">>> ")
     try:
-        exec source in envdir
+        exec(source, envdir)
     except:
         print "Exception in user code:"
         print '-'*60

Modified: python/branches/p3yk-noslice/Doc/lib/libunittest.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libunittest.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libunittest.tex	Fri Dec 15 05:21:50 2006
@@ -212,8 +212,8 @@
 
 class DefaultWidgetSizeTestCase(unittest.TestCase):
     def runTest(self):
-        widget = Widget("The widget")
-        self.failUnless(widget.size() == (50,50), 'incorrect default size')
+        widget = Widget('The widget')
+        self.assertEqual(widget.size(), (50, 50), 'incorrect default size')
 \end{verbatim}
 
 Note that in order to test something, we use the one of the
@@ -247,7 +247,7 @@
 
 class SimpleWidgetTestCase(unittest.TestCase):
     def setUp(self):
-        self.widget = Widget("The widget")
+        self.widget = Widget('The widget')
 
 class DefaultWidgetSizeTestCase(SimpleWidgetTestCase):
     def runTest(self):
@@ -273,7 +273,7 @@
 
 class SimpleWidgetTestCase(unittest.TestCase):
     def setUp(self):
-        self.widget = Widget("The widget")
+        self.widget = Widget('The widget')
 
     def tearDown(self):
         self.widget.dispose()
@@ -298,7 +298,7 @@
 
 class WidgetTestCase(unittest.TestCase):
     def setUp(self):
-        self.widget = Widget("The widget")
+        self.widget = Widget('The widget')
 
     def tearDown(self):
         self.widget.dispose()
@@ -322,8 +322,8 @@
 passing the method name in the constructor:
 
 \begin{verbatim}
-defaultSizeTestCase = WidgetTestCase("testDefaultSize")
-resizeTestCase = WidgetTestCase("testResize")
+defaultSizeTestCase = WidgetTestCase('testDefaultSize')
+resizeTestCase = WidgetTestCase('testResize')
 \end{verbatim}
 
 Test case instances are grouped together according to the features
@@ -333,8 +333,8 @@
 
 \begin{verbatim}
 widgetTestSuite = unittest.TestSuite()
-widgetTestSuite.addTest(WidgetTestCase("testDefaultSize"))
-widgetTestSuite.addTest(WidgetTestCase("testResize"))
+widgetTestSuite.addTest(WidgetTestCase('testDefaultSize'))
+widgetTestSuite.addTest(WidgetTestCase('testResize'))
 \end{verbatim}
 
 For the ease of running tests, as we will see later, it is a good
@@ -344,8 +344,8 @@
 \begin{verbatim}
 def suite():
     suite = unittest.TestSuite()
-    suite.addTest(WidgetTestCase("testDefaultSize"))
-    suite.addTest(WidgetTestCase("testResize"))
+    suite.addTest(WidgetTestCase('testDefaultSize'))
+    suite.addTest(WidgetTestCase('testResize'))
     return suite
 \end{verbatim}
 
@@ -353,7 +353,7 @@
 
 \begin{verbatim}
 def suite():
-    tests = ["testDefaultSize", "testResize"]
+    tests = ['testDefaultSize', 'testResize']
 
     return unittest.TestSuite(map(WidgetTestCase, tests))
 \end{verbatim}
@@ -462,7 +462,7 @@
 \subsection{Classes and functions
             \label{unittest-contents}}
 
-\begin{classdesc}{TestCase}{}
+\begin{classdesc}{TestCase}{\optional{methodName}}
   Instances of the \class{TestCase} class represent the smallest
   testable units in the \module{unittest} universe.  This class is
   intended to be used as a base class, with specific tests being
@@ -470,6 +470,23 @@
   interface needed by the test runner to allow it to drive the
   test, and methods that the test code can use to check for and
   report various kinds of failure.
+  
+  Each instance of \class{TestCase} will run a single test method:
+  the method named \var{methodName}.  If you remember, we had an
+  earlier example that went something like this:
+  
+  \begin{verbatim}
+  def suite():
+      suite = unittest.TestSuite()
+      suite.addTest(WidgetTestCase('testDefaultSize'))
+      suite.addTest(WidgetTestCase('testResize'))
+      return suite
+  \end{verbatim}
+  
+  Here, we create two instances of \class{WidgetTestCase}, each of
+  which runs a single test.
+  
+  \var{methodName} defaults to \code{'runTest'}.
 \end{classdesc}
 
 \begin{classdesc}{FunctionTestCase}{testFunc\optional{,
@@ -502,6 +519,11 @@
   subclass.
 \end{classdesc}
 
+\begin{classdesc}{TestResult}{}
+  This class is used to compile information about which tests have succeeded
+  and which have failed.
+\end{classdesc}
+
 \begin{datadesc}{defaultTestLoader}
   Instance of the \class{TestLoader} class intended to be shared.  If no
   customization of the \class{TestLoader} is needed, this instance can
@@ -574,8 +596,9 @@
 \begin{methoddesc}[TestCase]{run}{\optional{result}}
   Run the test, collecting the result into the test result object
   passed as \var{result}.  If \var{result} is omitted or \constant{None},
-  a temporary result object is created and used, but is not made
-  available to the caller.
+  a temporary result object is created (by calling the
+  \method{defaultTestCase()} method) and used; this result object is not
+  returned to \method{run()}'s caller.
   
   The same effect may be had by simply calling the \class{TestCase}
   instance.
@@ -684,8 +707,13 @@
 \end{methoddesc}
 
 \begin{methoddesc}[TestCase]{defaultTestResult}{}
-  Return the default type of test result object to be used to run this
-  test.
+  Return an instance of the test result class that should be used
+  for this test case class (if no other result instance is provided
+  to the \method{run()} method).
+  
+  For \class{TestCase} instances, this will always be an instance of
+  \class{TestResult};  subclasses of \class{TestCase} should
+  override this as necessary.
 \end{methoddesc}
 
 \begin{methoddesc}[TestCase]{id}{}
@@ -761,26 +789,20 @@
 tests for reporting purposes; a \class{TestResult} instance is
 returned by the \method{TestRunner.run()} method for this purpose.
 
-Each instance holds the total number of tests run, and collections of
-failures and errors that occurred among those test runs.  The
-collections contain tuples of \code{(\var{testcase},
-\var{traceback})}, where \var{traceback} is a string containing a
-formatted version of the traceback for the exception.
-
 \class{TestResult} instances have the following attributes that will
 be of interest when inspecting the results of running a set of tests:
 
 \begin{memberdesc}[TestResult]{errors}
   A list containing 2-tuples of \class{TestCase} instances and
-  formatted tracebacks. Each tuple represents a test which raised an
-  unexpected exception.
+  strings holding formatted tracebacks. Each tuple represents a test which
+  raised an unexpected exception.
   \versionchanged[Contains formatted tracebacks instead of
                   \function{sys.exc_info()} results]{2.2}
 \end{memberdesc}
 
 \begin{memberdesc}[TestResult]{failures}
-  A list containing 2-tuples of \class{TestCase} instances and
-  formatted tracebacks. Each tuple represents a test where a failure
+  A list containing 2-tuples of \class{TestCase} instances and strings
+  holding formatted tracebacks. Each tuple represents a test where a failure
   was explicitly signalled using the \method{TestCase.fail*()} or
   \method{TestCase.assert*()} methods.
   \versionchanged[Contains formatted tracebacks instead of
@@ -817,17 +839,25 @@
 
 \begin{methoddesc}[TestResult]{startTest}{test}
   Called when the test case \var{test} is about to be run.
+  
+  The default implementation simply increments the instance's
+  \code{testsRun} counter.
 \end{methoddesc}
 
 \begin{methoddesc}[TestResult]{stopTest}{test}
-  Called when the test case \var{test} has been executed, regardless
+  Called after the test case \var{test} has been executed, regardless
   of the outcome.
+  
+  The default implementation does nothing.
 \end{methoddesc}
 
 \begin{methoddesc}[TestResult]{addError}{test, err}
   Called when the test case \var{test} raises an unexpected exception
   \var{err} is a tuple of the form returned by \function{sys.exc_info()}:
   \code{(\var{type}, \var{value}, \var{traceback})}.
+  
+  The default implementation appends \code{(\var{test}, \var{err})} to
+  the instance's \code{errors} attribute.
 \end{methoddesc}
 
 \begin{methoddesc}[TestResult]{addFailure}{test, err}
@@ -835,10 +865,15 @@
   \var{err} is a tuple of the form returned by
   \function{sys.exc_info()}:  \code{(\var{type}, \var{value},
   \var{traceback})}.
+  
+  The default implementation appends \code{(\var{test}, \var{err})} to
+  the instance's \code{failures} attribute.
 \end{methoddesc}
 
 \begin{methoddesc}[TestResult]{addSuccess}{test}
   Called when the test case \var{test} succeeds.
+  
+  The default implementation does nothing.
 \end{methoddesc}
 
 
@@ -878,9 +913,12 @@
   Return a suite of all tests cases given a string specifier.
 
   The specifier \var{name} is a ``dotted name'' that may resolve
-  either to a module, a test case class, a \class{TestSuite} instance,
-  a test method within a test case class, or a callable object which
-  returns a \class{TestCase} or \class{TestSuite} instance.
+  either to a module, a test case class, a test method within a test
+  case class, a \class{TestSuite} instance, or a callable object which
+  returns a \class{TestCase} or \class{TestSuite} instance.  These checks
+  are applied in the order listed here; that is, a method on a possible
+  test case class will be picked up as ``a test method within a test
+  case class'', rather than ``a callable object''.
 
   For example, if you have a module \module{SampleTests} containing a
   \class{TestCase}-derived class \class{SampleTestCase} with three test
@@ -905,7 +943,7 @@
 
 \begin{methoddesc}[TestLoader]{getTestCaseNames}{testCaseClass}
   Return a sorted sequence of method names found within
-  \var{testCaseClass}.
+  \var{testCaseClass}; this should be a subclass of \class{TestCase}.
 \end{methoddesc}
 
 

Modified: python/branches/p3yk-noslice/Doc/lib/liburlparse.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/liburlparse.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/liburlparse.tex	Fri Dec 15 05:21:50 2006
@@ -142,7 +142,7 @@
 
 \begin{funcdesc}{urljoin}{base, url\optional{, allow_fragments}}
 Construct a full (``absolute'') URL by combining a ``base URL''
-(\var{base}) with a ``relative URL'' (\var{url}).  Informally, this
+(\var{base}) with another URL (\var{url}).  Informally, this
 uses components of the base URL, in particular the addressing scheme,
 the network location and (part of) the path, to provide missing
 components in the relative URL.  For example:
@@ -155,6 +155,20 @@
 
 The \var{allow_fragments} argument has the same meaning and default as
 for \function{urlparse()}.
+
+\note{If \var{url} is an absolute URL (that is, starting with \code{//}
+      or \code{scheme://}, the \var{url}'s host name and/or scheme
+      will be present in the result.  For example:}
+
+\begin{verbatim}
+>>> urljoin('http://www.cwi.nl/%7Eguido/Python.html',
+...         '//www.python.org/%7Eguido')
+'http://www.python.org/%7Eguido'
+\end{verbatim}
+      
+If you do not want that behavior, preprocess
+the \var{url} with \function{urlsplit()} and \function{urlunsplit()},
+removing possible \em{scheme} and \em{netloc} parts.
 \end{funcdesc}
 
 \begin{funcdesc}{urldefrag}{url}

Modified: python/branches/p3yk-noslice/Doc/lib/libuuid.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libuuid.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libuuid.tex	Fri Dec 15 05:21:50 2006
@@ -18,20 +18,11 @@
 network address.  \function{uuid4()} creates a random UUID.
 
 \begin{classdesc}{UUID}{\optional{hex\optional{, bytes\optional{,
-fields\optional{, int\optional{, version}}}}}}
-
-%Instances of the UUID class represent UUIDs as specified in RFC 4122.
-%UUID objects are immutable, hashable, and usable as dictionary keys.
-%Converting a UUID to a string with str() yields something in the form
-%'12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
-%four possible forms: a similar string of hexadecimal digits, or a
-%string of 16 raw bytes as an argument named 'bytes', or a tuple of
-%six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
-%48-bit values respectively) as an argument named 'fields', or a single
-%128-bit integer as an argument named 'int'.
+bytes_le\optional{, fields\optional{, int\optional{, version}}}}}}}
 
 Create a UUID from either a string of 32 hexadecimal digits,
-a string of 16 bytes as the \var{bytes} argument, a tuple of six
+a string of 16 bytes as the \var{bytes} argument, a string of 16 bytes
+in little-endian order as the \var{bytes_le} argument, a tuple of six
 integers (32-bit \var{time_low}, 16-bit \var{time_mid},
 16-bit \var{time_hi_version},
 8-bit \var{clock_seq_hi_variant}, 8-bit \var{clock_seq_low}, 48-bit \var{node})
@@ -45,22 +36,31 @@
 UUID('12345678123456781234567812345678')
 UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
 UUID(bytes='\x12\x34\x56\x78'*4)
+UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +
+              '\x12\x34\x56\x78\x12\x34\x56\x78')
 UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
 UUID(int=0x12345678123456781234567812345678)
 \end{verbatim}
 
-Exactly one of \var{hex}, \var{bytes}, \var{fields}, or \var{int} must
+Exactly one of \var{hex}, \var{bytes}, \var{bytes_le}, \var{fields},
+or \var{int} must
 be given.  The \var{version} argument is optional; if given, the
 resulting UUID will have its variant and version number set according to
 RFC 4122, overriding bits in the given \var{hex}, \var{bytes},
-\var{fields}, or \var{int}.
+\var{bytes_le}, \var{fields}, or \var{int}.
 
 \end{classdesc}
 
 \class{UUID} instances have these read-only attributes:
 
 \begin{memberdesc}{bytes}
-The UUID as a 16-byte string.
+The UUID as a 16-byte string (containing the six
+integer fields in big-endian byte order).
+\end{memberdesc}
+
+\begin{memberdesc}{bytes_le}
+The UUID as a 16-byte string (with \var{time_low}, \var{time_mid},
+and \var{time_hi_version} in little-endian byte order).
 \end{memberdesc}
 
 \begin{memberdesc}{fields}
@@ -95,10 +95,10 @@
 
 \begin{memberdesc}{variant}
 The UUID variant, which determines the internal layout of the UUID.
-This will be an integer equal to one of the constants
+This will be one of the integer constants
 \constant{RESERVED_NCS},
 \constant{RFC_4122}, \constant{RESERVED_MICROSOFT}, or
-\constant{RESERVED_FUTURE}).
+\constant{RESERVED_FUTURE}.
 \end{memberdesc}
 
 \begin{memberdesc}{version}
@@ -106,7 +106,7 @@
 when the variant is \constant{RFC_4122}).
 \end{memberdesc}
 
-The \module{uuid} module defines the following functions
+The \module{uuid} module defines the following functions:
 
 \begin{funcdesc}{getnode}{}
 Get the hardware address as a 48-bit positive integer.  The first time this
@@ -129,11 +129,8 @@
 \index{uuid1}
 
 \begin{funcdesc}{uuid3}{namespace, name}
-Generate a UUID based upon a MD5 hash of the \var{name} string value
-drawn from a specified namespace.   \var{namespace}
-must be one of \constant{NAMESPACE_DNS},
-\constant{NAMESPACE_URL}, \constant{NAMESPACE_OID},
-or \constant{NAMESPACE_X500}.
+Generate a UUID based on the MD5 hash
+of a namespace identifier (which is a UUID) and a name (which is a string).
 \end{funcdesc}
 \index{uuid3}
 
@@ -143,31 +140,32 @@
 \index{uuid4}
 
 \begin{funcdesc}{uuid5}{namespace, name}
-Generate a UUID based upon a SHA-1 hash of the \var{name} string value
-drawn from a specified namespace.   \var{namespace}
-must be one of \constant{NAMESPACE_DNS},
-\constant{NAMESPACE_URL}, \constant{NAMESPACE_OID},
-or \constant{NAMESPACE_X500}.
+Generate a UUID based on the SHA-1 hash
+of a namespace identifier (which is a UUID) and a name (which is a string).
 \end{funcdesc}
 \index{uuid5}
 
-The \module{uuid} module defines the following namespace constants
+The \module{uuid} module defines the following namespace identifiers
 for use with \function{uuid3()} or \function{uuid5()}.
 
 \begin{datadesc}{NAMESPACE_DNS}
-Fully-qualified domain name namespace UUID.
+When this namespace is specified,
+the \var{name} string is a fully-qualified domain name.
 \end{datadesc}
 
 \begin{datadesc}{NAMESPACE_URL}
-URL namespace UUID.
+When this namespace is specified,
+the \var{name} string is a URL.
 \end{datadesc}
 
 \begin{datadesc}{NAMESPACE_OID}
-ISO OID namespace UUID.
+When this namespace is specified,
+the \var{name} string is an ISO OID.
 \end{datadesc}
 
 \begin{datadesc}{NAMESPACE_X500}
-X.500 DN namespace UUID.
+When this namespace is specified,
+the \var{name} string is an X.500 DN in DER or a text output format.
 \end{datadesc}
 
 The \module{uuid} module defines the following constants
@@ -178,11 +176,11 @@
 \end{datadesc}
 
 \begin{datadesc}{RFC_4122}
-Uses UUID layout specified in \rfc{4122}.
+Specifies the UUID layout given in \rfc{4122}.
 \end{datadesc}
 
 \begin{datadesc}{RESERVED_MICROSOFT}
-Reserved for Microsoft backward compatibility.
+Reserved for Microsoft compatibility.
 \end{datadesc}
 
 \begin{datadesc}{RESERVED_FUTURE}
@@ -192,12 +190,13 @@
 
 \begin{seealso}
   \seerfc{4122}{A Universally Unique IDentifier (UUID) URN Namespace}{
-          This specifies a Uniform Resource Name namespace for UUIDs.}
+This specification defines a Uniform Resource Name namespace for UUIDs,
+the internal format of UUIDs, and methods of generating UUIDs.}
 \end{seealso}
 
 \subsection{Example \label{uuid-example}}
 
-Here is a typical usage:
+Here are some examples of typical usage of the \module{uuid} module:
 \begin{verbatim}
 >>> import uuid
 

Modified: python/branches/p3yk-noslice/Doc/lib/libwinreg.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libwinreg.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libwinreg.tex	Fri Dec 15 05:21:50 2006
@@ -375,7 +375,7 @@
  also accept an integer, however, use of the handle object is 
  encouraged.
  
- Handle objects provide semantics for \method{__nonzero__()} - thus
+ Handle objects provide semantics for \method{__bool__()} - thus
 \begin{verbatim}
     if handle:
         print "Yes"

Modified: python/branches/p3yk-noslice/Doc/lib/libwsgiref.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libwsgiref.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libwsgiref.tex	Fri Dec 15 05:21:50 2006
@@ -26,8 +26,9 @@
 WSGI specification (\pep{333}).
 
 % XXX If you're just trying to write a web application...
-% XXX should create a URL on python.org to point people to.
 
+See \url{http://www.wsgi.org} for more information about WSGI,
+and links to tutorials and other resources.
 
 
 

Modified: python/branches/p3yk-noslice/Doc/lib/libxmlrpclib.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libxmlrpclib.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libxmlrpclib.tex	Fri Dec 15 05:21:50 2006
@@ -68,7 +68,10 @@
   \lineii{arrays}{Any Python sequence type containing conformable
                   elements. Arrays are returned as lists}
   \lineii{structures}{A Python dictionary. Keys must be strings,
-                      values may be any conformable type.}
+                      values may be any conformable type. Objects
+                      of user-defined classes can be passed in;
+                      only their \var{__dict__} attribute is 
+                      transmitted.}
   \lineii{dates}{in seconds since the epoch (pass in an instance of the
                  \class{DateTime} class) or a
                  \class{\refmodule{datetime}.datetime},
@@ -100,6 +103,10 @@
 compatibility.  New code should use \class{ServerProxy}.
 
 \versionchanged[The \var{use_datetime} flag was added]{2.5}
+
+\versionchanged[Instances of new-style classes can be passed in
+if they have an \var{__dict__} attribute and don't have a base class
+that is marshalled in a special way]{2.6}
 \end{classdesc}
 
 
@@ -171,7 +178,7 @@
 This class may be initialized from any Python value; the instance
 returned depends only on its truth value.  It supports various Python
 operators through \method{__cmp__()}, \method{__repr__()},
-\method{__int__()}, and \method{__nonzero__()} methods, all
+\method{__int__()}, and \method{__bool__()} methods, all
 implemented in the obvious ways.
 
 It also has the following method, supported mainly for internal use by

Modified: python/branches/p3yk-noslice/Doc/lib/sqlite3/executescript.py
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/sqlite3/executescript.py	(original)
+++ python/branches/p3yk-noslice/Doc/lib/sqlite3/executescript.py	Fri Dec 15 05:21:50 2006
@@ -17,7 +17,7 @@
 
     insert into book(title, author, published)
     values (
-        'Dirk Gently''s Holistic Detective Agency
+        'Dirk Gently''s Holistic Detective Agency',
         'Douglas Adams',
         1987
     );

Modified: python/branches/p3yk-noslice/Doc/lib/tkinter.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/tkinter.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/tkinter.tex	Fri Dec 15 05:21:50 2006
@@ -318,7 +318,7 @@
 \item[\var{options}]
 configure the widget's appearance and in some cases, its
 behavior.  The options come in the form of a list of flags and values.
-Flags are proceeded by a `-', like \UNIX{} shell command flags, and
+Flags are preceded by a `-', like \UNIX{} shell command flags, and
 values are put in quotes if they are more than one word.
 \end{description}
 

Modified: python/branches/p3yk-noslice/Doc/perl/python.perl
==============================================================================
--- python/branches/p3yk-noslice/Doc/perl/python.perl	(original)
+++ python/branches/p3yk-noslice/Doc/perl/python.perl	Fri Dec 15 05:21:50 2006
@@ -883,6 +883,12 @@
             $filename = 'grammar.txt';
         }
         open(GRAMMAR, ">$filename") || die "\n$!\n";
+        print GRAMMAR "##################################################\n";
+        print GRAMMAR "#     This file is only meant to be a guide,     #\n";
+        print GRAMMAR "#    and differs in small ways from the real     #\n";
+        print GRAMMAR "#   grammar.  The exact reference is the file    #\n";
+        print GRAMMAR "#  Grammar/Grammar distributed with the source.  #\n";
+        print GRAMMAR "##################################################\n";
         print GRAMMAR strip_grammar_markup($DefinedGrammars{$lang});
         close(GRAMMAR);
         print "Wrote grammar file $filename\n";

Modified: python/branches/p3yk-noslice/Doc/ref/ref2.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/ref2.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ref/ref2.tex	Fri Dec 15 05:21:50 2006
@@ -308,13 +308,12 @@
 \index{reserved word}
 
 \begin{verbatim}
-and       del       from      not       while    
-as        elif      global    or        with     
-assert    else      if        pass      yield    
-break     except    import    print              
-class     exec      in        raise              
-continue  finally   is        return             
-def       for       lambda    try 
+and       def       for       is        raise
+as        del       from      lambda    return
+assert    elif      global    not       try
+break     else      if        or        while
+class     except    import    pass      with
+continue  finally   in        print     yield
 \end{verbatim}
 
 % When adding keywords, use reswords.py for reformatting
@@ -689,13 +688,9 @@
 \begin{verbatim}
 +       -       *       **      /       //      %
 <<      >>      &       |       ^       ~
-<       >       <=      >=      ==      !=      <>
+<       >       <=      >=      ==      !=
 \end{verbatim}
 
-The comparison operators \code{<>} and \code{!=} are alternate
-spellings of the same operator.  \code{!=} is the preferred spelling;
-\code{<>} is obsolescent.
-
 
 \section{Delimiters\label{delimiters}}
 

Modified: python/branches/p3yk-noslice/Doc/ref/ref3.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/ref3.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ref/ref3.tex	Fri Dec 15 05:21:50 2006
@@ -148,9 +148,8 @@
 
 \item[Ellipsis]
 This type has a single value.  There is a single object with this value.
-This object is accessed through the built-in name \code{Ellipsis}.
-It is used to indicate the presence of the \samp{...} syntax in a
-slice.  Its truth value is true.
+This object is accessed through the literal \code{...} or the
+built-in name \code{Ellipsis}.  Its truth value is true.
 \obindex{Ellipsis}
 
 \item[Numbers]
@@ -379,6 +378,41 @@
 
 \end{description} % Sequences
 
+
+\item[Set types]
+These represent unordered, finite sets of unique, immutable objects.
+As such, they cannot be indexed by any subscript. However, they can be
+iterated over, and the built-in function \function{len()} returns the
+number of items in a set. Common uses for sets are
+fast membership testing, removing duplicates from a sequence, and
+computing mathematical operations such as intersection, union, difference,
+and symmetric difference.
+\bifuncindex{len}
+\obindex{set type}
+
+For set elements, the same immutability rules apply as for dictionary
+keys. Note that numeric types obey the normal rules for numeric
+comparison: if two numbers compare equal (e.g., \code{1} and
+\code{1.0}), only one of them can be contained in a set.
+
+There are currently two intrinsic set types:
+
+\begin{description}
+
+\item[Sets]
+These\obindex{set} represent a mutable set. They are created by the
+built-in \function{set()} constructor and can be modified afterwards
+by several methods, such as \method{add()}.
+
+\item[Frozen sets]
+These\obindex{frozenset} represent an immutable set. They are created by
+the built-in \function{frozenset()} constructor. As a frozenset is
+immutable and hashable, it can be used again as an element of another set,
+or as a dictionary key.
+
+\end{description} % Set types
+
+
 \item[Mappings]
 These represent finite sets of objects indexed by arbitrary index sets.
 The subscript notation \code{a[k]} selects the item indexed
@@ -762,7 +796,7 @@
 (call it~\class{C}) of the instance for which the attribute reference
 was initiated or one of its bases,
 it is transformed into a bound user-defined method object whose
-\member{im_class} attribute is~\class{C} whose \member{im_self} attribute
+\member{im_class} attribute is~\class{C} and whose \member{im_self} attribute
 is the instance. Static method and class method objects are also
 transformed, as if they had been retrieved from class~\class{C};
 see above under ``Classes''. See section~\ref{descriptors} for
@@ -1243,8 +1277,7 @@
 \code{\var{x}<\var{y}} calls \code{\var{x}.__lt__(\var{y})},
 \code{\var{x}<=\var{y}} calls \code{\var{x}.__le__(\var{y})},
 \code{\var{x}==\var{y}} calls \code{\var{x}.__eq__(\var{y})},
-\code{\var{x}!=\var{y}} and \code{\var{x}<>\var{y}} call
-\code{\var{x}.__ne__(\var{y})},
+\code{\var{x}!=\var{y}} calls \code{\var{x}.__ne__(\var{y})},
 \code{\var{x}>\var{y}} calls \code{\var{x}.__gt__(\var{y})}, and
 \code{\var{x}>=\var{y}} calls \code{\var{x}.__ge__(\var{y})}.
 These methods can return any value, but if the comparison operator is
@@ -1315,13 +1348,13 @@
 \withsubitem{(object method)}{\ttindex{__cmp__()}}
 \end{methoddesc}
 
-\begin{methoddesc}[object]{__nonzero__}{self}
+\begin{methoddesc}[object]{__bool__}{self}
 Called to implement truth value testing, and the built-in operation
-\code{bool()}; should return \code{False} or \code{True}, or their
-integer equivalents \code{0} or \code{1}.
+\code{bool()}; should return \code{False} or \code{True}.
 When this method is not defined, \method{__len__()} is
-called, if it is defined (see below).  If a class defines neither
-\method{__len__()} nor \method{__nonzero__()}, all its instances are
+called, if it is defined (see below) and \code{True} is returned when
+the length is not zero.  If a class defines neither
+\method{__len__()} nor \method{__bool__()}, all its instances are
 considered true.
 \withsubitem{(mapping object method)}{\ttindex{__len__()}}
 \end{methoddesc}
@@ -1695,9 +1728,9 @@
 Called to implement the built-in function
 \function{len()}\bifuncindex{len}.  Should return the length of the
 object, an integer \code{>=} 0.  Also, an object that doesn't define a
-\method{__nonzero__()} method and whose \method{__len__()} method
+\method{__bool__()} method and whose \method{__len__()} method
 returns zero is considered to be false in a Boolean context.
-\withsubitem{(object method)}{\ttindex{__nonzero__()}}
+\withsubitem{(object method)}{\ttindex{__bool__()}}
 \end{methoddesc}
 
 \begin{methoddesc}[container object]{__getitem__}{self, key}

Modified: python/branches/p3yk-noslice/Doc/ref/ref4.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/ref4.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ref/ref4.tex	Fri Dec 15 05:21:50 2006
@@ -20,8 +20,8 @@
 argument) is a code block.  A script command (a command specified on
 the interpreter command line with the `\strong{-c}' option) is a code
 block.  The file read by the built-in function \function{execfile()}
-is a code block.  The string argument passed to the built-in function
-\function{eval()} and to the \keyword{exec} statement is a code block.
+is a code block.  The string argument passed to the built-in functions
+\function{eval()} and \function{exec()} is a code block.
 The expression read and evaluated by the built-in function
 \function{input()} is a code block.
 
@@ -139,22 +139,16 @@
 function and the function contains or is a nested block with free
 variables, the compiler will raise a \exception{SyntaxError}.
 
-If \keyword{exec} is used in a function and the function contains or
-is a nested block with free variables, the compiler will raise a
-\exception{SyntaxError} unless the exec explicitly specifies the local
-namespace for the \keyword{exec}.  (In other words, \samp{exec obj}
-would be illegal, but \samp{exec obj in ns} would be legal.)
-
-The \function{eval()}, \function{execfile()}, and \function{input()}
-functions and the \keyword{exec} statement do not have access to the
+The \function{eval()}, \function{exec()}, \function{execfile()},
+and \function{input()} functions do not have access to the
 full environment for resolving names.  Names may be resolved in the
 local and global namespaces of the caller.  Free variables are not
 resolved in the nearest enclosing namespace, but in the global
 namespace.\footnote{This limitation occurs because the code that is
     executed by these operations is not available at the time the
     module is compiled.}
-The \keyword{exec} statement and the \function{eval()} and
-\function{execfile()} functions have optional arguments to override
+The \function{exec()}, \function{eval()} and \function{execfile()}
+functions have optional arguments to override
 the global and local namespace.  If only one namespace is specified,
 it is used for both.
 

Modified: python/branches/p3yk-noslice/Doc/ref/ref5.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/ref5.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ref/ref5.tex	Fri Dec 15 05:21:50 2006
@@ -268,49 +268,6 @@
 \indexii{immutable}{object}
 
 
-\subsection{String conversions\label{string-conversions}}
-\indexii{string}{conversion}
-\indexii{reverse}{quotes}
-\indexii{backward}{quotes}
-\index{back-quotes}
-
-A string conversion is an expression list enclosed in reverse (a.k.a.
-backward) quotes:
-
-\begin{productionlist}
-  \production{string_conversion}
-             {"`" \token{expression_list} "`"}
-\end{productionlist}
-
-A string conversion evaluates the contained expression list and
-converts the resulting object into a string according to rules
-specific to its type.
-
-If the object is a string, a number, \code{None}, or a tuple, list or
-dictionary containing only objects whose type is one of these, the
-resulting string is a valid Python expression which can be passed to
-the built-in function \function{eval()} to yield an expression with the
-same value (or an approximation, if floating point numbers are
-involved).
-
-(In particular, converting a string adds quotes around it and converts
-``funny'' characters to escape sequences that are safe to print.)
-
-Recursive objects (for example, lists or dictionaries that contain a
-reference to themselves, directly or indirectly) use \samp{...} to
-indicate a recursive reference, and the result cannot be passed to
-\function{eval()} to get an equal value (\exception{SyntaxError} will
-be raised instead).
-\obindex{recursive}
-
-The built-in function \function{repr()} performs exactly the same
-conversion in its argument as enclosing it in parentheses and reverse
-quotes does.  The built-in function \function{str()} performs a
-similar but more user-friendly conversion.
-\bifuncindex{repr}
-\bifuncindex{str}
-
-
 \section{Primaries\label{primaries}}
 \index{primary}
 
@@ -454,8 +411,7 @@
 contains at least one comma, the key is a tuple containing the
 conversion of the slice items; otherwise, the conversion of the lone
 slice item is the key.  The conversion of a slice item that is an
-expression is that expression.  The conversion of an ellipsis slice
-item is the built-in \code{Ellipsis} object.  The conversion of a
+expression is that expression.  The conversion of a
 proper slice is a slice object (see section \ref{types}) whose
 \member{start}, \member{stop} and \member{step} attributes are the
 values of the expressions given as lower bound, upper bound and
@@ -875,7 +831,7 @@
   \production{comparison}
              {\token{or_expr} ( \token{comp_operator} \token{or_expr} )*}
   \production{comp_operator}
-             {"<" | ">" | "==" | ">=" | "<=" | "<>" | "!="}
+             {"<" | ">" | "==" | ">=" | "<=" | "!="}
   \productioncont{| "is" ["not"] | ["not"] "in"}
 \end{productionlist}
 
@@ -897,11 +853,6 @@
 between \var{a} and \var{c}, so that, e.g., \code{x < y > z} is
 perfectly legal (though perhaps not pretty).
 
-The forms \code{<>} and \code{!=} are equivalent; for consistency with
-C, \code{!=} is preferred; where \code{!=} is mentioned below
-\code{<>} is also accepted.  The \code{<>} spelling is considered
-obsolescent.
-
 The operators \code{<}, \code{>}, \code{==}, \code{>=}, \code{<=}, and
 \code{!=} compare
 the values of two objects.  The objects need not have the same type.
@@ -1154,7 +1105,7 @@
     \lineii{\keyword{in}, \keyword{not} \keyword{in}}{Membership tests}
     \lineii{\keyword{is}, \keyword{is not}}{Identity tests}
     \lineii{\code{<}, \code{<=}, \code{>}, \code{>=},
-            \code{<>}, \code{!=}, \code{==}}
+            \code{!=}, \code{==}}
 	   {Comparisons}
   \hline
     \lineii{\code{|}}				{Bitwise OR}

Modified: python/branches/p3yk-noslice/Doc/ref/ref6.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/ref6.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ref/ref6.tex	Fri Dec 15 05:21:50 2006
@@ -20,7 +20,6 @@
   \productioncont{| \token{continue_stmt}}
   \productioncont{| \token{import_stmt}}
   \productioncont{| \token{global_stmt}}
-  \productioncont{| \token{exec_stmt}}
 \end{productionlist}
 
 
@@ -809,7 +808,7 @@
 That is not a future statement; it's an ordinary import statement with
 no special semantics or syntax restrictions.
 
-Code compiled by an \keyword{exec} statement or calls to the builtin functions
+Code compiled by calls to the builtin functions \function{exec()},
 \function{compile()} and \function{execfile()} that occur in a module
 \module{M} containing a future statement will, by default, use the new 
 syntax or semantics associated with the future statement.  This can,
@@ -855,64 +854,14 @@
 \strong{Programmer's note:}
 the \keyword{global} is a directive to the parser.  It
 applies only to code parsed at the same time as the \keyword{global}
-statement.  In particular, a \keyword{global} statement contained in an
-\keyword{exec} statement does not affect the code block \emph{containing}
-the \keyword{exec} statement, and code contained in an \keyword{exec}
-statement is unaffected by \keyword{global} statements in the code
-containing the \keyword{exec} statement.  The same applies to the
+statement.  In particular, a \keyword{global} statement contained in a
+string or code object supplied to the builtin \function{exec()} function
+does not affect the code block \emph{containing} the function call,
+and code contained in such a string is unaffected by \keyword{global}
+statements in the code containing the function call.  The same applies to the
 \function{eval()}, \function{execfile()} and \function{compile()} functions.
-\stindex{exec}
+\bifuncindex{exec}
 \bifuncindex{eval}
 \bifuncindex{execfile}
 \bifuncindex{compile}
 
-
-\section{The \keyword{exec} statement \label{exec}}
-\stindex{exec}
-
-\begin{productionlist}
-  \production{exec_stmt}
-             {"exec" \token{expression}
-              ["in" \token{expression} ["," \token{expression}]]}
-\end{productionlist}
-
-This statement supports dynamic execution of Python code.  The first
-expression should evaluate to either a string, an open file object, or
-a code object.  If it is a string, the string is parsed as a suite of
-Python statements which is then executed (unless a syntax error
-occurs).  If it is an open file, the file is parsed until \EOF{} and
-executed.  If it is a code object, it is simply executed.  In all
-cases, the code that's executed is expected to be valid as file
-input (see section~\ref{file-input}, ``File input'').  Be aware that
-the \keyword{return} and \keyword{yield} statements may not be used
-outside of function definitions even within the context of code passed
-to the \keyword{exec} statement.
-
-In all cases, if the optional parts are omitted, the code is executed
-in the current scope.  If only the first expression after \keyword{in}
-is specified, it should be a dictionary, which will be used for both
-the global and the local variables.  If two expressions are given,
-they are used for the global and local variables, respectively.
-If provided, \var{locals} can be any mapping object.
-\versionchanged[formerly \var{locals} was required to be a dictionary]{2.4}
-
-As a side effect, an implementation may insert additional keys into
-the dictionaries given besides those corresponding to variable names
-set by the executed code.  For example, the current implementation
-may add a reference to the dictionary of the built-in module
-\module{__builtin__} under the key \code{__builtins__} (!).
-\ttindex{__builtins__}
-\refbimodindex{__builtin__}
-
-\strong{Programmer's hints:}
-dynamic evaluation of expressions is supported by the built-in
-function \function{eval()}.  The built-in functions
-\function{globals()} and \function{locals()} return the current global
-and local dictionary, respectively, which may be useful to pass around
-for use by \keyword{exec}.
-\bifuncindex{eval}
-\bifuncindex{globals}
-\bifuncindex{locals}
-
-  
-

Modified: python/branches/p3yk-noslice/Doc/ref/ref8.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/ref8.tex	(original)
+++ python/branches/p3yk-noslice/Doc/ref/ref8.tex	Fri Dec 15 05:21:50 2006
@@ -62,7 +62,7 @@
 
 \item when parsing a module;
 
-\item when parsing a string passed to the \keyword{exec} statement;
+\item when parsing a string passed to the \function{exec()} function;
 
 \end{itemize}
 

Modified: python/branches/p3yk-noslice/Doc/ref/reswords.py
==============================================================================
--- python/branches/p3yk-noslice/Doc/ref/reswords.py	(original)
+++ python/branches/p3yk-noslice/Doc/ref/reswords.py	Fri Dec 15 05:21:50 2006
@@ -9,7 +9,7 @@
     words.sort()
     colwidth = 1 + max(map(len, words))
     nwords = len(words)
-    nrows = (nwords + ncols - 1) / ncols
+    nrows = (nwords + ncols - 1) // ncols
     for irow in range(nrows):
         for icol in range(ncols):
             i = irow + icol * nrows

Modified: python/branches/p3yk-noslice/Doc/tools/py2texi.el
==============================================================================
--- python/branches/p3yk-noslice/Doc/tools/py2texi.el	(original)
+++ python/branches/p3yk-noslice/Doc/tools/py2texi.el	Fri Dec 15 05:21:50 2006
@@ -1,5 +1,6 @@
 ;;; py2texi.el -- Conversion of Python LaTeX documentation to Texinfo
 
+;; Copyright (C) 2006  Jeroen Dekkers <jeroen at dekkers.cx>
 ;; Copyright (C) 1998, 1999, 2001, 2002 Milan Zamazal
 
 ;; Author: Milan Zamazal <pdm at zamazal.org>
@@ -168,6 +169,7 @@
      "@end table\n")
     ("productionlist" 0 "\n at table @code\n" "@end table\n")
     ("quotation" 0 "@quotation" "@end quotation")
+    ("quote" 0 "@quotation" "@end quotation")
     ("seealso" 0 "See also:\n at table @emph\n" "@end table\n")
     ("seealso*" 0 "@table @emph\n" "@end table\n")
     ("sloppypar" 0 "" "")
@@ -246,11 +248,12 @@
     ("env" 1 "@code{\\1}")
     ("EOF" 0 "@code{EOF}")
     ("email" 1 "@email{\\1}")
+    ("em" 1 "@emph{\\1}")
     ("emph" 1 "@emph{\\1}")
     ("envvar" 1 "@env{\\1}")
     ("exception" 1 "@code{\\1}")
     ("exindex" 1 (progn (setq obindex t) "@obindex{\\1}"))
-    ("fi" 0 (concat "@end " last-if))
+    ("fi" 0 (if (equal last-if "ifx") "" (concat "@end " last-if)))
     ("file" 1 "@file{\\1}")
     ("filenq" 1 "@file{\\1}")
     ("filevar" 1 "@file{@var{\\1}}")
@@ -262,6 +265,7 @@
     ("grammartoken" 1 "@code{\\1}")
     ("guilabel" 1 "@strong{\\1}")
     ("hline" 0 "")
+    ("ifx" 0 (progn (setq last-if "ifx") ""))
     ("ifhtml" 0 (concat "@" (setq last-if "ifinfo")))
     ("iftexi" 0 (concat "@" (setq last-if "ifinfo")))
     ("index" 1 (progn (setq cindex t) "@cindex{\\1}"))
@@ -284,6 +288,7 @@
     ("lineiii" 3 "@item \\1 @tab \\2 @tab \\3")
     ("lineiv" 4 "@item \\1 @tab \\2 @tab \\3 @tab \\4")
     ("linev" 5 "@item \\1 @tab \\2 @tab \\3 @tab \\4 @tab \\5")
+    ("locallinewidth" 0 "")
     ("localmoduletable" 0 "")
     ("longprogramopt" 1 "@option{--\\1}")
     ("macro" 1 "@code{@backslash{}\\1}")
@@ -307,6 +312,7 @@
     ("moreargs" 0 "@dots{}")
     ("n" 0 "@backslash{}n")
     ("newcommand" 2 "")
+    ("newlength" 1 "")
     ("newsgroup" 1 "@samp{\\1}")
     ("nodename" 1
      (save-excursion
@@ -322,6 +328,7 @@
     ("opindex" 1 (progn (setq cindex t) "@cindex{\\1}"))
     ("option" 1 "@option{\\1}")
     ("optional" 1 "[\\1]")
+    ("paragraph" 1 "@subsubheading \\1")
     ("pep" 1 (progn (setq cindex t) "PEP@ \\1 at cindex PEP \\1\n"))
     ("pi" 0 "pi")
     ("platform" 1 "")
@@ -363,6 +370,7 @@
     ("seetitle" 1 "@cite{\\1}")
     ("seeurl" 2 "\n at table @url\n at item \\1\n\\2\n at end table\n")
     ("setindexsubitem" 1 (progn (setq cindex t) "@cindex \\1"))
+    ("setlength" 2 "")
     ("setreleaseinfo" 1 (progn (setq py2texi-releaseinfo "")))
     ("setshortversion" 1
      (progn (setq py2texi-python-short-version (match-string 1 string)) ""))
@@ -382,8 +390,8 @@
     ("textasciicircum" 0 "^")
     ("textbackslash" 0 "@backslash{}")
     ("textbar" 0 "|")
-    ; Some common versions of Texinfo don't support @euro yet:
-    ; ("texteuro" 0 "@euro{}")
+    ("textbf" 1 "@strong{\\1}")
+    ("texteuro" 0 "@euro{}")
     ; Unfortunately, this alternate spelling doesn't actually apply to
     ; the usage found in Python Tutorial, which actually requires a
     ; Euro symbol to make sense, so this is commented out as well.
@@ -394,6 +402,7 @@
     ("textrm" 1 "\\1")
     ("texttt" 1 "@code{\\1}")
     ("textunderscore" 0 "_")
+    ("tilde" 0 "~")
     ("title" 1 (progn (setq title (match-string 1 string)) "@settitle \\1"))
     ("today" 0 "@today{}")
     ("token" 1 "@code{\\1}")
@@ -402,6 +411,7 @@
     ("u" 0 "@backslash{}u")
     ("ulink" 2 "\\1")
     ("UNIX" 0 "UNIX")
+    ("undefined" 0 "")
     ("unspecified" 0 "@dots{}")
     ("url" 1 "@url{\\1}")
     ("usepackage" 1 "")
@@ -534,15 +544,20 @@
 	beg
 	end)
     (py2texi-search-safe "\\\\begin{\\(verbatim\\|displaymath\\)}"
-      (replace-match "@example")
-      (setq beg (copy-marker (point) nil))
-      (re-search-forward "\\\\end{\\(verbatim\\|displaymath\\)}")
-      (setq end (copy-marker (match-beginning 0) nil))
-      (replace-match "@end example")
-      (py2texi-texinfo-escape beg end)
-      (put-text-property (- beg (length "@example"))
-			 (+ end (length "@end example"))
-			 'py2texi-protected t))
+      (when (save-excursion
+	      ; Make sure we aren't looking at a commented out version
+	      ; of a verbatim environment
+	      (beginning-of-line)
+	      (not (looking-at "%")))
+	(replace-match "@example ")
+	(setq beg (copy-marker (point) nil))
+	(re-search-forward "\\\\end{\\(verbatim\\|displaymath\\)}")
+	(setq end (copy-marker (match-beginning 0) nil))
+	(replace-match "@end example")
+	(py2texi-texinfo-escape beg end)
+	(put-text-property (- beg (length "@example "))
+			   (+ end (length "@end example"))
+			   'py2texi-protected t)))
     (py2texi-search-safe "\\\\verb\\([^a-z]\\)"
       (setq delimiter (match-string 1))
       (replace-match "@code{")
@@ -883,6 +898,10 @@
 
 (defun py2texi-fix-braces ()
   "Escape braces for Texinfo."
+  (py2texi-search "{@{}"
+    (replace-match "@{"))
+  (py2texi-search "{@}}"
+    (replace-match "@}"))
   (let (string)
     (py2texi-search "{"
        (unless (or (py2texi-protected)

Modified: python/branches/p3yk-noslice/Doc/tut/tut.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/tut/tut.tex	(original)
+++ python/branches/p3yk-noslice/Doc/tut/tut.tex	Fri Dec 15 05:21:50 2006
@@ -1893,8 +1893,8 @@
 
 \subsection{Functional Programming Tools \label{functional}}
 
-There are three built-in functions that are very useful when used with
-lists: \function{filter()}, \function{map()}, and \function{reduce()}.
+There are two built-in functions that are very useful when used with
+lists: \function{filter()} and \function{map()}.
 
 \samp{filter(\var{function}, \var{sequence})} returns a sequence
 consisting of those items from the
@@ -1934,42 +1934,6 @@
 >>> map(add, seq, seq)
 [0, 2, 4, 6, 8, 10, 12, 14]
 \end{verbatim}
-
-\samp{reduce(\var{function}, \var{sequence})} returns a single value
-constructed by calling the binary function \var{function} on the first two
-items of the sequence, then on the result and the next item, and so
-on.  For example, to compute the sum of the numbers 1 through 10:
-
-\begin{verbatim}
->>> def add(x,y): return x+y
-...
->>> reduce(add, range(1, 11))
-55
-\end{verbatim}
-
-If there's only one item in the sequence, its value is returned; if
-the sequence is empty, an exception is raised.
-
-A third argument can be passed to indicate the starting value.  In this
-case the starting value is returned for an empty sequence, and the
-function is first applied to the starting value and the first sequence
-item, then to the result and the next item, and so on.  For example,
-
-\begin{verbatim}
->>> def sum(seq):
-...     def add(x,y): return x+y
-...     return reduce(add, seq, 0)
-... 
->>> sum(range(1, 11))
-55
->>> sum([])
-0
-\end{verbatim}
-
-Don't use this example's definition of \function{sum()}: since summing
-numbers is such a common need, a built-in function
-\code{sum(\var{sequence})} is already provided, and works exactly like
-this.
 \versionadded{2.3}
 
 \subsection{List Comprehensions}
@@ -2732,14 +2696,14 @@
  'UserWarning', 'ValueError', 'Warning', 'WindowsError',
  'ZeroDivisionError', '_', '__debug__', '__doc__', '__import__',
  '__name__', 'abs', 'basestring', 'bool', 'buffer',
- 'callable', 'chr', 'classmethod', 'cmp', 'coerce', 'compile',
+ 'callable', 'chr', 'classmethod', 'cmp', 'compile',
  'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod',
- 'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
+ 'enumerate', 'eval', 'exec', 'execfile', 'exit', 'file', 'filter', 'float',
  'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex',
  'id', 'int', 'intern', 'isinstance', 'issubclass', 'iter',
  'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'min',
  'object', 'oct', 'open', 'ord', 'pow', 'property', 'quit', 'range',
- 'reduce', 'reload', 'repr', 'reversed', 'round', 'set',
+ 'reload', 'repr', 'reversed', 'round', 'set',
  'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super',
  'tuple', 'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip']
 \end{verbatim}
@@ -2867,7 +2831,7 @@
 *}?  Ideally, one would hope that this somehow goes out to the
 filesystem, finds which submodules are present in the package, and
 imports them all.  Unfortunately, this operation does not work very
-well on Mac and Windows platforms, where the filesystem does not
+well on Windows platforms, where the filesystem does not
 always have accurate information about the case of a filename!  On
 these platforms, there is no guaranteed way to know whether a file
 \file{ECHO.PY} should be imported as a module \module{echo},
@@ -3072,6 +3036,7 @@
  8  64  512
  9  81  729
 10 100 1000
+
 >>> for x in range(1,11):
 ...     print '%2d %3d %4d' % (x, x*x, x*x*x)
 ... 
@@ -3087,8 +3052,9 @@
 10 100 1000
 \end{verbatim}
 
-(Note that one space between each column was added by the way
-\keyword{print} works: it always adds spaces between its arguments.)
+(Note that in the first example, one space between each column was
+added by the way \keyword{print} works: it always adds spaces between
+its arguments.)
 
 This example demonstrates the \method{rjust()} method of string objects,
 which right-justifies a string in a field of a given width by padding
@@ -3557,7 +3523,7 @@
 
 But use of \code{.args} is discouraged.  Instead, the preferred use is to pass
 a single argument to an exception (which can be a tuple if multiple arguments
-are needed) and have it bound to the \code{message} attribute.  One my also
+are needed) and have it bound to the \code{message} attribute.  One may also
 instantiate an exception first before raising it and add any attributes to it
 as desired.
 
@@ -4398,8 +4364,8 @@
 (Buglet: derivation of a class with the same name as the base class
 makes use of private variables of the base class possible.)
 
-Notice that code passed to \code{exec}, \code{eval()} or
-\code{evalfile()} does not consider the classname of the invoking 
+Notice that code passed to \code{exec()}, \code{eval()} or
+\code{execfile()} does not consider the classname of the invoking 
 class to be the current class; this is similar to the effect of the 
 \code{global} statement, the effect of which is likewise restricted to 
 code that is byte-compiled together.  The same restriction applies to

Modified: python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex	(original)
+++ python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex	Fri Dec 15 05:21:50 2006
@@ -409,7 +409,7 @@
 specific exceptions.  You couldn't combine both \keyword{except} blocks and a
 \keyword{finally} block, because generating the right bytecode for the
 combined version was complicated and it wasn't clear what the
-semantics of the combined should be.  
+semantics of the combined statement should be.  
 
 Guido van~Rossum spent some time working with Java, which does support the
 equivalent of combining \keyword{except} blocks and a
@@ -540,10 +540,10 @@
 StopIteration
 \end{verbatim}
 
-Because \keyword{yield} will often be returning \constant{None}, you
+\keyword{yield} will usually return \constant{None}, so you
 should always check for this case.  Don't just use its value in
 expressions unless you're sure that the \method{send()} method
-will be the only method used resume your generator function.
+will be the only method used to resume your generator function.
 
 In addition to \method{send()}, there are two other new methods on
 generators:
@@ -683,22 +683,22 @@
 The lock is acquired before the block is executed and always released once 
 the block is complete.
 
-The \module{decimal} module's contexts, which encapsulate the desired
-precision and rounding characteristics for computations, provide a 
-\method{context_manager()} method for getting a context manager:
+The new \function{localcontext()} function in the \module{decimal} module
+makes it easy to save and restore the current decimal context, which
+encapsulates the desired precision and rounding characteristics for
+computations:
 
 \begin{verbatim}
-import decimal
+from decimal import Decimal, Context, localcontext
 
 # Displays with default precision of 28 digits
-v1 = decimal.Decimal('578')
-print v1.sqrt()
+v = Decimal('578')
+print v.sqrt()
 
-ctx = decimal.Context(prec=16) 
-with ctx.context_manager():
+with localcontext(Context(prec=16)):
     # All code in this block uses a precision of 16 digits.
     # The original context is restored on exiting the block.
-    print v1.sqrt()
+    print v.sqrt()
 \end{verbatim}
 
 \subsection{Writing Context Managers\label{context-managers}}
@@ -1115,12 +1115,14 @@
 \begin{verbatim}
 >>> ('http://www.python.org').partition('://')
 ('http', '://', 'www.python.org')
->>> (u'Subject: a quick question').partition(':')
-(u'Subject', u':', u' a quick question')
 >>> ('file:/usr/share/doc/index.html').partition('://')
 ('file:/usr/share/doc/index.html', '', '')
+>>> (u'Subject: a quick question').partition(':')
+(u'Subject', u':', u' a quick question')
 >>> 'www.python.org'.rpartition('.')
 ('www.python', '.', 'org')
+>>> 'www.python.org'.rpartition(':')
+('', '', 'www.python.org')
 \end{verbatim}
 
 (Implemented by Fredrik Lundh following a suggestion by Raymond Hettinger.)
@@ -2114,14 +2116,16 @@
 SQLite embedded database, has been added to the standard library under
 the package name \module{sqlite3}.  
 
-SQLite is a C library that provides a SQL-language database that
-stores data in disk files without requiring a separate server process.
+SQLite is a C library that provides a lightweight disk-based database
+that doesn't require a separate server process and allows accessing
+the database using a nonstandard variant of the SQL query language.
+Some applications can use SQLite for internal data storage.  It's also
+possible to prototype an application using SQLite and then port the
+code to a larger database such as PostgreSQL or Oracle.
+ 
 pysqlite was written by Gerhard H\"aring and provides a SQL interface
 compliant with the DB-API 2.0 specification described by
-\pep{249}. This means that it should be possible to write the first
-version of your applications using SQLite for data storage.  If
-switching to a larger database such as PostgreSQL or Oracle is
-later necessary, the switch should be relatively easy.
+\pep{249}. 
 
 If you're compiling the Python source yourself, note that the source
 tree doesn't include the SQLite code, only the wrapper module.
@@ -2148,8 +2152,8 @@
 
 # Create table
 c.execute('''create table stocks
-(date timestamp, trans varchar, symbol varchar,
- qty decimal, price decimal)''')
+(date text, trans text, symbol text,
+ qty real, price real)''')
 
 # Insert a row of data
 c.execute("""insert into stocks

Modified: python/branches/p3yk-noslice/Grammar/Grammar
==============================================================================
--- python/branches/p3yk-noslice/Grammar/Grammar	(original)
+++ python/branches/p3yk-noslice/Grammar/Grammar	Fri Dec 15 05:21:50 2006
@@ -24,7 +24,7 @@
 funcdef: [decorators] 'def' NAME parameters ':' suite
 parameters: '(' [varargslist] ')'
 varargslist: ((fpdef ['=' test] ',')*
-              ('*' NAME [',' '**' NAME] | '**' NAME) |
+              ('*' [NAME] (',' NAME ['=' test])*  [',' '**' NAME] | '**' NAME) |
               fpdef ['=' test] (',' fpdef ['=' test])* [','])
 fpdef: NAME | '(' fplist ')'
 fplist: fpdef (',' fpdef)* [',']
@@ -32,7 +32,7 @@
 stmt: simple_stmt | compound_stmt
 simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
 small_stmt: (expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt |
-             import_stmt | global_stmt | exec_stmt | assert_stmt)
+             import_stmt | global_stmt | assert_stmt)
 expr_stmt: testlist (augassign (yield_expr|testlist) |
                      ('=' (yield_expr|testlist))*)
 augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' |
@@ -58,7 +58,6 @@
 dotted_as_names: dotted_as_name (',' dotted_as_name)*
 dotted_name: NAME ('.' NAME)*
 global_stmt: 'global' NAME (',' NAME)*
-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
@@ -90,7 +89,7 @@
 and_test: not_test ('and' not_test)*
 not_test: 'not' not_test | comparison
 comparison: expr (comp_op expr)*
-comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
+comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'|'is' 'not'
 expr: xor_expr ('|' xor_expr)*
 xor_expr: and_expr ('^' and_expr)*
 and_expr: shift_expr ('&' shift_expr)*
@@ -101,19 +100,18 @@
 power: atom trailer* ['**' factor]
 atom: ('(' [yield_expr|testlist_gexp] ')' |
        '[' [listmaker] ']' |
-       '{' [dictmaker] '}' |
-       '`' testlist1 '`' |
-       NAME | NUMBER | STRING+)
+       '{' [dictsetmaker] '}' |
+       NAME | NUMBER | STRING+ | '.' '.' '.')
 listmaker: test ( list_for | (',' test)* [','] )
 testlist_gexp: test ( gen_for | (',' test)* [','] )
 lambdef: 'lambda' [varargslist] ':' test
 trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
 subscriptlist: subscript (',' subscript)* [',']
-subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop]
+subscript: test | [test] ':' [test] [sliceop]
 sliceop: ':' [test]
 exprlist: expr (',' expr)* [',']
 testlist: test (',' test)* [',']
-dictmaker: test ':' test (',' test ':' test)* [',']
+dictsetmaker: (test ':' test (',' test ':' test)* [',']) | (test (',' test)* [','])
 
 classdef: 'class' NAME ['(' [testlist] ')'] ':' suite
 

Modified: python/branches/p3yk-noslice/Include/Python-ast.h
==============================================================================
--- python/branches/p3yk-noslice/Include/Python-ast.h	(original)
+++ python/branches/p3yk-noslice/Include/Python-ast.h	Fri Dec 15 05:21:50 2006
@@ -64,8 +64,8 @@
                   For_kind=8, While_kind=9, If_kind=10, With_kind=11,
                   Raise_kind=12, TryExcept_kind=13, TryFinally_kind=14,
                   Assert_kind=15, Import_kind=16, ImportFrom_kind=17,
-                  Exec_kind=18, Global_kind=19, Expr_kind=20, Pass_kind=21,
-                  Break_kind=22, Continue_kind=23};
+                  Global_kind=18, Expr_kind=19, Pass_kind=20, Break_kind=21,
+                  Continue_kind=22};
 struct _stmt {
         enum _stmt_kind kind;
         union {
@@ -165,12 +165,6 @@
                 } ImportFrom;
                 
                 struct {
-                        expr_ty body;
-                        expr_ty globals;
-                        expr_ty locals;
-                } Exec;
-                
-                struct {
                         asdl_seq *names;
                 } Global;
                 
@@ -184,11 +178,11 @@
 };
 
 enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4,
-                  IfExp_kind=5, Dict_kind=6, ListComp_kind=7,
-                  GeneratorExp_kind=8, Yield_kind=9, Compare_kind=10,
-                  Call_kind=11, Repr_kind=12, Num_kind=13, Str_kind=14,
-                  Attribute_kind=15, Subscript_kind=16, Name_kind=17,
-                  List_kind=18, Tuple_kind=19};
+                  IfExp_kind=5, Dict_kind=6, Set_kind=7, ListComp_kind=8,
+                  GeneratorExp_kind=9, Yield_kind=10, Compare_kind=11,
+                  Call_kind=12, Num_kind=13, Str_kind=14, Ellipsis_kind=15,
+                  Attribute_kind=16, Subscript_kind=17, Name_kind=18,
+                  List_kind=19, Tuple_kind=20};
 struct _expr {
         enum _expr_kind kind;
         union {
@@ -225,6 +219,10 @@
                 } Dict;
                 
                 struct {
+                        asdl_seq *elts;
+                } Set;
+                
+                struct {
                         expr_ty elt;
                         asdl_seq *generators;
                 } ListComp;
@@ -253,10 +251,6 @@
                 } Call;
                 
                 struct {
-                        expr_ty value;
-                } Repr;
-                
-                struct {
                         object n;
                 } Num;
                 
@@ -296,7 +290,7 @@
         int col_offset;
 };
 
-enum _slice_kind {Ellipsis_kind=1, Slice_kind=2, ExtSlice_kind=3, Index_kind=4};
+enum _slice_kind {Slice_kind=1, ExtSlice_kind=2, Index_kind=3};
 struct _slice {
         enum _slice_kind kind;
         union {
@@ -334,8 +328,10 @@
 struct _arguments {
         asdl_seq *args;
         identifier vararg;
+        asdl_seq *kwonlyargs;
         identifier kwarg;
         asdl_seq *defaults;
+        asdl_seq *kw_defaults;
 };
 
 struct _keyword {
@@ -385,8 +381,6 @@
 stmt_ty Import(asdl_seq * names, int lineno, int col_offset, PyArena *arena);
 stmt_ty ImportFrom(identifier module, asdl_seq * names, int level, int lineno,
                    int col_offset, PyArena *arena);
-stmt_ty Exec(expr_ty body, expr_ty globals, expr_ty locals, int lineno, int
-             col_offset, PyArena *arena);
 stmt_ty Global(asdl_seq * names, int lineno, int col_offset, PyArena *arena);
 stmt_ty Expr(expr_ty value, int lineno, int col_offset, PyArena *arena);
 stmt_ty Pass(int lineno, int col_offset, PyArena *arena);
@@ -404,6 +398,7 @@
               col_offset, PyArena *arena);
 expr_ty Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset,
              PyArena *arena);
+expr_ty Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena);
 expr_ty ListComp(expr_ty elt, asdl_seq * generators, int lineno, int
                  col_offset, PyArena *arena);
 expr_ty GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int
@@ -414,9 +409,9 @@
 expr_ty Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty
              starargs, expr_ty kwargs, int lineno, int col_offset, PyArena
              *arena);
-expr_ty Repr(expr_ty value, int lineno, int col_offset, PyArena *arena);
 expr_ty Num(object n, int lineno, int col_offset, PyArena *arena);
 expr_ty Str(string s, int lineno, int col_offset, PyArena *arena);
+expr_ty Ellipsis(int lineno, int col_offset, PyArena *arena);
 expr_ty Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int
                   lineno, int col_offset, PyArena *arena);
 expr_ty Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int
@@ -427,7 +422,6 @@
              PyArena *arena);
 expr_ty Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset,
               PyArena *arena);
-slice_ty Ellipsis(PyArena *arena);
 slice_ty Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena);
 slice_ty ExtSlice(asdl_seq * dims, PyArena *arena);
 slice_ty Index(expr_ty value, PyArena *arena);
@@ -435,8 +429,9 @@
                                PyArena *arena);
 excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body, int
                                lineno, int col_offset, PyArena *arena);
-arguments_ty arguments(asdl_seq * args, identifier vararg, identifier kwarg,
-                       asdl_seq * defaults, PyArena *arena);
+arguments_ty arguments(asdl_seq * args, identifier vararg, asdl_seq *
+                       kwonlyargs, identifier kwarg, asdl_seq * defaults,
+                       asdl_seq * kw_defaults, PyArena *arena);
 keyword_ty keyword(identifier arg, expr_ty value, PyArena *arena);
 alias_ty alias(identifier name, identifier asname, PyArena *arena);
 

Modified: python/branches/p3yk-noslice/Include/abstract.h
==============================================================================
--- python/branches/p3yk-noslice/Include/abstract.h	(original)
+++ python/branches/p3yk-noslice/Include/abstract.h	Fri Dec 15 05:21:50 2006
@@ -288,9 +288,10 @@
 
        */
 
+       /* Declared elsewhere
+
      PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
 
-       /*
 	 Determine if the object, o, is callable.  Return 1 if the
 	 object is callable and 0 otherwise.
 

Modified: python/branches/p3yk-noslice/Include/code.h
==============================================================================
--- python/branches/p3yk-noslice/Include/code.h	(original)
+++ python/branches/p3yk-noslice/Include/code.h	Fri Dec 15 05:21:50 2006
@@ -10,6 +10,7 @@
 typedef struct {
     PyObject_HEAD
     int co_argcount;		/* #arguments, except *args */
+    int co_kwonlyargcount;	/* #keyword only arguments */
     int co_nlocals;		/* #local variables */
     int co_stacksize;		/* #entries needed for evaluation stack */
     int co_flags;		/* CO_..., see below */
@@ -63,8 +64,9 @@
 
 /* Public interface */
 PyAPI_FUNC(PyCodeObject *) PyCode_New(
-	int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
-	PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); 
+	int, int, int, int, int, PyObject *, PyObject *,
+	PyObject *, PyObject *, PyObject *, PyObject *,
+	PyObject *, PyObject *, int, PyObject *); 
         /* same as struct above */
 PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
 

Modified: python/branches/p3yk-noslice/Include/eval.h
==============================================================================
--- python/branches/p3yk-noslice/Include/eval.h	(original)
+++ python/branches/p3yk-noslice/Include/eval.h	Fri Dec 15 05:21:50 2006
@@ -15,7 +15,7 @@
 					PyObject **args, int argc,
 					PyObject **kwds, int kwdc,
 					PyObject **defs, int defc,
-					PyObject *closure);
+					PyObject *kwdefs, PyObject *closure);
 
 PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
 

Modified: python/branches/p3yk-noslice/Include/funcobject.h
==============================================================================
--- python/branches/p3yk-noslice/Include/funcobject.h	(original)
+++ python/branches/p3yk-noslice/Include/funcobject.h	Fri Dec 15 05:21:50 2006
@@ -23,6 +23,7 @@
     PyObject *func_code;	/* A code object */
     PyObject *func_globals;	/* A dictionary (other mappings won't do) */
     PyObject *func_defaults;	/* NULL or a tuple */
+    PyObject *func_kwdefaults;	/* NULL or a dict */
     PyObject *func_closure;	/* NULL or a tuple of cell objects */
     PyObject *func_doc;		/* The __doc__ attribute, can be anything */
     PyObject *func_name;	/* The __name__ attribute, a string object */
@@ -47,6 +48,8 @@
 PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *);
 PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *);
+PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
 PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
 
@@ -60,6 +63,8 @@
 	(((PyFunctionObject *)func) -> func_module)
 #define PyFunction_GET_DEFAULTS(func) \
 	(((PyFunctionObject *)func) -> func_defaults)
+#define PyFunction_GET_KW_DEFAULTS(func) \
+	(((PyFunctionObject *)func) -> func_kwdefaults)
 #define PyFunction_GET_CLOSURE(func) \
 	(((PyFunctionObject *)func) -> func_closure)
 

Modified: python/branches/p3yk-noslice/Include/graminit.h
==============================================================================
--- python/branches/p3yk-noslice/Include/graminit.h	(original)
+++ python/branches/p3yk-noslice/Include/graminit.h	Fri Dec 15 05:21:50 2006
@@ -31,54 +31,53 @@
 #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 assert_stmt 289
+#define compound_stmt 290
+#define if_stmt 291
+#define while_stmt 292
+#define for_stmt 293
+#define try_stmt 294
+#define with_stmt 295
+#define with_var 296
+#define except_clause 297
+#define suite 298
+#define testlist_safe 299
+#define old_test 300
+#define old_lambdef 301
+#define test 302
+#define or_test 303
+#define and_test 304
+#define not_test 305
+#define comparison 306
+#define comp_op 307
+#define expr 308
+#define xor_expr 309
+#define and_expr 310
+#define shift_expr 311
+#define arith_expr 312
+#define term 313
+#define factor 314
+#define power 315
+#define atom 316
+#define listmaker 317
+#define testlist_gexp 318
+#define lambdef 319
+#define trailer 320
+#define subscriptlist 321
+#define subscript 322
+#define sliceop 323
+#define exprlist 324
+#define testlist 325
+#define dictsetmaker 326
+#define classdef 327
+#define arglist 328
+#define argument 329
+#define list_iter 330
+#define list_for 331
+#define list_if 332
+#define gen_iter 333
+#define gen_for 334
+#define gen_if 335
+#define testlist1 336
+#define encoding_decl 337
+#define yield_expr 338

Modified: python/branches/p3yk-noslice/Include/iterobject.h
==============================================================================
--- python/branches/p3yk-noslice/Include/iterobject.h	(original)
+++ python/branches/p3yk-noslice/Include/iterobject.h	Fri Dec 15 05:21:50 2006
@@ -16,6 +16,9 @@
 #define PyCallIter_Check(op) ((op)->ob_type == &PyCallIter_Type)
 
 PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
+
+PyObject* _PyZip_CreateIter(PyObject* args);
+
 #ifdef __cplusplus
 }
 #endif

Modified: python/branches/p3yk-noslice/Include/modsupport.h
==============================================================================
--- python/branches/p3yk-noslice/Include/modsupport.h	(original)
+++ python/branches/p3yk-noslice/Include/modsupport.h	Fri Dec 15 05:21:50 2006
@@ -24,7 +24,7 @@
 #endif
 
 PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
-PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
+PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
                                                   const char *, char **, ...);
 PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);

Modified: python/branches/p3yk-noslice/Include/object.h
==============================================================================
--- python/branches/p3yk-noslice/Include/object.h	(original)
+++ python/branches/p3yk-noslice/Include/object.h	Fri Dec 15 05:21:50 2006
@@ -160,7 +160,7 @@
 	unaryfunc nb_negative;
 	unaryfunc nb_positive;
 	unaryfunc nb_absolute;
-	inquiry nb_nonzero;
+	inquiry nb_bool;
 	unaryfunc nb_invert;
 	binaryfunc nb_lshift;
 	binaryfunc nb_rshift;
@@ -379,6 +379,7 @@
 PyAPI_FUNC(int) PyObject_Compare(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int);
 PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int);
+PyAPI_FUNC(PyObject *) Py_CmpToRich(int op, int cmp);
 PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
 PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *);
 PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
@@ -394,7 +395,6 @@
 PyAPI_FUNC(int) PyObject_IsTrue(PyObject *);
 PyAPI_FUNC(int) PyObject_Not(PyObject *);
 PyAPI_FUNC(int) PyCallable_Check(PyObject *);
-PyAPI_FUNC(int) PyNumber_CoerceEx(PyObject **, PyObject **);
 
 PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *);
 

Modified: python/branches/p3yk-noslice/Include/opcode.h
==============================================================================
--- python/branches/p3yk-noslice/Include/opcode.h	(original)
+++ python/branches/p3yk-noslice/Include/opcode.h	Fri Dec 15 05:21:50 2006
@@ -18,7 +18,6 @@
 #define UNARY_POSITIVE	10
 #define UNARY_NEGATIVE	11
 #define UNARY_NOT	12
-#define UNARY_CONVERT	13
 
 #define UNARY_INVERT	15
 
@@ -67,7 +66,7 @@
 #define LOAD_LOCALS	82
 #define RETURN_VALUE	83
 #define IMPORT_STAR	84
-#define EXEC_STMT	85
+
 #define YIELD_VALUE	86
 #define POP_BLOCK	87
 #define END_FINALLY	88
@@ -89,11 +88,12 @@
 #define LOAD_NAME	101	/* Index in name list */
 #define BUILD_TUPLE	102	/* Number of tuple items */
 #define BUILD_LIST	103	/* Number of list items */
-#define BUILD_MAP	104	/* Always zero for now */
-#define LOAD_ATTR	105	/* Index in name list */
-#define COMPARE_OP	106	/* Comparison operator */
-#define IMPORT_NAME	107	/* Index in name list */
-#define IMPORT_FROM	108	/* Index in name list */
+#define BUILD_SET	104     /* Number of set items */
+#define BUILD_MAP	105	/* Always zero for now */
+#define LOAD_ATTR	106	/* Index in name list */
+#define COMPARE_OP	107	/* Comparison operator */
+#define IMPORT_NAME	108	/* Index in name list */
+#define IMPORT_FROM	109	/* Index in name list */
 
 #define JUMP_FORWARD	110	/* Number of bytes to skip */
 #define JUMP_IF_FALSE	111	/* "" */

Modified: python/branches/p3yk-noslice/Include/pyport.h
==============================================================================
--- python/branches/p3yk-noslice/Include/pyport.h	(original)
+++ python/branches/p3yk-noslice/Include/pyport.h	Fri Dec 15 05:21:50 2006
@@ -3,6 +3,10 @@
 
 #include "pyconfig.h" /* include for defines */
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 /**************************************************************************
 Symbols and macros to supply platform-independent interfaces to basic
 C language & library operations whose spellings vary across platforms.
@@ -126,7 +130,7 @@
  * Py_ssize_t on the platform.
  */
 #ifndef PY_FORMAT_SIZE_T
-#   if SIZEOF_SIZE_T == SIZEOF_INT
+#   if SIZEOF_SIZE_T == SIZEOF_INT && !defined(__APPLE__)
 #       define PY_FORMAT_SIZE_T ""
 #   elif SIZEOF_SIZE_T == SIZEOF_LONG
 #       define PY_FORMAT_SIZE_T "l"
@@ -745,6 +749,15 @@
 #define Py_GCC_ATTRIBUTE(x) __attribute__(x)
 #endif
 
+/*
+ * Add PyArg_ParseTuple format where available.
+ */
+#ifdef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
+#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2)))
+#else
+#define Py_FORMAT_PARSETUPLE(func,p1,p2)
+#endif
+
 /* Eliminate end-of-loop code not reached warnings from SunPro C
  * when using do{...}while(0) macros
  */

Modified: python/branches/p3yk-noslice/Include/symtable.h
==============================================================================
--- python/branches/p3yk-noslice/Include/symtable.h	(original)
+++ python/branches/p3yk-noslice/Include/symtable.h	Fri Dec 15 05:21:50 2006
@@ -88,11 +88,9 @@
 #define FREE 4
 #define CELL 5
 
-/* The following three names are used for the ste_unoptimized bit field */
+/* The following two names are used for the ste_unoptimized bit field */
 #define OPT_IMPORT_STAR 1
-#define OPT_EXEC 2
-#define OPT_BARE_EXEC 4
-#define OPT_TOPLEVEL 8  /* top-level names, including eval and exec */
+#define OPT_TOPLEVEL 2  /* top-level names, including eval and exec */
 
 #define GENERATOR 1
 #define GENERATOR_EXPRESSION 2

Modified: python/branches/p3yk-noslice/Include/token.h
==============================================================================
--- python/branches/p3yk-noslice/Include/token.h	(original)
+++ python/branches/p3yk-noslice/Include/token.h	Fri Dec 15 05:21:50 2006
@@ -32,7 +32,7 @@
 #define EQUAL		22
 #define DOT		23
 #define PERCENT		24
-#define BACKQUOTE	25
+/* #define BACKQUOTE	25 */
 #define LBRACE		26
 #define RBRACE		27
 #define EQEQUAL		28

Modified: python/branches/p3yk-noslice/Lib/Bastion.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/Bastion.py	(original)
+++ python/branches/p3yk-noslice/Lib/Bastion.py	Fri Dec 15 05:21:50 2006
@@ -164,7 +164,7 @@
     else:
         print "accessible"
     \n"""
-    exec testcode
+    exec(testcode)
     print '='*20, "Using rexec:", '='*20
     import rexec
     r = rexec.RExec()

Modified: python/branches/p3yk-noslice/Lib/ConfigParser.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ConfigParser.py	(original)
+++ python/branches/p3yk-noslice/Lib/ConfigParser.py	Fri Dec 15 05:21:50 2006
@@ -199,11 +199,11 @@
         self.line = line
 
 
-
 class RawConfigParser:
-    def __init__(self, defaults=None):
-        self._sections = {}
-        self._defaults = {}
+    def __init__(self, defaults=None, dict_type=dict):
+        self._dict = dict_type
+        self._sections = self._dict()
+        self._defaults = self._dict()
         if defaults:
             for key, value in defaults.items():
                 self._defaults[self.optionxform(key)] = value
@@ -224,7 +224,7 @@
         """
         if section in self._sections:
             raise DuplicateSectionError(section)
-        self._sections[section] = {}
+        self._sections[section] = self._dict()
 
     def has_section(self, section):
         """Indicate whether the named section is present in the configuration.
@@ -307,7 +307,7 @@
         except KeyError:
             if section != DEFAULTSECT:
                 raise NoSectionError(section)
-            d2 = {}
+            d2 = self._dict()
         d = self._defaults.copy()
         d.update(d2)
         if "__name__" in d:
@@ -453,7 +453,8 @@
                     elif sectname == DEFAULTSECT:
                         cursect = self._defaults
                     else:
-                        cursect = {'__name__': sectname}
+                        cursect = self._dict()
+                        cursect['__name__'] = sectname
                         self._sections[sectname] = cursect
                     # So sections can't start with a continuation line
                     optname = None

Modified: python/branches/p3yk-noslice/Lib/Queue.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/Queue.py	(original)
+++ python/branches/p3yk-noslice/Lib/Queue.py	Fri Dec 15 05:21:50 2006
@@ -26,7 +26,7 @@
         self._init(maxsize)
         # mutex must be held whenever the queue is mutating.  All methods
         # that acquire mutex must release it before returning.  mutex
-        # is shared between the two conditions, so acquiring and
+        # is shared between the three conditions, so acquiring and
         # releasing the conditions also acquires and releases mutex.
         self.mutex = threading.Lock()
         # Notify not_empty whenever an item is added to the queue; a

Modified: python/branches/p3yk-noslice/Lib/SimpleXMLRPCServer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/SimpleXMLRPCServer.py	(original)
+++ python/branches/p3yk-noslice/Lib/SimpleXMLRPCServer.py	Fri Dec 15 05:21:50 2006
@@ -264,8 +264,9 @@
                                        encoding=self.encoding)
         except:
             # report exception back to server
+            exc_type, exc_value, exc_tb = sys.exc_info()
             response = xmlrpclib.dumps(
-                xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2]),
+                xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)),
                 encoding=self.encoding, allow_none=self.allow_none,
                 )
 
@@ -364,9 +365,10 @@
                      'faultString' : fault.faultString}
                     )
             except:
+                exc_type, exc_value, exc_tb = sys.exc_info()
                 results.append(
                     {'faultCode' : 1,
-                     'faultString' : "%s:%s" % sys.exc_info()[:2]}
+                     'faultString' : "%s:%s" % (exc_type, exc_value)}
                     )
         return results
 

Modified: python/branches/p3yk-noslice/Lib/StringIO.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/StringIO.py	(original)
+++ python/branches/p3yk-noslice/Lib/StringIO.py	Fri Dec 15 05:21:50 2006
@@ -116,7 +116,7 @@
         _complain_ifclosed(self.closed)
         return self.pos
 
-    def read(self, n = -1):
+    def read(self, n=None):
         """Read at most size bytes from the file
         (less if the read hits EOF before obtaining size bytes).
 
@@ -128,6 +128,8 @@
         if self.buflist:
             self.buf += ''.join(self.buflist)
             self.buflist = []
+        if n is None:
+            n = -1
         if n < 0:
             newpos = self.len
         else:

Modified: python/branches/p3yk-noslice/Lib/UserDict.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/UserDict.py	(original)
+++ python/branches/p3yk-noslice/Lib/UserDict.py	Fri Dec 15 05:21:50 2006
@@ -8,11 +8,16 @@
         if len(kwargs):
             self.update(kwargs)
     def __repr__(self): return repr(self.data)
-    def __cmp__(self, dict):
+    def __eq__(self, dict):
         if isinstance(dict, UserDict):
-            return cmp(self.data, dict.data)
+            return self.data == dict.data
         else:
-            return cmp(self.data, dict)
+            return self.data == dict
+    def __ne__(self, dict):
+        if isinstance(dict, UserDict):
+            return self.data != dict.data
+        else:
+            return self.data != dict
     def __len__(self): return len(self.data)
     def __getitem__(self, key):
         if key in self.data:
@@ -162,11 +167,13 @@
             return default
     def __repr__(self):
         return repr(dict(self.iteritems()))
-    def __cmp__(self, other):
-        if other is None:
-            return 1
+    def __eq__(self, other):
+        if isinstance(other, DictMixin):
+            other = dict(other.iteritems())
+        return dict(self.iteritems()) == other
+    def __ne__(self, other):
         if isinstance(other, DictMixin):
             other = dict(other.iteritems())
-        return cmp(dict(self.iteritems()), other)
+        return dict(self.iteritems()) != other
     def __len__(self):
         return len(self.keys())

Modified: python/branches/p3yk-noslice/Lib/UserString.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/UserString.py	(original)
+++ python/branches/p3yk-noslice/Lib/UserString.py	Fri Dec 15 05:21:50 2006
@@ -25,11 +25,37 @@
     def __complex__(self): return complex(self.data)
     def __hash__(self): return hash(self.data)
 
-    def __cmp__(self, string):
+    def __eq__(self, string):
         if isinstance(string, UserString):
-            return cmp(self.data, string.data)
+            return self.data == string.data
         else:
-            return cmp(self.data, string)
+            return self.data == string
+    def __ne__(self, string):
+        if isinstance(string, UserString):
+            return self.data != string.data
+        else:
+            return self.data != string
+    def __lt__(self, string):
+        if isinstance(string, UserString):
+            return self.data < string.data
+        else:
+            return self.data < string
+    def __le__(self, string):
+        if isinstance(string, UserString):
+            return self.data <= string.data
+        else:
+            return self.data <= string
+    def __gt__(self, string):
+        if isinstance(string, UserString):
+            return self.data > string.data
+        else:
+            return self.data > string
+    def __ge__(self, string):
+        if isinstance(string, UserString):
+            return self.data >= string.data
+        else:
+            return self.data >= string
+
     def __contains__(self, char):
         return char in self.data
 

Modified: python/branches/p3yk-noslice/Lib/_strptime.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/_strptime.py	(original)
+++ python/branches/p3yk-noslice/Lib/_strptime.py	Fri Dec 15 05:21:50 2006
@@ -306,7 +306,7 @@
         _cache_lock.release()
     found = format_regex.match(data_string)
     if not found:
-        raise ValueError("time data did not match format:  data=%s  fmt=%s" %
+        raise ValueError("time data %r does not match format %r" %
                          (data_string, format))
     if len(data_string) != found.end():
         raise ValueError("unconverted data remains: %s" %

Modified: python/branches/p3yk-noslice/Lib/atexit.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/atexit.py	(original)
+++ python/branches/p3yk-noslice/Lib/atexit.py	Fri Dec 15 05:21:50 2006
@@ -40,8 +40,11 @@
     func - function to be called at exit
     targs - optional arguments to pass to func
     kargs - optional keyword arguments to pass to func
+
+    func is returned to facilitate usage as a decorator.
     """
     _exithandlers.append((func, targs, kargs))
+    return func
 
 if hasattr(sys, "exitfunc"):
     # Assume it's another registered exit function - append it to our list

Modified: python/branches/p3yk-noslice/Lib/base64.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/base64.py	(original)
+++ python/branches/p3yk-noslice/Lib/base64.py	Fri Dec 15 05:21:50 2006
@@ -308,7 +308,7 @@
 
 
 def encodestring(s):
-    """Encode a string."""
+    """Encode a string into multiple lines of base-64 data."""
     pieces = []
     for i in range(0, len(s), MAXBINSIZE):
         chunk = s[i : i + MAXBINSIZE]

Modified: python/branches/p3yk-noslice/Lib/bdb.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bdb.py	(original)
+++ python/branches/p3yk-noslice/Lib/bdb.py	Fri Dec 15 05:21:50 2006
@@ -362,7 +362,7 @@
             cmd = cmd+'\n'
         try:
             try:
-                exec cmd in globals, locals
+                exec(cmd, globals, locals)
             except BdbQuit:
                 pass
         finally:

Modified: python/branches/p3yk-noslice/Lib/bsddb/__init__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/__init__.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/__init__.py	Fri Dec 15 05:21:50 2006
@@ -72,7 +72,7 @@
 if sys.version >= '2.3':
     import UserDict
     from weakref import ref
-    exec """
+    exec("""
 class _iter_mixin(UserDict.DictMixin):
     def _make_iter_cursor(self):
         cur = _DeadlockWrap(self.db.cursor)
@@ -145,7 +145,7 @@
         except _bsddb.DBCursorClosedError:
             # the database was modified during iteration.  abort.
             return
-"""
+""")
 else:
     class _iter_mixin: pass
 

Modified: python/branches/p3yk-noslice/Lib/bsddb/dbtables.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/dbtables.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/dbtables.py	Fri Dec 15 05:21:50 2006
@@ -453,7 +453,7 @@
                              # error
                             dataitem = None
                         dataitem = mappings[column](dataitem)
-                        if dataitem <> None:
+                        if dataitem != None:
                             self.db.put(
                                 _data_key(table, column, rowid),
                                 dataitem, txn=txn)

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py	Fri Dec 15 05:21:50 2006
@@ -697,7 +697,7 @@
         for log in logs:
             if verbose:
                 print 'log file: ' + log
-        if db.version >= (4,2):
+        if db.version() >= (4,2):
             logs = self.env.log_archive(db.DB_ARCH_REMOVE)
             assert not logs
 

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_compat.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_compat.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_compat.py	Fri Dec 15 05:21:50 2006
@@ -120,7 +120,7 @@
             try:
                 rec = f.next()
             except KeyError:
-                assert rec == f.last(), 'Error, last <> last!'
+                assert rec == f.last(), 'Error, last != last!'
                 f.previous()
                 break
             if verbose:

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py	Fri Dec 15 05:21:50 2006
@@ -69,6 +69,10 @@
         self.db.close()
         self.env.close()
 
+    def test03_dbobj_type_before_open(self):
+        # Ensure this doesn't cause a segfault.
+        self.assertRaises(db.DBInvalidArgError, db.DB().type)
+
 #----------------------------------------------------------------------
 
 def test_suite():

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py	Fri Dec 15 05:21:50 2006
@@ -23,11 +23,24 @@
 # We want the objects to be comparable so we can test dbshelve.values
 # later on.
 class DataClass:
+
     def __init__(self):
         self.value = random.random()
 
-    def __cmp__(self, other):
-        return cmp(self.value, other)
+    def __repr__(self):
+        return "DataClass(%r)" % self.value
+
+    def __eq__(self, other):
+        value = self.value
+        if isinstance(other, DataClass):
+            other = other.value
+        return value == other
+
+    def __lt__(self, other):
+        value = self.value
+        if isinstance(other, DataClass):
+            other = other.value
+        return value < other
 
 class DBShelveTestCase(unittest.TestCase):
     def setUp(self):
@@ -103,11 +116,10 @@
                 print "%s: %s" % (key, value)
             self.checkrec(key, value)
 
-        dbvalues = d.values()
+        dbvalues = sorted(d.values(), key=lambda x: (str(type(x)), x))
         assert len(dbvalues) == len(d.keys())
-        values.sort()
-        dbvalues.sort()
-        assert values == dbvalues
+        values.sort(key=lambda x: (str(type(x)), x))
+        assert values == dbvalues, "%r != %r" % (values, dbvalues)
 
         items = d.items()
         assert len(items) == len(values)

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py	Fri Dec 15 05:21:50 2006
@@ -30,7 +30,7 @@
         try:
             os.remove(self.filename)
         except OSError, e:
-            if e.errno <> errno.EEXIST: raise
+            if e.errno != errno.EEXIST: raise
 
     def test01_basic(self):
         d = db.DB()

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py	Fri Dec 15 05:21:50 2006
@@ -58,7 +58,7 @@
         try:
             os.mkdir(homeDir)
         except OSError, e:
-            if e.errno <> errno.EEXIST: raise
+            if e.errno != errno.EEXIST: raise
         self.env = db.DBEnv()
         self.setEnvOpts()
         self.env.open(homeDir, self.envflags | db.DB_CREATE)

Modified: python/branches/p3yk-noslice/Lib/cProfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/cProfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/cProfile.py	Fri Dec 15 05:21:50 2006
@@ -137,7 +137,7 @@
     def runctx(self, cmd, globals, locals):
         self.enable()
         try:
-            exec cmd in globals, locals
+            exec(cmd, globals, locals)
         finally:
             self.disable()
         return self

Modified: python/branches/p3yk-noslice/Lib/cgi.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/cgi.py	(original)
+++ python/branches/p3yk-noslice/Lib/cgi.py	Fri Dec 15 05:21:50 2006
@@ -799,8 +799,10 @@
     form.dict == {key: [val, val, ...], ...}
 
     """
-    def __init__(self, environ=os.environ):
-        self.dict = self.data = parse(environ=environ)
+    def __init__(self, environ=os.environ, keep_blank_values=0, strict_parsing=0):
+        self.dict = self.data = parse(environ=environ,
+                                      keep_blank_values=keep_blank_values,
+                                      strict_parsing=strict_parsing)
         self.query_string = environ['QUERY_STRING']
 
 
@@ -910,7 +912,7 @@
         print_environ(environ)
         print_environ_usage()
         def f():
-            exec "testing print_exception() -- <I>italics?</I>"
+            exec("testing print_exception() -- <I>italics?</I>")
         def g(f=f):
             f()
         print "<H3>What follows is a test, not an actual exception:</H3>"

Modified: python/branches/p3yk-noslice/Lib/code.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/code.py	(original)
+++ python/branches/p3yk-noslice/Lib/code.py	Fri Dec 15 05:21:50 2006
@@ -100,7 +100,7 @@
 
         """
         try:
-            exec code in self.locals
+            exec(code, self.locals)
         except SystemExit:
             raise
         except:

Modified: python/branches/p3yk-noslice/Lib/codecs.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/codecs.py	(original)
+++ python/branches/p3yk-noslice/Lib/codecs.py	Fri Dec 15 05:21:50 2006
@@ -329,6 +329,12 @@
         """
         return getattr(self.stream, name)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, tb):
+        self.stream.close()
+
 ###
 
 class StreamReader(Codec):
@@ -568,6 +574,12 @@
         """
         return getattr(self.stream, name)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, tb):
+        self.stream.close()
+
 ###
 
 class StreamReaderWriter:
@@ -641,6 +653,14 @@
         """
         return getattr(self.stream, name)
 
+    # these are needed to make "with codecs.open(...)" work properly
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, tb):
+        self.stream.close()
+
 ###
 
 class StreamRecoder:
@@ -751,6 +771,12 @@
         """
         return getattr(self.stream, name)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, tb):
+        self.stream.close()
+
 ### Shortcuts
 
 def open(filename, mode='rb', encoding=None, errors='strict', buffering=1):
@@ -824,9 +850,10 @@
     """
     if file_encoding is None:
         file_encoding = data_encoding
-    info = lookup(data_encoding)
-    sr = StreamRecoder(file, info.encode, info.decode,
-                       info.streamreader, info.streamwriter, errors)
+    data_info = lookup(data_encoding)
+    file_info = lookup(file_encoding)
+    sr = StreamRecoder(file, data_info.encode, data_info.decode,
+                       file_info.streamreader, file_info.streamwriter, errors)
     # Add attributes to simplify introspection
     sr.data_encoding = data_encoding
     sr.file_encoding = file_encoding

Modified: python/branches/p3yk-noslice/Lib/colorsys.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/colorsys.py	(original)
+++ python/branches/p3yk-noslice/Lib/colorsys.py	Fri Dec 15 05:21:50 2006
@@ -117,7 +117,8 @@
     p = v*(1.0 - s)
     q = v*(1.0 - s*f)
     t = v*(1.0 - s*(1.0-f))
-    if i%6 == 0: return v, t, p
+    i = i%6
+    if i == 0: return v, t, p
     if i == 1: return q, v, p
     if i == 2: return p, v, t
     if i == 3: return p, q, v

Modified: python/branches/p3yk-noslice/Lib/compiler/ast.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/ast.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/ast.py	Fri Dec 15 05:21:50 2006
@@ -203,20 +203,6 @@
     def __repr__(self):
         return "AugAssign(%s, %s, %s)" % (repr(self.node), repr(self.op), repr(self.expr))
 
-class Backquote(Node):
-    def __init__(self, expr, lineno=None):
-        self.expr = expr
-        self.lineno = lineno
-
-    def getChildren(self):
-        return self.expr,
-
-    def getChildNodes(self):
-        return self.expr,
-
-    def __repr__(self):
-        return "Backquote(%s)" % (repr(self.expr),)
-
 class Bitand(Node):
     def __init__(self, nodes, lineno=None):
         self.nodes = nodes
@@ -441,45 +427,6 @@
     def __repr__(self):
         return "Div((%s, %s))" % (repr(self.left), repr(self.right))
 
-class Ellipsis(Node):
-    def __init__(self, lineno=None):
-        self.lineno = lineno
-
-    def getChildren(self):
-        return ()
-
-    def getChildNodes(self):
-        return ()
-
-    def __repr__(self):
-        return "Ellipsis()"
-
-class Exec(Node):
-    def __init__(self, expr, locals, globals, lineno=None):
-        self.expr = expr
-        self.locals = locals
-        self.globals = globals
-        self.lineno = lineno
-
-    def getChildren(self):
-        children = []
-        children.append(self.expr)
-        children.append(self.locals)
-        children.append(self.globals)
-        return tuple(children)
-
-    def getChildNodes(self):
-        nodelist = []
-        nodelist.append(self.expr)
-        if self.locals is not None:
-            nodelist.append(self.locals)
-        if self.globals is not None:
-            nodelist.append(self.globals)
-        return tuple(nodelist)
-
-    def __repr__(self):
-        return "Exec(%s, %s, %s)" % (repr(self.expr), repr(self.locals), repr(self.globals))
-
 class FloorDiv(Node):
     def __init__(self, (left, right), lineno=None):
         self.left = left
@@ -540,11 +487,12 @@
         return "From(%s, %s, %s)" % (repr(self.modname), repr(self.names), repr(self.level))
 
 class Function(Node):
-    def __init__(self, decorators, name, argnames, defaults, flags, doc, code, lineno=None):
+    def __init__(self, decorators, name, argnames, defaults, kwonlyargs, flags, doc, code, lineno=None):
         self.decorators = decorators
         self.name = name
         self.argnames = argnames
         self.defaults = defaults
+        self.kwonlyargs = kwonlyargs
         self.flags = flags
         self.doc = doc
         self.code = code
@@ -556,13 +504,13 @@
             self.kwargs = 1
 
 
-
     def getChildren(self):
         children = []
         children.append(self.decorators)
         children.append(self.name)
         children.append(self.argnames)
         children.extend(flatten(self.defaults))
+        children.append(self.kwonlyargs)
         children.append(self.flags)
         children.append(self.doc)
         children.append(self.code)
@@ -577,7 +525,7 @@
         return tuple(nodelist)
 
     def __repr__(self):
-        return "Function(%s, %s, %s, %s, %s, %s, %s)" % (repr(self.decorators), repr(self.name), repr(self.argnames), repr(self.defaults), repr(self.flags), repr(self.doc), repr(self.code))
+        return "Function(%s, %s, %s, %s, %s, %s, %s, %s)" % (repr(self.decorators), repr(self.name), repr(self.argnames), repr(self.defaults), repr(self.kwonlyargs), repr(self.flags), repr(self.doc), repr(self.code))
 
 class GenExpr(Node):
     def __init__(self, code, lineno=None):
@@ -585,6 +533,8 @@
         self.lineno = lineno
         self.argnames = ['.0']
         self.varargs = self.kwargs = None
+        self.kwonlyargs = ()
+
 
     def getChildren(self):
         return self.code,
@@ -603,7 +553,6 @@
         self.lineno = lineno
         self.is_outmost = False
 
-
     def getChildren(self):
         children = []
         children.append(self.assign)
@@ -767,9 +716,10 @@
         return "Keyword(%s, %s)" % (repr(self.name), repr(self.expr))
 
 class Lambda(Node):
-    def __init__(self, argnames, defaults, flags, code, lineno=None):
+    def __init__(self, argnames, defaults, kwonlyargs, flags, code, lineno=None):
         self.argnames = argnames
         self.defaults = defaults
+        self.kwonlyargs = kwonlyargs
         self.flags = flags
         self.code = code
         self.lineno = lineno
@@ -780,11 +730,11 @@
             self.kwargs = 1
 
 
-
     def getChildren(self):
         children = []
         children.append(self.argnames)
         children.extend(flatten(self.defaults))
+        children.append(self.kwonlyargs)
         children.append(self.flags)
         children.append(self.code)
         return tuple(children)
@@ -796,7 +746,7 @@
         return tuple(nodelist)
 
     def __repr__(self):
-        return "Lambda(%s, %s, %s, %s)" % (repr(self.argnames), repr(self.defaults), repr(self.flags), repr(self.code))
+        return "Lambda(%s, %s, %s, %s, %s)" % (repr(self.argnames), repr(self.defaults), repr(self.kwonlyargs), repr(self.flags), repr(self.code))
 
 class LeftShift(Node):
     def __init__(self, (left, right), lineno=None):
@@ -1105,6 +1055,22 @@
     def __repr__(self):
         return "RightShift((%s, %s))" % (repr(self.left), repr(self.right))
 
+class Set(Node):
+    def __init__(self, items, lineno=None):
+        self.items = items
+        self.lineno = lineno
+
+    def getChildren(self):
+        return tuple(flatten(self.items))
+
+    def getChildNodes(self):
+        nodelist = []
+        nodelist.extend(flatten_nodes(self.items))
+        return tuple(nodelist)
+
+    def __repr__(self):
+        return "Set(%s)" % (repr(self.items),)
+
 class Slice(Node):
     def __init__(self, expr, flags, lower, upper, lineno=None):
         self.expr = expr

Modified: python/branches/p3yk-noslice/Lib/compiler/pyassem.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/pyassem.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/pyassem.py	Fri Dec 15 05:21:50 2006
@@ -313,13 +313,15 @@
 class PyFlowGraph(FlowGraph):
     super_init = FlowGraph.__init__
 
-    def __init__(self, name, filename, args=(), optimized=0, klass=None):
+    def __init__(self, name, filename,
+                 args=(), kwonlyargs={}, optimized=0, klass=None):
         self.super_init()
         self.name = name
         self.filename = filename
         self.docstring = None
         self.args = args # XXX
         self.argcount = getArgCount(args)
+        self.kwonlyargs = kwonlyargs
         self.klass = klass
         if optimized:
             self.flags = CO_OPTIMIZED | CO_NEWLOCALS
@@ -595,7 +597,9 @@
         argcount = self.argcount
         if self.flags & CO_VARKEYWORDS:
             argcount = argcount - 1
-        return new.code(argcount, nlocals, self.stacksize, self.flags,
+        kwonlyargcount = len(self.kwonlyargs)
+        return new.code(argcount, kwonlyargcount,
+                        nlocals, self.stacksize, self.flags,
                         self.lnotab.getCode(), self.getConsts(),
                         tuple(self.names), tuple(self.varnames),
                         self.filename, self.name, self.lnotab.firstline,
@@ -751,7 +755,6 @@
         'PRINT_ITEM': -1,
         'RETURN_VALUE': -1,
         'YIELD_VALUE': -1,
-        'EXEC_STMT': -3,
         'BUILD_CLASS': -2,
         'STORE_NAME': -1,
         'STORE_ATTR': -2,
@@ -782,6 +785,8 @@
         return -count+1
     def BUILD_LIST(self, count):
         return -count+1
+    def BUILD_SET(self, count):
+        return -count+1
     def CALL_FUNCTION(self, argc):
         hi, lo = divmod(argc, 256)
         return -(lo + hi * 2)
@@ -792,7 +797,8 @@
     def CALL_FUNCTION_VAR_KW(self, argc):
         return self.CALL_FUNCTION(argc)-2
     def MAKE_FUNCTION(self, argc):
-        return -argc
+        hi, lo = divmod(argc, 256)
+        return -(lo + hi * 2)
     def MAKE_CLOSURE(self, argc):
         # XXX need to account for free variables too!
         return -argc

Modified: python/branches/p3yk-noslice/Lib/compiler/pycodegen.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/pycodegen.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/pycodegen.py	Fri Dec 15 05:21:50 2006
@@ -378,6 +378,12 @@
         walk(node.code, gen)
         gen.finish()
         self.set_lineno(node)
+        for keyword in node.kwonlyargs:
+            default = keyword.expr
+            if isinstance(default, ast.EmptyNode):
+                continue
+            self.emit('LOAD_CONST', keyword.name)
+            self.visit(default)
         for default in node.defaults:
             self.visit(default)
         self._makeClosure(gen, len(node.defaults))
@@ -571,12 +577,11 @@
     def visitListComp(self, node):
         self.set_lineno(node)
         # setup list
-        append = "$append%d" % self.__list_count
+        tmpname = "$list%d" % self.__list_count
         self.__list_count = self.__list_count + 1
         self.emit('BUILD_LIST', 0)
         self.emit('DUP_TOP')
-        self.emit('LOAD_ATTR', 'append')
-        self._implicitNameOp('STORE', append)
+        self._implicitNameOp('STORE', tmpname)
 
         stack = []
         for i, for_ in zip(range(len(node.quals)), node.quals):
@@ -588,10 +593,9 @@
                 self.visit(if_, cont)
             stack.insert(0, (start, cont, anchor))
 
-        self._implicitNameOp('LOAD', append)
+        self._implicitNameOp('LOAD', tmpname)
         self.visit(node.expr)
-        self.emit('CALL_FUNCTION', 1)
-        self.emit('POP_TOP')
+        self.emit('LIST_APPEND')
 
         for start, cont, anchor in stack:
             if cont:
@@ -602,7 +606,7 @@
                 self.nextBlock(skip_one)
             self.emit('JUMP_ABSOLUTE', start)
             self.startBlock(anchor)
-        self._implicitNameOp('DELETE', append)
+        self._implicitNameOp('DELETE', tmpname)
 
         self.__list_count = self.__list_count - 1
 
@@ -1026,18 +1030,6 @@
             self.emit('ROT_THREE')
             self.emit('STORE_SUBSCR')
 
-    def visitExec(self, node):
-        self.visit(node.expr)
-        if node.locals is None:
-            self.emit('LOAD_CONST', None)
-        else:
-            self.visit(node.locals)
-        if node.globals is None:
-            self.emit('DUP_TOP')
-        else:
-            self.visit(node.globals)
-        self.emit('EXEC_STMT')
-
     def visitCallFunc(self, node):
         pos = 0
         kw = 0
@@ -1163,9 +1155,6 @@
     def visitNot(self, node):
         return self.unaryOp(node, 'UNARY_NOT')
 
-    def visitBackquote(self, node):
-        return self.unaryOp(node, 'UNARY_CONVERT')
-
     # bit ops
 
     def bitOp(self, nodes, op):
@@ -1185,9 +1174,6 @@
 
     # object constructors
 
-    def visitEllipsis(self, node):
-        self.emit('LOAD_CONST', Ellipsis)
-
     def visitTuple(self, node):
         self.set_lineno(node)
         for elt in node.nodes:
@@ -1200,6 +1186,12 @@
             self.visit(elt)
         self.emit('BUILD_LIST', len(node.nodes))
 
+    def visitSet(self, node):
+        self.set_lineno(node)
+        for elt in node.items:
+            self.visit(elt)
+        self.emit('BUILD_SET', len(node.items))
+
     def visitSliceobj(self, node):
         for child in node.nodes:
             self.visit(child)
@@ -1288,7 +1280,9 @@
             name = func.name
 
         args, hasTupleArg = generateArgList(func.argnames)
+        kwonlyargs = generateKwonlyArgList(func.kwonlyargs)
         self.graph = pyassem.PyFlowGraph(name, func.filename, args,
+                                         kwonlyargs=kwonlyargs,
                                          optimized=1)
         self.isLambda = isLambda
         self.super_init()
@@ -1424,6 +1418,13 @@
             raise ValueError, "unexpect argument type:", elt
     return args + extra, count
 
+def generateKwonlyArgList(keywordOnlyArgs):
+    kwonlyargs = {}
+    for elt in keywordOnlyArgs:
+        assert isinstance(elt, ast.Keyword)
+        kwonlyargs[elt.name] = elt.expr
+    return kwonlyargs
+    
 def findOp(node):
     """Find the op (DELETE, LOAD, STORE) in an AssTuple tree"""
     v = OpFinder()

Modified: python/branches/p3yk-noslice/Lib/compiler/transformer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/transformer.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/transformer.py	Fri Dec 15 05:21:50 2006
@@ -111,9 +111,9 @@
         self._atom_dispatch = {token.LPAR: self.atom_lpar,
                                token.LSQB: self.atom_lsqb,
                                token.LBRACE: self.atom_lbrace,
-                               token.BACKQUOTE: self.atom_backquote,
                                token.NUMBER: self.atom_number,
                                token.STRING: self.atom_string,
+                               token.DOT: self.atom_ellipsis,
                                token.NAME: self.atom_name,
                                }
         self.encoding = None
@@ -250,9 +250,9 @@
         args = nodelist[-3][2]
 
         if args[0] == symbol.varargslist:
-            names, defaults, flags = self.com_arglist(args[1:])
+            names, defaults, kwonlyargs, flags = self.com_arglist(args[1:])
         else:
-            names = defaults = ()
+            names = defaults = kwonlyargs = ()
             flags = 0
         doc = self.get_docstring(nodelist[-1])
 
@@ -263,21 +263,23 @@
             assert isinstance(code, Stmt)
             assert isinstance(code.nodes[0], Discard)
             del code.nodes[0]
-        return Function(decorators, name, names, defaults, flags, doc, code,
-                     lineno=lineno)
+        return Function(decorators, name, names, defaults,
+                        kwonlyargs, flags, doc, code, lineno=lineno)
 
     def lambdef(self, nodelist):
         # lambdef: 'lambda' [varargslist] ':' test
         if nodelist[2][0] == symbol.varargslist:
-            names, defaults, flags = self.com_arglist(nodelist[2][1:])
+            names, defaults, kwonlyargs, flags = \
+                                self.com_arglist(nodelist[2][1:])
         else:
-            names = defaults = ()
+            names = defaults = kwonlyargs = ()
             flags = 0
 
         # code for lambda
         code = self.com_node(nodelist[-1])
 
-        return Lambda(names, defaults, flags, code, lineno=nodelist[1][2])
+        return Lambda(names, defaults, kwonlyargs,
+                      flags, code, lineno=nodelist[1][2])
     old_lambdef = lambdef
 
     def classdef(self, nodelist):
@@ -469,20 +471,6 @@
             names.append(nodelist[i][1])
         return Global(names, lineno=nodelist[0][2])
 
-    def exec_stmt(self, nodelist):
-        # exec_stmt: 'exec' expr ['in' expr [',' expr]]
-        expr1 = self.com_node(nodelist[1])
-        if len(nodelist) >= 4:
-            expr2 = self.com_node(nodelist[3])
-            if len(nodelist) >= 6:
-                expr3 = self.com_node(nodelist[5])
-            else:
-                expr3 = None
-        else:
-            expr2 = expr3 = None
-
-        return Exec(expr1, expr2, expr3, lineno=nodelist[0][2])
-
     def assert_stmt(self, nodelist):
         # 'assert': test, [',' test]
         expr1 = self.com_node(nodelist[1])
@@ -618,7 +606,7 @@
         for i in range(2, len(nodelist), 2):
             nl = nodelist[i-1]
 
-            # comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
+            # comp_op: '<' | '>' | '=' | '>=' | '<=' | '!=' | '=='
             #          | 'in' | 'not' 'in' | 'is' | 'is' 'not'
             n = nl[1]
             if n[0] == token.NAME:
@@ -738,10 +726,7 @@
     def atom_lbrace(self, nodelist):
         if nodelist[1][0] == token.RBRACE:
             return Dict((), lineno=nodelist[0][2])
-        return self.com_dictmaker(nodelist[1])
-
-    def atom_backquote(self, nodelist):
-        return Backquote(self.com_node(nodelist[1]))
+        return self.com_dictsetmaker(nodelist[1])
 
     def atom_number(self, nodelist):
         ### need to verify this matches compile.c
@@ -765,6 +750,9 @@
             k += self.decode_literal(node[1])
         return Const(k, lineno=nodelist[0][2])
 
+    def atom_ellipsis(self, nodelist):
+        return Const(Ellipsis, lineno=nodelist[0][2])
+
     def atom_name(self, nodelist):
         return Name(nodelist[0][1], lineno=nodelist[0][2])
 
@@ -797,13 +785,37 @@
         # ('const', xxxx)) Nodes)
         return Discard(Const(None))
 
+    def keywordonlyargs(self, nodelist):
+        # (',' NAME ['=' test])*
+        #      ^^^
+        # ------+
+        kwonlyargs = []
+        i = 0
+        while i < len(nodelist):
+            default = EmptyNode()
+            node = nodelist[i]
+            #assert node[0] == token.COMMA
+            #node = nodelist[i+1]
+            if i+1 < len(nodelist) and nodelist[i+1][0] == token.EQUAL:
+                assert i+2 < len(nodelist)
+                default = self.com_node(nodelist[i+2])
+                i += 2
+            if node[0] == token.DOUBLESTAR:
+                return kwonlyargs, i
+            elif node[0] == token.NAME:
+                kwonlyargs.append(Keyword(node[1], default, lineno=node[2]))
+                i += 2
+        return kwonlyargs, i
+        
     def com_arglist(self, nodelist):
         # varargslist:
-        #     (fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME] | '**' NAME)
-        #   | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+        #     (fpdef ['=' test] ',')*
+        #      ('*' [NAME] (',' NAME '=' test)* [',' '**' NAME] | '**' NAME)
+        #      | fpdef ['=' test] (',' fpdef ['=' test])* [',']
         # fpdef: NAME | '(' fplist ')'
         # fplist: fpdef (',' fpdef)* [',']
         names = []
+        kwonlyargs = []
         defaults = []
         flags = 0
 
@@ -813,10 +825,16 @@
             if node[0] == token.STAR or node[0] == token.DOUBLESTAR:
                 if node[0] == token.STAR:
                     node = nodelist[i+1]
-                    if node[0] == token.NAME:
+                    if node[0] == token.NAME: # vararg
                         names.append(node[1])
                         flags = flags | CO_VARARGS
                         i = i + 3
+                    else: # no vararg
+                        assert node[0] == token.COMMA
+                        i += 2
+                    if i < len(nodelist) and nodelist[i][0] == token.NAME:
+                        kwonlyargs, skip = self.keywordonlyargs(nodelist[i:])
+                        i += skip
 
                 if i < len(nodelist):
                     # should be DOUBLESTAR
@@ -845,7 +863,7 @@
             # skip the comma
             i = i + 1
 
-        return names, defaults, flags
+        return names, defaults, kwonlyargs, flags
 
     def com_fpdef(self, node):
         # fpdef: NAME | '(' fplist ')'
@@ -1182,13 +1200,20 @@
             assert node[0] == symbol.gen_iter
             return node[1]
 
-    def com_dictmaker(self, nodelist):
-        # dictmaker: test ':' test (',' test ':' value)* [',']
+    def com_dictsetmaker(self, nodelist):
+        # dictsetmaker: (test ':' test (',' test ':' value)* [',']) | (test (',' test)* [','])
         items = []
-        for i in range(1, len(nodelist), 4):
-            items.append((self.com_node(nodelist[i]),
-                          self.com_node(nodelist[i+2])))
-        return Dict(items, lineno=items[0][0].lineno)
+        if len(nodelist) == 1 or nodelist[1] != ':':
+            # it's a set
+            for i in range(1, len(nodelist), 2):
+                items.append(self.com_node(nodelist[i]))
+            return Set(items, lineno=items[0].lineno)
+        else:
+            # it's a dict
+            for i in range(1, len(nodelist), 4):
+                items.append((self.com_node(nodelist[i]),
+                              self.com_node(nodelist[i+2])))
+            return Dict(items, lineno=items[0][0].lineno)
 
     def com_apply_trailer(self, primaryNode, nodelist):
         t = nodelist[1][0]
@@ -1279,11 +1304,9 @@
                          lineno=extractLineNo(nodelist))
 
     def com_subscript(self, node):
-        # slice_item: expression | proper_slice | ellipsis
+        # slice_item: expression | proper_slice
         ch = node[1]
         t = ch[0]
-        if t == token.DOT and node[2][0] == token.DOT:
-            return Ellipsis()
         if t == token.COLON or len(node) > 2:
             return self.com_sliceobj(node)
         return self.com_node(ch)
@@ -1374,7 +1397,7 @@
     symbol.power,
     ]
 
-# comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
+# comp_op: '<' | '>' | '=' | '>=' | '<=' | '!=' | '=='
 #             | 'in' | 'not' 'in' | 'is' | 'is' 'not'
 _cmp_types = {
     token.LESS : '<',
@@ -1404,7 +1427,6 @@
     symbol.raise_stmt,
     symbol.import_stmt,
     symbol.global_stmt,
-    symbol.exec_stmt,
     symbol.assert_stmt,
     symbol.if_stmt,
     symbol.while_stmt,

Modified: python/branches/p3yk-noslice/Lib/ctypes/__init__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/__init__.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/__init__.py	Fri Dec 15 05:21:50 2006
@@ -427,6 +427,8 @@
     c_size_t = c_uint
 elif sizeof(c_ulong) == sizeof(c_void_p):
     c_size_t = c_ulong
+elif sizeof(c_ulonglong) == sizeof(c_void_p):
+    c_size_t = c_ulonglong
 
 # functions
 

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/__init__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/__init__.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/__init__.py	Fri Dec 15 05:21:50 2006
@@ -37,7 +37,8 @@
 
 def find_package_modules(package, mask):
     import fnmatch
-    if hasattr(package, "__loader__"):
+    if (hasattr(package, "__loader__") and
+            hasattr(package.__loader__, '_files')):
         path = package.__name__.replace(".", os.path.sep)
         mask = os.path.join(path, mask)
         for fnm in package.__loader__._files.iterkeys():

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/test_bitfields.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/test_bitfields.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/test_bitfields.py	Fri Dec 15 05:21:50 2006
@@ -215,5 +215,14 @@
                         ("b", c_ubyte, 4)]
         self.failUnlessEqual(sizeof(X), sizeof(c_byte))
 
+    def test_anon_bitfields(self):
+        # anonymous bit-fields gave a strange error message
+        class X(Structure):
+            _fields_ = [("a", c_byte, 4),
+                        ("b", c_ubyte, 4)]
+        class Y(Structure):
+            _anonymous_ = ["_"]
+            _fields_ = [("_", X)]
+
 if __name__ == "__main__":
     unittest.main()

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/test_callbacks.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/test_callbacks.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/test_callbacks.py	Fri Dec 15 05:21:50 2006
@@ -101,6 +101,19 @@
             after = grc(o)
             self.failUnlessEqual((after, o), (before, o))
 
+    def test_unsupported_restype_1(self):
+        # Only "fundamental" result types are supported for callback
+        # functions, the type must have a non-NULL stgdict->setfunc.
+        # POINTER(c_double), for example, is not supported.
+
+        prototype = self.functype.im_func(POINTER(c_double))
+        # The type is checked when the prototype is called
+        self.assertRaises(TypeError, prototype, lambda: None)
+
+    def test_unsupported_restype_2(self):
+        prototype = self.functype.im_func(object)
+        self.assertRaises(TypeError, prototype, lambda: None)
+
 try:
     WINFUNCTYPE
 except NameError:

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/test_cast.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/test_cast.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/test_cast.py	Fri Dec 15 05:21:50 2006
@@ -57,5 +57,21 @@
         c_int()
         self.failUnlessEqual(p[:4], [1, 2, 96, 4])
 
+    def test_char_p(self):
+        # This didn't work: bad argument to internal function
+        s = c_char_p("hiho")
+        self.failUnlessEqual(cast(cast(s, c_void_p), c_char_p).value,
+                             "hiho")
+
+    try:
+        c_wchar_p
+    except NameError:
+        pass
+    else:
+        def test_wchar_p(self):
+            s = c_wchar_p("hiho")
+            self.failUnlessEqual(cast(cast(s, c_void_p), c_wchar_p).value,
+                                 "hiho")
+
 if __name__ == "__main__":
     unittest.main()

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/test_simplesubclasses.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/test_simplesubclasses.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/test_simplesubclasses.py	Fri Dec 15 05:21:50 2006
@@ -2,10 +2,10 @@
 from ctypes import *
 
 class MyInt(c_int):
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if type(other) != MyInt:
-            return -1
-        return cmp(self.value, other.value)
+            return NotImplementedError
+        return self.value == other.value
 
 class Test(unittest.TestCase):
 

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/test_structures.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/test_structures.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/test_structures.py	Fri Dec 15 05:21:50 2006
@@ -381,5 +381,35 @@
         s.p = None
         self.failUnlessEqual(s.x, 12345678)
 
+class TestRecursiveStructure(unittest.TestCase):
+    def test_contains_itself(self):
+        class Recursive(Structure):
+            pass
+
+        try:
+            Recursive._fields_ = [("next", Recursive)]
+        except AttributeError, details:
+            self.failUnless("Structure or union cannot contain itself" in
+                            str(details))
+        else:
+            self.fail("Structure or union cannot contain itself")
+
+
+    def test_vice_versa(self):
+        class First(Structure):
+            pass
+        class Second(Structure):
+            pass
+
+        First._fields_ = [("second", Second)]
+
+        try:
+            Second._fields_ = [("first", First)]
+        except AttributeError, details:
+            self.failUnless("_fields_ is final" in
+                            str(details))
+        else:
+            self.fail("AttributeError not raised")
+
 if __name__ == '__main__':
     unittest.main()

Modified: python/branches/p3yk-noslice/Lib/ctypes/test/test_win32.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ctypes/test/test_win32.py	(original)
+++ python/branches/p3yk-noslice/Lib/ctypes/test/test_win32.py	Fri Dec 15 05:21:50 2006
@@ -6,7 +6,8 @@
 
 import _ctypes_test
 
-if sys.platform == "win32":
+if sys.platform == "win32" and sizeof(c_void_p) == sizeof(c_int):
+    # Only windows 32-bit has different calling conventions.
 
     class WindowsTestCase(unittest.TestCase):
         def test_callconv_1(self):

Modified: python/branches/p3yk-noslice/Lib/decimal.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/decimal.py	(original)
+++ python/branches/p3yk-noslice/Lib/decimal.py	Fri Dec 15 05:21:50 2006
@@ -85,7 +85,7 @@
   ...
   ...
   ...
-DivisionByZero: x / 0
+decimal.DivisionByZero: x / 0
 >>> c = Context()
 >>> c.traps[InvalidOperation] = 0
 >>> print c.flags[InvalidOperation]
@@ -103,7 +103,7 @@
   ...
   ...
   ...
-InvalidOperation: 0 / 0
+decimal.InvalidOperation: 0 / 0
 >>> print c.flags[InvalidOperation]
 1
 >>> c.flags[InvalidOperation] = 0
@@ -131,7 +131,7 @@
     'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN',
 
     # Functions for manipulating contexts
-    'setcontext', 'getcontext'
+    'setcontext', 'getcontext', 'localcontext'
 ]
 
 import copy as _copy
@@ -458,6 +458,49 @@
 
     del threading, local        # Don't contaminate the namespace
 
+def localcontext(ctx=None):
+    """Return a context manager for a copy of the supplied context
+
+    Uses a copy of the current context if no context is specified
+    The returned context manager creates a local decimal context
+    in a with statement:
+        def sin(x):
+             with localcontext() as ctx:
+                 ctx.prec += 2
+                 # Rest of sin calculation algorithm
+                 # uses a precision 2 greater than normal
+             return +s # Convert result to normal precision
+
+         def sin(x):
+             with localcontext(ExtendedContext):
+                 # Rest of sin calculation algorithm
+                 # uses the Extended Context from the
+                 # General Decimal Arithmetic Specification
+             return +s # Convert result to normal context
+
+    """
+    # The string below can't be included in the docstring until Python 2.6
+    # as the doctest module doesn't understand __future__ statements
+    """
+    >>> from __future__ import with_statement
+    >>> print getcontext().prec
+    28
+    >>> with localcontext():
+    ...     ctx = getcontext()
+    ...     ctx.prec() += 2
+    ...     print ctx.prec
+    ...
+    30
+    >>> with localcontext(ExtendedContext):
+    ...     print getcontext().prec
+    ...
+    9
+    >>> print getcontext().prec
+    28
+    """
+    if ctx is None: ctx = getcontext()
+    return _ContextManager(ctx)
+
 
 ##### Decimal class ###########################################
 
@@ -633,14 +676,14 @@
             return other
         return 0
 
-    def __nonzero__(self):
-        """Is the number non-zero?
+    def __bool__(self):
+        """return True if the number is non-zero.
 
-        0 if self == 0
-        1 if self != 0
+        False if self == 0
+        True if self != 0
         """
         if self._is_special:
-            return 1
+            return True
         return sum(self._int) != 0
 
     def __cmp__(self, other, context=None):
@@ -706,6 +749,26 @@
             return NotImplemented
         return self.__cmp__(other) != 0
 
+    def __lt__(self, other):
+        if not isinstance(other, (Decimal, int, long)):
+            return NotImplemented
+        return self.__cmp__(other) < 0
+
+    def __le__(self, other):
+        if not isinstance(other, (Decimal, int, long)):
+            return NotImplemented
+        return self.__cmp__(other) <= 0
+
+    def __gt__(self, other):
+        if not isinstance(other, (Decimal, int, long)):
+            return NotImplemented
+        return self.__cmp__(other) > 0
+
+    def __ge__(self, other):
+        if not isinstance(other, (Decimal, int, long)):
+            return NotImplemented
+        return self.__cmp__(other) >= 0
+
     def compare(self, other, context=None):
         """Compares one to another.
 
@@ -739,7 +802,7 @@
         i = int(self)
         if self == Decimal(i):
             return hash(i)
-        assert self.__nonzero__()   # '-0' handled by integer case
+        assert self.__bool__()   # '-0' handled by integer case
         return hash(str(self.normalize()))
 
     def as_tuple(self):
@@ -1894,6 +1957,7 @@
             ans = self._check_nans(context=context)
             if ans:
                 return ans
+            return self
         if self._exp >= 0:
             return self
         if context is None:
@@ -2171,23 +2235,14 @@
 
 del name, val, globalname, rounding_functions
 
-class ContextManager(object):
-    """Helper class to simplify Context management.
-
-    Sample usage:
-
-    with decimal.ExtendedContext:
-        s = ...
-    return +s # Convert result to normal precision
-
-    with decimal.getcontext() as ctx:
-        ctx.prec += 2
-        s = ...
-    return +s
+class _ContextManager(object):
+    """Context manager class to support localcontext().
 
+      Sets a copy of the supplied context in __enter__() and restores
+      the previous decimal context in __exit__()
     """
     def __init__(self, new_context):
-        self.new_context = new_context
+        self.new_context = new_context.copy()
     def __enter__(self):
         self.saved_context = getcontext()
         setcontext(self.new_context)
@@ -2246,9 +2301,6 @@
         s.append('traps=[' + ', '.join([t.__name__ for t, v in self.traps.items() if v]) + ']')
         return ', '.join(s) + ')'
 
-    def get_manager(self):
-        return ContextManager(self.copy())
-
     def clear_flags(self):
         """Reset all flags to zero"""
         for flag in self.flags:

Modified: python/branches/p3yk-noslice/Lib/distutils/command/bdist_rpm.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/command/bdist_rpm.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/command/bdist_rpm.py	Fri Dec 15 05:21:50 2006
@@ -337,37 +337,47 @@
         if not self.keep_temp:
             rpm_cmd.append('--clean')
         rpm_cmd.append(spec_path)
+        # Determine the binary rpm names that should be built out of this spec
+        # file
+        # Note that some of these may not be really built (if the file
+        # list is empty)
+        nvr_string = "%{name}-%{version}-%{release}"
+        src_rpm = nvr_string + ".src.rpm"
+        non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
+        q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
+            src_rpm, non_src_rpm, spec_path)
+
+        out = os.popen(q_cmd)
+        binary_rpms = []
+        source_rpm = None
+        while 1:
+            line = out.readline()
+            if not line:
+                break
+            l = string.split(string.strip(line))
+            assert(len(l) == 2)
+            binary_rpms.append(l[1])
+            # The source rpm is named after the first entry in the spec file
+            if source_rpm is None:
+                source_rpm = l[0]
+
+        status = out.close()
+        if status:
+            raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))
+
         self.spawn(rpm_cmd)
 
-        # XXX this is a nasty hack -- we really should have a proper way to
-        # find out the names of the RPM files created; also, this assumes
-        # that RPM creates exactly one source and one binary RPM.
         if not self.dry_run:
             if not self.binary_only:
-                srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm"))
-                assert len(srpms) == 1, \
-                       "unexpected number of SRPM files found: %s" % srpms
-                dist_file = ('bdist_rpm', 'any',
-                             self._dist_path(srpms[0]))
-                self.distribution.dist_files.append(dist_file)
-                self.move_file(srpms[0], self.dist_dir)
+                srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
+                assert(os.path.exists(srpm))
+                self.move_file(srpm, self.dist_dir)
 
             if not self.source_only:
-                rpms = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*.rpm"))
-                debuginfo = glob.glob(os.path.join(rpm_dir['RPMS'],
-                                                   "*/*debuginfo*.rpm"))
-                if debuginfo:
-                    rpms.remove(debuginfo[0])
-                assert len(rpms) == 1, \
-                       "unexpected number of RPM files found: %s" % rpms
-                dist_file = ('bdist_rpm', get_python_version(),
-                             self._dist_path(rpms[0]))
-                self.distribution.dist_files.append(dist_file)
-                self.move_file(rpms[0], self.dist_dir)
-                if debuginfo:
-                    dist_file = ('bdist_rpm', get_python_version(),
-                                 self._dist_path(debuginfo[0]))
-                    self.move_file(debuginfo[0], self.dist_dir)
+                for rpm in binary_rpms:
+                    rpm = os.path.join(rpm_dir['RPMS'], rpm)
+                    if os.path.exists(rpm):
+                        self.move_file(rpm, self.dist_dir)
     # run()
 
     def _dist_path(self, path):
@@ -381,6 +391,7 @@
         spec_file = [
             '%define name ' + self.distribution.get_name(),
             '%define version ' + self.distribution.get_version().replace('-','_'),
+            '%define unmangled_version ' + self.distribution.get_version(),
             '%define release ' + self.release.replace('-','_'),
             '',
             'Summary: ' + self.distribution.get_description(),
@@ -402,9 +413,9 @@
         # but only after it has run: and we create the spec file before
         # running "sdist", in case of --spec-only.
         if self.use_bzip2:
-            spec_file.append('Source0: %{name}-%{version}.tar.bz2')
+            spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
         else:
-            spec_file.append('Source0: %{name}-%{version}.tar.gz')
+            spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
 
         spec_file.extend([
             'License: ' + self.distribution.get_license(),
@@ -479,7 +490,7 @@
         # are just text that we drop in as-is.  Hmmm.
 
         script_options = [
-            ('prep', 'prep_script', "%setup"),
+            ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
             ('build', 'build_script', def_build),
             ('install', 'install_script',
              ("%s install "

Modified: python/branches/p3yk-noslice/Lib/distutils/command/build_ext.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/command/build_ext.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/command/build_ext.py	Fri Dec 15 05:21:50 2006
@@ -186,7 +186,7 @@
         # for extensions under Cygwin and AtheOS Python's library directory must be
         # appended to library_dirs
         if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos' or \
-               (sys.platform.startswith('linux') and
+               ((sys.platform.startswith('linux') or sys.platform.startswith('gnu')) and
                 sysconfig.get_config_var('Py_ENABLE_SHARED')):
             if string.find(sys.executable, sys.exec_prefix) != -1:
                 # building third party extensions

Modified: python/branches/p3yk-noslice/Lib/distutils/command/install_egg_info.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/command/install_egg_info.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/command/install_egg_info.py	Fri Dec 15 05:21:50 2006
@@ -35,6 +35,9 @@
             dir_util.remove_tree(target, dry_run=self.dry_run)
         elif os.path.exists(target):
             self.execute(os.unlink,(self.target,),"Removing "+target)
+        elif not os.path.isdir(self.install_dir):
+            self.execute(os.makedirs, (self.install_dir,),
+                         "Creating "+self.install_dir)
         log.info("Writing %s", target)
         if not self.dry_run:
             f = open(target, 'w')

Modified: python/branches/p3yk-noslice/Lib/distutils/command/register.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/command/register.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/command/register.py	Fri Dec 15 05:21:50 2006
@@ -256,7 +256,7 @@
         body = StringIO.StringIO()
         for key, value in data.items():
             # handle multiple entries for the same name
-            if type(value) != type([]):
+            if type(value) not in (type([]), type( () )):
                 value = [value]
             for value in value:
                 value = unicode(value).encode("utf-8")

Modified: python/branches/p3yk-noslice/Lib/distutils/sysconfig.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/sysconfig.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/sysconfig.py	Fri Dec 15 05:21:50 2006
@@ -354,7 +354,7 @@
     # load the installed pyconfig.h:
     try:
         filename = get_config_h_filename()
-        parse_config_h(file(filename), g)
+        parse_config_h(open(filename), g)
     except IOError, msg:
         my_msg = "invalid Python installation: unable to open %s" % filename
         if hasattr(msg, "strerror"):
@@ -509,7 +509,10 @@
                 # are in CFLAGS or LDFLAGS and remove them if they are.
                 # This is needed when building extensions on a 10.3 system
                 # using a universal build of python.
-                for key in ('LDFLAGS', 'BASECFLAGS'):
+                for key in ('LDFLAGS', 'BASECFLAGS',
+                        # a number of derived variables. These need to be
+                        # patched up as well.
+                        'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
                     flags = _config_vars[key]
                     flags = re.sub('-arch\s+\w+\s', ' ', flags)
                     flags = re.sub('-isysroot [^ \t]*', ' ', flags)

Modified: python/branches/p3yk-noslice/Lib/distutils/unixccompiler.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/unixccompiler.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/unixccompiler.py	Fri Dec 15 05:21:50 2006
@@ -82,6 +82,22 @@
         except ValueError:
             pass
 
+    # Check if the SDK that is used during compilation actually exists,
+    # the universal build requires the usage of a universal SDK and not all
+    # users have that installed by default.
+    sysroot = None
+    if '-isysroot' in cc_args:
+        idx = cc_args.index('-isysroot')
+        sysroot = cc_args[idx+1]
+    elif '-isysroot' in compiler_so:
+        idx = compiler_so.index('-isysroot')
+        sysroot = compiler_so[idx+1]
+
+    if sysroot and not os.path.isdir(sysroot):
+        log.warn("Compiling with an SDK that doesn't seem to exist: %s",
+                sysroot)
+        log.warn("Please check your Xcode installation")
+
     return compiler_so
 
 class UnixCCompiler(CCompiler):

Modified: python/branches/p3yk-noslice/Lib/distutils/version.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/distutils/version.py	(original)
+++ python/branches/p3yk-noslice/Lib/distutils/version.py	Fri Dec 15 05:21:50 2006
@@ -32,7 +32,8 @@
 class Version:
     """Abstract base class for version numbering classes.  Just provides
     constructor (__init__) and reproducer (__repr__), because those
-    seem to be the same for all version numbering classes.
+    seem to be the same for all version numbering classes; and route
+    rich comparisons to __cmp__.
     """
 
     def __init__ (self, vstring=None):
@@ -42,6 +43,42 @@
     def __repr__ (self):
         return "%s ('%s')" % (self.__class__.__name__, str(self))
 
+    def __eq__(self, other):
+        c = self.__cmp__(other)
+        if c is NotImplemented:
+            return c
+        return c == 0
+
+    def __ne__(self, other):
+        c = self.__cmp__(other)
+        if c is NotImplemented:
+            return c
+        return c != 0
+
+    def __lt__(self, other):
+        c = self.__cmp__(other)
+        if c is NotImplemented:
+            return c
+        return c < 0
+
+    def __le__(self, other):
+        c = self.__cmp__(other)
+        if c is NotImplemented:
+            return c
+        return c <= 0
+
+    def __gt__(self, other):
+        c = self.__cmp__(other)
+        if c is NotImplemented:
+            return c
+        return c > 0
+
+    def __ge__(self, other):
+        c = self.__cmp__(other)
+        if c is NotImplemented:
+            return c
+        return c >= 0
+
 
 # Interface for version-number classes -- must be implemented
 # by the following classes (the concrete ones -- Version should

Modified: python/branches/p3yk-noslice/Lib/doctest.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/doctest.py	(original)
+++ python/branches/p3yk-noslice/Lib/doctest.py	Fri Dec 15 05:21:50 2006
@@ -469,11 +469,12 @@
 
 
     # This lets us sort tests by name:
-    def __cmp__(self, other):
+    def __lt__(self, other):
         if not isinstance(other, DocTest):
-            return -1
-        return cmp((self.name, self.filename, self.lineno, id(self)),
-                   (other.name, other.filename, other.lineno, id(other)))
+            return NotImplemented
+        return ((self.name, self.filename, self.lineno, id(self))
+                <
+                (other.name, other.filename, other.lineno, id(other)))
 
 ######################################################################
 ## 3. DocTestParser
@@ -1208,8 +1209,8 @@
             # keyboard interrupts.)
             try:
                 # Don't blink!  This is where the user's code gets run.
-                exec compile(example.source, filename, "single",
-                             compileflags, 1) in test.globs
+                exec(compile(example.source, filename, "single",
+                             compileflags, 1), test.globs)
                 self.debugger.set_continue() # ==== Example Finished ====
                 exception = None
             except KeyboardInterrupt:
@@ -1561,7 +1562,7 @@
 
     - test: the DocTest object being run
 
-    - excample: the Example object that failed
+    - example: the Example object that failed
 
     - got: the actual output
     """
@@ -1580,7 +1581,7 @@
 
     - test: the DocTest object being run
 
-    - excample: the Example object that failed
+    - example: the Example object that failed
 
     - exc_info: the exception info
     """
@@ -1663,7 +1664,7 @@
          >>> runner.run(test)
          Traceback (most recent call last):
          ...
-         UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>
+         doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>
 
          >>> del test.globs['__builtins__']
          >>> test.globs

Modified: python/branches/p3yk-noslice/Lib/email/base64mime.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/base64mime.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/base64mime.py	Fri Dec 15 05:21:50 2006
@@ -146,7 +146,7 @@
         # BAW: should encode() inherit b2a_base64()'s dubious behavior in
         # adding a newline to the encoded string?
         enc = b2a_base64(s[i:i + max_unencoded])
-        if enc.endswith(NL) and eol <> NL:
+        if enc.endswith(NL) and eol != NL:
             enc = enc[:-1] + eol
         encvec.append(enc)
     return EMPTYSTRING.join(encvec)

Modified: python/branches/p3yk-noslice/Lib/email/charset.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/charset.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/charset.py	Fri Dec 15 05:21:50 2006
@@ -250,7 +250,7 @@
         Returns "base64" if self.body_encoding is BASE64.
         Returns "7bit" otherwise.
         """
-        assert self.body_encoding <> SHORTEST
+        assert self.body_encoding != SHORTEST
         if self.body_encoding == QP:
             return 'quoted-printable'
         elif self.body_encoding == BASE64:
@@ -260,7 +260,7 @@
 
     def convert(self, s):
         """Convert a string from the input_codec to the output_codec."""
-        if self.input_codec <> self.output_codec:
+        if self.input_codec != self.output_codec:
             return unicode(s, self.input_codec).encode(self.output_codec)
         else:
             return s

Modified: python/branches/p3yk-noslice/Lib/email/generator.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/generator.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/generator.py	Fri Dec 15 05:21:50 2006
@@ -211,7 +211,7 @@
         # doesn't preserve newlines/continuations in headers.  This is no big
         # deal in practice, but turns out to be inconvenient for the unittest
         # suite.
-        if msg.get_boundary() <> boundary:
+        if msg.get_boundary() != boundary:
             msg.set_boundary(boundary)
         # If there's a preamble, write it out, with a trailing CRLF
         if msg.preamble is not None:

Modified: python/branches/p3yk-noslice/Lib/email/header.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/header.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/header.py	Fri Dec 15 05:21:50 2006
@@ -248,7 +248,7 @@
         elif not isinstance(charset, Charset):
             charset = Charset(charset)
         # If the charset is our faux 8bit charset, leave the string unchanged
-        if charset <> '8bit':
+        if charset != '8bit':
             # We need to test that the string can be converted to unicode and
             # back to a byte string, given the input and output codecs of the
             # charset.
@@ -454,7 +454,7 @@
                 # If this part is longer than maxlen and we aren't already
                 # splitting on whitespace, try to recursively split this line
                 # on whitespace.
-                if partlen > maxlen and ch <> ' ':
+                if partlen > maxlen and ch != ' ':
                     subl = _split_ascii(part, maxlen, restlen,
                                         continuation_ws, ' ')
                     lines.extend(subl[:-1])

Modified: python/branches/p3yk-noslice/Lib/email/message.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/message.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/message.py	Fri Dec 15 05:21:50 2006
@@ -252,7 +252,7 @@
                             charset=charset.get_output_charset())
         else:
             self.set_param('charset', charset.get_output_charset())
-        if str(charset) <> charset.get_output_charset():
+        if str(charset) != charset.get_output_charset():
             self._payload = charset.body_encode(self._payload)
         if 'Content-Transfer-Encoding' not in self:
             cte = charset.get_body_encoding()
@@ -301,7 +301,7 @@
         name = name.lower()
         newheaders = []
         for k, v in self._headers:
-            if k.lower() <> name:
+            if k.lower() != name:
                 newheaders.append((k, v))
         self._headers = newheaders
 
@@ -438,7 +438,7 @@
             return self.get_default_type()
         ctype = paramre.split(value)[0].lower().strip()
         # RFC 2045, section 5.2 says if its invalid, use text/plain
-        if ctype.count('/') <> 1:
+        if ctype.count('/') != 1:
             return 'text/plain'
         return ctype
 
@@ -601,7 +601,7 @@
                     ctype = append_param
                 else:
                     ctype = SEMISPACE.join([ctype, append_param])
-        if ctype <> self.get(header):
+        if ctype != self.get(header):
             del self[header]
             self[header] = ctype
 
@@ -617,13 +617,13 @@
             return
         new_ctype = ''
         for p, v in self.get_params(header=header, unquote=requote):
-            if p.lower() <> param.lower():
+            if p.lower() != param.lower():
                 if not new_ctype:
                     new_ctype = _formatparam(p, v, requote)
                 else:
                     new_ctype = SEMISPACE.join([new_ctype,
                                                 _formatparam(p, v, requote)])
-        if new_ctype <> self.get(header):
+        if new_ctype != self.get(header):
             del self[header]
             self[header] = new_ctype
 

Modified: python/branches/p3yk-noslice/Lib/email/quoprimime.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/quoprimime.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/quoprimime.py	Fri Dec 15 05:21:50 2006
@@ -287,7 +287,7 @@
         n = len(line)
         while i < n:
             c = line[i]
-            if c <> '=':
+            if c != '=':
                 decoded += c
                 i += 1
             # Otherwise, c == "=".  Are we at the end of the line?  If so, add

Modified: python/branches/p3yk-noslice/Lib/email/test/test_email.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/test/test_email.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/test/test_email.py	Fri Dec 15 05:21:50 2006
@@ -51,7 +51,7 @@
 class TestEmailBase(unittest.TestCase):
     def ndiffAssertEqual(self, first, second):
         """Like failUnlessEqual except use ndiff for readable output."""
-        if first <> second:
+        if first != second:
             sfirst = str(first)
             ssecond = str(second)
             diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
@@ -2726,7 +2726,7 @@
         # Try a charset with None body encoding
         c = Charset('us-ascii')
         eq('hello world', c.body_encode('hello world'))
-        # Try the convert argument, where input codec <> output codec
+        # Try the convert argument, where input codec != output codec
         c = Charset('euc-jp')
         # With apologies to Tokio Kikuchi ;)
         try:

Modified: python/branches/p3yk-noslice/Lib/email/test/test_email_renamed.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/test/test_email_renamed.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/test/test_email_renamed.py	Fri Dec 15 05:21:50 2006
@@ -52,7 +52,7 @@
 class TestEmailBase(unittest.TestCase):
     def ndiffAssertEqual(self, first, second):
         """Like failUnlessEqual except use ndiff for readable output."""
-        if first <> second:
+        if first != second:
             sfirst = str(first)
             ssecond = str(second)
             diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
@@ -2732,7 +2732,7 @@
         # Try a charset with None body encoding
         c = Charset('us-ascii')
         eq('hello world', c.body_encode('hello world'))
-        # Try the convert argument, where input codec <> output codec
+        # Try the convert argument, where input codec != output codec
         c = Charset('euc-jp')
         # With apologies to Tokio Kikuchi ;)
         try:

Modified: python/branches/p3yk-noslice/Lib/email/utils.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/email/utils.py	(original)
+++ python/branches/p3yk-noslice/Lib/email/utils.py	Fri Dec 15 05:21:50 2006
@@ -235,10 +235,6 @@
     parts = s.split(TICK, 2)
     if len(parts) <= 2:
         return None, None, s
-    if len(parts) > 3:
-        charset, language = parts[:2]
-        s = TICK.join(parts[2:])
-        return charset, language, s
     return parts
 
 

Modified: python/branches/p3yk-noslice/Lib/encodings/__init__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/encodings/__init__.py	(original)
+++ python/branches/p3yk-noslice/Lib/encodings/__init__.py	Fri Dec 15 05:21:50 2006
@@ -28,7 +28,7 @@
 
 """#"
 
-import codecs, types
+import codecs
 from . import aliases
 
 _cache = {}
@@ -60,7 +60,7 @@
     """
     # Make sure we have an 8-bit string, because .translate() works
     # differently for Unicode strings.
-    if type(encoding) is types.UnicodeType:
+    if isinstance(encoding, unicode):
         # Note that .encode('latin-1') does *not* use the codec
         # registry, so this call doesn't recurse. (See unicodeobject.c
         # PyUnicode_AsEncodedString() for details)
@@ -90,7 +90,7 @@
     else:
         modnames = [norm_encoding]
     for modname in modnames:
-        if not modname:
+        if not modname or '.' in modname:
             continue
         try:
             mod = __import__('encodings.' + modname,

Modified: python/branches/p3yk-noslice/Lib/encodings/bz2_codec.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/encodings/bz2_codec.py	(original)
+++ python/branches/p3yk-noslice/Lib/encodings/bz2_codec.py	Fri Dec 15 05:21:50 2006
@@ -52,14 +52,35 @@
         return bz2_decode(input, errors)
 
 class IncrementalEncoder(codecs.IncrementalEncoder):
+    def __init__(self, errors='strict'):
+        assert errors == 'strict'
+        self.errors = errors
+        self.compressobj = bz2.BZ2Compressor()
+
     def encode(self, input, final=False):
-        assert self.errors == 'strict'
-        return bz2.compress(input)
+        if final:
+            c = self.compressobj.compress(input)
+            return c + self.compressobj.flush()
+        else:
+            return self.compressobj.compress(input)
+
+    def reset(self):
+        self.compressobj = bz2.BZ2Compressor()
 
 class IncrementalDecoder(codecs.IncrementalDecoder):
+    def __init__(self, errors='strict'):
+        assert errors == 'strict'
+        self.errors = errors
+        self.decompressobj = bz2.BZ2Decompressor()
+
     def decode(self, input, final=False):
-        assert self.errors == 'strict'
-        return bz2.decompress(input)
+        try:
+            return self.decompressobj.decompress(input)
+        except EOFError:
+            return ''
+
+    def reset(self):
+        self.decompressobj = bz2.BZ2Decompressor()
 
 class StreamWriter(Codec,codecs.StreamWriter):
     pass

Modified: python/branches/p3yk-noslice/Lib/encodings/utf_8_sig.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/encodings/utf_8_sig.py	(original)
+++ python/branches/p3yk-noslice/Lib/encodings/utf_8_sig.py	Fri Dec 15 05:21:50 2006
@@ -16,7 +16,7 @@
 
 def decode(input, errors='strict'):
     prefix = 0
-    if input.startswith(codecs.BOM_UTF8):
+    if input[:3] == codecs.BOM_UTF8:
         input = input[3:]
         prefix = 3
     (output, consumed) = codecs.utf_8_decode(input, errors, True)

Modified: python/branches/p3yk-noslice/Lib/encodings/zlib_codec.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/encodings/zlib_codec.py	(original)
+++ python/branches/p3yk-noslice/Lib/encodings/zlib_codec.py	Fri Dec 15 05:21:50 2006
@@ -51,14 +51,36 @@
         return zlib_decode(input, errors)
 
 class IncrementalEncoder(codecs.IncrementalEncoder):
+    def __init__(self, errors='strict'):
+        assert errors == 'strict'
+        self.errors = errors
+        self.compressobj = zlib.compressobj()
+
     def encode(self, input, final=False):
-        assert self.errors == 'strict'
-        return zlib.compress(input)
+        if final:
+            c = self.compressobj.compress(input)
+            return c + self.compressobj.flush()
+        else:
+            return self.compressobj.compress(input)
+
+    def reset(self):
+        self.compressobj = zlib.compressobj()
 
 class IncrementalDecoder(codecs.IncrementalDecoder):
+    def __init__(self, errors='strict'):
+        assert errors == 'strict'
+        self.errors = errors
+        self.decompressobj = zlib.decompressobj()
+
     def decode(self, input, final=False):
-        assert self.errors == 'strict'
-        return zlib.decompress(input)
+        if final:
+            c = self.decompressobj.decompress(input)
+            return c + self.decompressobj.flush()
+        else:
+            return self.decompressobj.decompress(input)
+
+    def reset(self):
+        self.decompressobj = zlib.decompressobj()
 
 class StreamWriter(Codec,codecs.StreamWriter):
     pass

Modified: python/branches/p3yk-noslice/Lib/ftplib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ftplib.py	(original)
+++ python/branches/p3yk-noslice/Lib/ftplib.py	Fri Dec 15 05:21:50 2006
@@ -325,6 +325,14 @@
             if rest is not None:
                 self.sendcmd("REST %s" % rest)
             resp = self.sendcmd(cmd)
+            # Some servers apparently send a 200 reply to
+            # a LIST or STOR command, before the 150 reply
+            # (and way before the 226 reply). This seems to
+            # be in violation of the protocol (which only allows
+            # 1xx or error messages for LIST), so we just discard
+            # this response.
+            if resp[0] == '2':
+               resp = self.getresp()
             if resp[0] != '1':
                 raise error_reply, resp
         else:
@@ -332,6 +340,9 @@
             if rest is not None:
                 self.sendcmd("REST %s" % rest)
             resp = self.sendcmd(cmd)
+            # See above.
+            if resp[0] == '2':
+               resp = self.getresp()
             if resp[0] != '1':
                 raise error_reply, resp
             conn, sockaddr = sock.accept()

Modified: python/branches/p3yk-noslice/Lib/functools.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/functools.py	(original)
+++ python/branches/p3yk-noslice/Lib/functools.py	Fri Dec 15 05:21:50 2006
@@ -7,7 +7,7 @@
 #   Copyright (C) 2006 Python Software Foundation.
 # See C source code for _functools credits/copyright
 
-from _functools import partial
+from _functools import partial, reduce
 
 # update_wrapper() and wraps() are tools to help write
 # wrapper functions that can handle naive introspection
@@ -25,14 +25,14 @@
        assigned is a tuple naming the attributes assigned directly
        from the wrapped function to the wrapper function (defaults to
        functools.WRAPPER_ASSIGNMENTS)
-       updated is a tuple naming the attributes off the wrapper that
+       updated is a tuple naming the attributes of the wrapper that
        are updated with the corresponding attribute from the wrapped
        function (defaults to functools.WRAPPER_UPDATES)
     """
     for attr in assigned:
         setattr(wrapper, attr, getattr(wrapped, attr))
     for attr in updated:
-        getattr(wrapper, attr).update(getattr(wrapped, attr))
+        getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
     # Return the wrapper so this can be used as a decorator via partial()
     return wrapper
 

Modified: python/branches/p3yk-noslice/Lib/gzip.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/gzip.py	(original)
+++ python/branches/p3yk-noslice/Lib/gzip.py	Fri Dec 15 05:21:50 2006
@@ -371,7 +371,12 @@
         self.extrasize = 0
         self.offset = 0
 
-    def seek(self, offset):
+    def seek(self, offset, whence=0):
+        if whence:
+            if whence == 1:
+                offset = self.offset + offset
+            else:
+                raise ValueError('Seek from end not supported')
         if self.mode == WRITE:
             if offset < self.offset:
                 raise IOError('Negative seek in write mode')

Modified: python/branches/p3yk-noslice/Lib/hashlib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/hashlib.py	(original)
+++ python/branches/p3yk-noslice/Lib/hashlib.py	Fri Dec 15 05:21:50 2006
@@ -18,8 +18,37 @@
 More algorithms may be available on your platform but the above are
 guaranteed to exist.
 
-Choose your hash function wisely.  Some have known weaknesses.
+Choose your hash function wisely.  Some have known collision weaknesses.
 sha384 and sha512 will be slow on 32 bit platforms.
+
+Hash objects have these methods:
+ - update(arg): Update the hash object with the string arg. Repeated calls
+                are equivalent to a single call with the concatenation of all
+                the arguments.
+ - digest():    Return the digest of the strings passed to the update() method
+                so far. This may contain non-ASCII characters, including
+                NUL bytes.
+ - hexdigest(): Like digest() except the digest is returned as a string of
+                double length, containing only hexadecimal digits.
+ - copy():      Return a copy (clone) of the hash object. This can be used to
+                efficiently compute the digests of strings that share a common
+                initial substring.
+
+For example, to obtain the digest of the string 'Nobody inspects the
+spammish repetition':
+
+    >>> import hashlib
+    >>> m = hashlib.md5()
+    >>> m.update("Nobody inspects")
+    >>> m.update(" the spammish repetition")
+    >>> m.digest()
+    '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
+
+More condensed:
+
+    >>> hashlib.sha224("Nobody inspects the spammish repetition").hexdigest()
+    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'
+
 """
 
 
@@ -82,11 +111,11 @@
             f = getattr(_hashlib, opensslFuncName)
             f()
             # Use the C function directly (very fast)
-            exec funcName + ' = f'
+            exec(funcName + ' = f')
         except ValueError:
             try:
                 # Use the builtin implementation directly (fast)
-                exec funcName + ' = __get_builtin_constructor(funcName)'
+                exec(funcName + ' = __get_builtin_constructor(funcName)')
             except ValueError:
                 # this one has no builtin implementation, don't define it
                 pass

Modified: python/branches/p3yk-noslice/Lib/httplib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/httplib.py	(original)
+++ python/branches/p3yk-noslice/Lib/httplib.py	Fri Dec 15 05:21:50 2006
@@ -704,7 +704,15 @@
         if self.debuglevel > 0:
             print "send:", repr(str)
         try:
-            self.sock.sendall(str)
+            blocksize=8192
+            if hasattr(str,'read') :
+                if self.debuglevel > 0: print "sendIng a read()able"
+                data=str.read(blocksize)
+                while data:
+                    self.sock.sendall(data)
+                    data=str.read(blocksize)
+            else:
+                self.sock.sendall(str)
         except socket.error, v:
             if v[0] == 32:      # Broken pipe
                 self.close()
@@ -879,7 +887,21 @@
         self.putrequest(method, url, **skips)
 
         if body and ('content-length' not in header_names):
-            self.putheader('Content-Length', str(len(body)))
+            thelen=None
+            try:
+                thelen=str(len(body))
+            except TypeError, te:
+                # If this is a file-like object, try to
+                # fstat its file descriptor
+                import os
+                try:
+                    thelen = str(os.fstat(body.fileno()).st_size)
+                except (AttributeError, OSError):
+                    # Don't send a length if this failed
+                    if self.debuglevel > 0: print "Cannot stat!!"
+                    
+            if thelen is not None:
+                self.putheader('Content-Length',thelen)
         for hdr, value in headers.iteritems():
             self.putheader(hdr, value)
         self.endheaders()

Modified: python/branches/p3yk-noslice/Lib/idlelib/CodeContext.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/CodeContext.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/CodeContext.py	Fri Dec 15 05:21:50 2006
@@ -54,25 +54,68 @@
 
     def toggle_code_context_event(self, event=None):
         if not self.label:
-            self.pad_frame = Tkinter.Frame(self.editwin.top,
-                                           bg=self.bgcolor, border=2,
-                                           relief="sunken")
-            self.label = Tkinter.Label(self.pad_frame,
-                                      text="\n" * (self.context_depth - 1),
-                                      anchor="w", justify="left",
-                                      font=self.textfont,
-                                      bg=self.bgcolor, fg=self.fgcolor,
-                                      border=0,
-                                      width=1, # Don't request more than we get
-                                      )
-            self.label.pack(side="top", fill="x", expand=True,
-                            padx=4, pady=0)
-            self.pad_frame.pack(side="top", fill="x", expand=False,
-                                padx=0, pady=0,
-                                after=self.editwin.status_bar)
+            # The following code attempts to figure out the required border
+            # width and vertical padding required for the CodeContext widget
+            # to be perfectly aligned with the text in the main Text widget.
+            # This is done by retrieving the appropriate attributes from the
+            # editwin.text and editwin.text_frame widgets.
+            #
+            # All values are passed through int(str(<value>)), since some
+            # values may be pixel objects, which can't simply be added added
+            # to ints.
+            #
+            # This code is considered somewhat unstable since it relies on
+            # some of Tk's inner workings. However its effect is merely
+            # cosmetic; failure will only cause the CodeContext text to be
+            # somewhat misaligned with the text in the main Text widget.
+            #
+            # To avoid possible errors, all references to the inner workings
+            # of Tk are executed inside try/except blocks.
+            
+            widgets_for_width_calc = self.editwin.text, self.editwin.text_frame
+
+            # calculate the required vertical padding
+            padx = 0
+            for widget in widgets_for_width_calc:
+                try:
+                    # retrieve the "padx" attribte from widget's pack info
+                    padx += int(str( widget.pack_info()['padx'] ))
+                except:
+                    pass
+                try:
+                    # retrieve the widget's "padx" attribte
+                    padx += int(str( widget.cget('padx') ))
+                except:
+                    pass
+
+            # calculate the required border width
+            border_width = 0
+            for widget in widgets_for_width_calc:
+                try:
+                    # retrieve the widget's "border" attribte
+                    border_width += int(str( widget.cget('border') ))
+                except:
+                    pass
+
+            self.label = Tkinter.Label(self.editwin.top,
+                                       text="\n" * (self.context_depth - 1),
+                                       anchor="w", justify="left",
+                                       font=self.textfont,
+                                       bg=self.bgcolor, fg=self.fgcolor,
+                                       width=1, #don't request more than we get
+                                       padx=padx, #line up with text widget
+                                       border=border_width, #match border width
+                                       relief="sunken",
+                                       )
+
+            # CodeContext's label widget is packed before and above the
+            # text_frame widget, thus ensuring that it will appear directly
+            # above it.
+            self.label.pack(side="top", fill="x", expand=False,
+                            before=self.editwin.text_frame)
+            
         else:
             self.label.destroy()
-            self.pad_frame.destroy()
             self.label = None
         idleConf.SetOption("extensions", "CodeContext", "visible",
                            str(self.label is not None))

Modified: python/branches/p3yk-noslice/Lib/idlelib/ColorDelegator.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/ColorDelegator.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/ColorDelegator.py	Fri Dec 15 05:21:50 2006
@@ -16,7 +16,7 @@
     kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
     builtinlist = [str(name) for name in dir(__builtin__)
                                         if not name.startswith('_')]
-    # self.file = file("file") :
+    # self.file = open("file") :
     # 1st 'file' colorized normal, 2nd as builtin, 3rd as string
     builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
     comment = any("COMMENT", [r"#[^\n]*"])

Modified: python/branches/p3yk-noslice/Lib/idlelib/EditorWindow.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/EditorWindow.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/EditorWindow.py	Fri Dec 15 05:21:50 2006
@@ -102,8 +102,8 @@
             self.top.instance_dict = {}
         self.recent_files_path = os.path.join(idleConf.GetUserCfgDir(),
                 'recent-files.lst')
-        self.vbar = vbar = Scrollbar(top, name='vbar')
         self.text_frame = text_frame = Frame(top)
+        self.vbar = vbar = Scrollbar(text_frame, name='vbar')
         self.width = idleConf.GetOption('main','EditorWindow','width')
         self.text = text = MultiCallCreator(Text)(
                 text_frame, name='text', padx=5, wrap='none',
@@ -1138,7 +1138,7 @@
             if not self.context_use_ps1:
                 for context in self.num_context_lines:
                     startat = max(lno - context, 1)
-                    startatindex = `startat` + ".0"
+                    startatindex = repr(startat) + ".0"
                     rawtext = text.get(startatindex, "insert")
                     y.set_str(rawtext)
                     bod = y.find_good_parse_start(

Modified: python/branches/p3yk-noslice/Lib/idlelib/HyperParser.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/HyperParser.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/HyperParser.py	Fri Dec 15 05:21:50 2006
@@ -31,7 +31,7 @@
         if not editwin.context_use_ps1:
             for context in editwin.num_context_lines:
                 startat = max(lno - context, 1)
-                startatindex = `startat` + ".0"
+                startatindex = repr(startat) + ".0"
                 stopatindex = "%d.end" % lno
                 # We add the newline because PyParse requires a newline at end.
                 # We add a space so that index won't be at end of line, so that

Modified: python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt	Fri Dec 15 05:21:50 2006
@@ -3,6 +3,13 @@
 
 *Release date: XX-XXX-200X*
 
+- Patch #1362975: Rework CodeContext indentation algorithm to
+  avoid hard-coding pixel widths.
+
+- Some syntax errors were being caught by tokenize during the tabnanny
+  check, resulting in obscure error messages.  Do the syntax check
+  first.  Bug 1562716, 1562719
+
 - IDLE's version number takes a big jump to match the version number of
   the Python release of which it's a part.
 

Modified: python/branches/p3yk-noslice/Lib/idlelib/PyShell.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/PyShell.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/PyShell.py	Fri Dec 15 05:21:50 2006
@@ -351,6 +351,8 @@
 
     def build_subprocess_arglist(self):
         w = ['-W' + s for s in sys.warnoptions]
+        if 1/2 > 0: # account for new division
+            w.append('-Qnew')
         # Maybe IDLE is installed and is being accessed via sys.path,
         # or maybe it's not installed and the idle.py script is being
         # run from the IDLE source directory.
@@ -690,7 +692,7 @@
         if self.rpcclt:
             self.rpcclt.remotequeue("exec", "runcode", (code,), {})
         else:
-            exec code in self.locals
+            exec(code, self.locals)
         return 1
 
     def runcode(self, code):
@@ -711,7 +713,7 @@
                 elif debugger:
                     debugger.run(code, self.locals)
                 else:
-                    exec code in self.locals
+                    exec(code, self.locals)
             except SystemExit:
                 if not self.tkconsole.closing:
                     if tkMessageBox.askyesno(
@@ -726,6 +728,8 @@
                     raise
             except:
                 if use_subprocess:
+                    # When run w/o subprocess, both user and IDLE errors
+                    # are printed here; skip message in that case.
                     print >> self.tkconsole.stderr, \
                              "IDLE internal error in runcode()"
                 self.showtraceback()

Modified: python/branches/p3yk-noslice/Lib/idlelib/ScriptBinding.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/ScriptBinding.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/ScriptBinding.py	Fri Dec 15 05:21:50 2006
@@ -57,9 +57,10 @@
         filename = self.getfilename()
         if not filename:
             return
+        if not self.checksyntax(filename):
+            return
         if not self.tabnanny(filename):
             return
-        self.checksyntax(filename)
 
     def tabnanny(self, filename):
         f = open(filename, 'r')
@@ -76,9 +77,6 @@
             self.editwin.gotoline(nag.get_lineno())
             self.errorbox("Tab/space error", indent_message)
             return False
-        except IndentationError:
-            # From tokenize(), let compile() in checksyntax find it again.
-            pass
         return True
 
     def checksyntax(self, filename):
@@ -139,11 +137,11 @@
         filename = self.getfilename()
         if not filename:
             return
-        if not self.tabnanny(filename):
-            return
         code = self.checksyntax(filename)
         if not code:
             return
+        if not self.tabnanny(filename):
+            return
         shell = self.shell
         interp = shell.interp
         if PyShell.use_subprocess:

Modified: python/branches/p3yk-noslice/Lib/idlelib/run.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/run.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/run.py	Fri Dec 15 05:21:50 2006
@@ -282,7 +282,7 @@
     def runcode(self, code):
         try:
             self.usr_exc_info = None
-            exec code in self.locals
+            exec(code, self.locals)
         except:
             self.usr_exc_info = sys.exc_info()
             if quitting:

Modified: python/branches/p3yk-noslice/Lib/ihooks.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ihooks.py	(original)
+++ python/branches/p3yk-noslice/Lib/ihooks.py	Fri Dec 15 05:21:50 2006
@@ -323,7 +323,7 @@
             m.__path__ = path
         m.__file__ = filename
         try:
-            exec code in m.__dict__
+            exec(code, m.__dict__)
         except:
             d = self.hooks.modules_dict()
             if name in d:

Modified: python/branches/p3yk-noslice/Lib/imputil.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/imputil.py	(original)
+++ python/branches/p3yk-noslice/Lib/imputil.py	Fri Dec 15 05:21:50 2006
@@ -301,7 +301,7 @@
         # execute the code within the module's namespace
         if not is_module:
             try:
-                exec code in module.__dict__
+                exec(code, module.__dict__)
             except:
                 if fqname in sys.modules:
                     del sys.modules[fqname]

Modified: python/branches/p3yk-noslice/Lib/inspect.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/inspect.py	(original)
+++ python/branches/p3yk-noslice/Lib/inspect.py	Fri Dec 15 05:21:50 2006
@@ -403,6 +403,7 @@
     return os.path.normcase(os.path.abspath(_filename))
 
 modulesbyfile = {}
+_filesbymodname = {}
 
 def getmodule(object, _filename=None):
     """Return the module an object was defined in, or None if not found."""
@@ -410,19 +411,32 @@
         return object
     if hasattr(object, '__module__'):
         return sys.modules.get(object.__module__)
+    # Try the filename to modulename cache
+    if _filename is not None and _filename in modulesbyfile:
+        return sys.modules.get(modulesbyfile[_filename])
+    # Try the cache again with the absolute file name
     try:
         file = getabsfile(object, _filename)
     except TypeError:
         return None
     if file in modulesbyfile:
         return sys.modules.get(modulesbyfile[file])
-    for module in sys.modules.values():
+    # Update the filename to module name cache and check yet again
+    # Copy sys.modules in order to cope with changes while iterating
+    for modname, module in sys.modules.items():
         if ismodule(module) and hasattr(module, '__file__'):
+            f = module.__file__
+            if f == _filesbymodname.get(modname, None):
+                # Have already mapped this module, so skip it
+                continue
+            _filesbymodname[modname] = f
             f = getabsfile(module)
+            # Always map to the name the module knows itself by
             modulesbyfile[f] = modulesbyfile[
                 os.path.realpath(f)] = module.__name__
     if file in modulesbyfile:
         return sys.modules.get(modulesbyfile[file])
+    # Check the main module
     main = sys.modules['__main__']
     if not hasattr(object, '__name__'):
         return None
@@ -430,6 +444,7 @@
         mainobject = getattr(main, object.__name__)
         if mainobject is object:
             return main
+    # Check builtins
     builtin = sys.modules['__builtin__']
     if hasattr(builtin, object.__name__):
         builtinobject = getattr(builtin, object.__name__)
@@ -444,7 +459,7 @@
     in the file and the line number indexes a line in that list.  An IOError
     is raised if the source code cannot be retrieved."""
     file = getsourcefile(object) or getfile(object)
-    module = getmodule(object)
+    module = getmodule(object, file)
     if module:
         lines = linecache.getlines(file, module.__dict__)
     else:
@@ -457,9 +472,24 @@
 
     if isclass(object):
         name = object.__name__
-        pat = re.compile(r'^\s*class\s*' + name + r'\b')
+        pat = re.compile(r'^(\s*)class\s*' + name + r'\b')
+        # make some effort to find the best matching class definition:
+        # use the one with the least indentation, which is the one
+        # that's most probably not inside a function definition.
+        candidates = []
         for i in range(len(lines)):
-            if pat.match(lines[i]): return lines, i
+            match = pat.match(lines[i])
+            if match:
+                # if it's at toplevel, it's already the best one
+                if lines[i][0] == 'c':
+                    return lines, i
+                # else add whitespace to candidate list
+                candidates.append((match.group(1), i))
+        if candidates:
+            # this will sort by whitespace, and by line number,
+            # less whitespace first
+            candidates.sort()
+            return lines, candidates[0][1]
         else:
             raise IOError('could not find class definition')
 

Modified: python/branches/p3yk-noslice/Lib/keyword.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/keyword.py	(original)
+++ python/branches/p3yk-noslice/Lib/keyword.py	Fri Dec 15 05:21:50 2006
@@ -25,7 +25,6 @@
         'elif',
         'else',
         'except',
-        'exec',
         'finally',
         'for',
         'from',

Modified: python/branches/p3yk-noslice/Lib/lib-tk/Tix.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/lib-tk/Tix.py	(original)
+++ python/branches/p3yk-noslice/Lib/lib-tk/Tix.py	Fri Dec 15 05:21:50 2006
@@ -421,7 +421,7 @@
             except:
                 plist = []
 
-        if (not check_intermediate) or len(plist) < 2:
+        if not check_intermediate:
             # immediate descendant
             TixWidget.__init__(self, master, None, None, {'name' : name})
         else:
@@ -437,6 +437,9 @@
                     parent = TixSubWidget(parent, plist[i],
                                           destroy_physically=0,
                                           check_intermediate=0)
+            # The Tk widget name is in plist, not in name
+            if plist:
+                name = plist[-1]
             TixWidget.__init__(self, parent, None, None, {'name' : name})
         self.destroy_physically = destroy_physically
 

Modified: python/branches/p3yk-noslice/Lib/lib-tk/Tkinter.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/lib-tk/Tkinter.py	(original)
+++ python/branches/p3yk-noslice/Lib/lib-tk/Tkinter.py	Fri Dec 15 05:21:50 2006
@@ -1699,7 +1699,7 @@
         base_tcl = os.path.join(home, '.%s.tcl' % baseName)
         base_py = os.path.join(home, '.%s.py' % baseName)
         dir = {'self': self}
-        exec 'from Tkinter import *' in dir
+        exec('from Tkinter import *', dir)
         if os.path.isfile(class_tcl):
             self.tk.call('source', class_tcl)
         if os.path.isfile(class_py):
@@ -3017,7 +3017,7 @@
         self.tk.call(self._w, 'scan', 'dragto', x, y)
     def search(self, pattern, index, stopindex=None,
            forwards=None, backwards=None, exact=None,
-           regexp=None, nocase=None, count=None):
+           regexp=None, nocase=None, count=None, elide=None):
         """Search PATTERN beginning from INDEX until STOPINDEX.
         Return the index of the first character of a match or an empty string."""
         args = [self._w, 'search']
@@ -3026,6 +3026,7 @@
         if exact: args.append('-exact')
         if regexp: args.append('-regexp')
         if nocase: args.append('-nocase')
+        if elide: args.append('-elide')
         if count: args.append('-count'); args.append(count)
         if pattern[0] == '-': args.append('--')
         args.append(pattern)

Modified: python/branches/p3yk-noslice/Lib/lib-tk/tkMessageBox.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/lib-tk/tkMessageBox.py	(original)
+++ python/branches/p3yk-noslice/Lib/lib-tk/tkMessageBox.py	Fri Dec 15 05:21:50 2006
@@ -102,6 +102,15 @@
     s = _show(title, message, QUESTION, YESNO, **options)
     return s == YES
 
+def askyesnocancel(title=None, message=None, **options):
+    "Ask a question; return true if the answer is yes, None if cancelled."
+    s = _show(title, message, QUESTION, YESNOCANCEL, **options)
+    # s might be a Tcl index object, so convert it to a string
+    s = str(s)
+    if s == CANCEL:
+        return None
+    return s == YES
+
 def askretrycancel(title=None, message=None, **options):
     "Ask if operation should be retried; return true if the answer is yes"
     s = _show(title, message, WARNING, RETRYCANCEL, **options)
@@ -119,4 +128,5 @@
     print "question", askquestion("Spam", "Question?")
     print "proceed", askokcancel("Spam", "Proceed?")
     print "yes/no", askyesno("Spam", "Got it?")
+    print "yes/no/cancel", askyesnocancel("Spam", "Want it?")
     print "try again", askretrycancel("Spam", "Try again?")

Modified: python/branches/p3yk-noslice/Lib/lib-tk/tkSimpleDialog.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/lib-tk/tkSimpleDialog.py	(original)
+++ python/branches/p3yk-noslice/Lib/lib-tk/tkSimpleDialog.py	Fri Dec 15 05:21:50 2006
@@ -46,8 +46,13 @@
             title -- the dialog title
         '''
         Toplevel.__init__(self, parent)
-        self.transient(parent)
 
+        # If the master is not viewable, don't
+        # make the child transient, or else it
+        # would be opened withdrawn
+        if parent.winfo_viewable():  
+            self.transient(parent)
+ 
         if title:
             self.title(title)
 
@@ -124,9 +129,10 @@
         self.withdraw()
         self.update_idletasks()
 
-        self.apply()
-
-        self.cancel()
+        try:
+            self.apply()
+        finally:
+            self.cancel()
 
     def cancel(self, event=None):
 

Modified: python/branches/p3yk-noslice/Lib/lib-tk/turtle.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/lib-tk/turtle.py	(original)
+++ python/branches/p3yk-noslice/Lib/lib-tk/turtle.py	Fri Dec 15 05:21:50 2006
@@ -15,6 +15,7 @@
 """
 
 from math import * # Also for export
+from time import sleep
 import Tkinter
 
 speeds = ['fastest', 'fast', 'normal', 'slow', 'slowest']
@@ -949,7 +950,6 @@
 
 
 if __name__ == '__main__':
-    from time import sleep
     demo()
     sleep(3)
     demo2()

Modified: python/branches/p3yk-noslice/Lib/logging/__init__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/logging/__init__.py	(original)
+++ python/branches/p3yk-noslice/Lib/logging/__init__.py	Fri Dec 15 05:21:50 2006
@@ -214,7 +214,7 @@
     information to be logged.
     """
     def __init__(self, name, level, pathname, lineno,
-                 msg, args, exc_info, func):
+                 msg, args, exc_info, func=None):
         """
         Initialize a logging record with interesting information.
         """
@@ -910,9 +910,11 @@
         Ensure that children of the placeholder ph are connected to the
         specified logger.
         """
-        #for c in ph.loggers:
+        name = alogger.name
+        namelen = len(name)
         for c in ph.loggerMap.keys():
-            if string.find(c.parent.name, alogger.name) <> 0:
+            #The if means ... if not c.parent.name.startswith(nm)
+            if c.parent.name[:namelen] != name:
                 alogger.parent = c.parent
                 c.parent = alogger
 

Modified: python/branches/p3yk-noslice/Lib/logging/config.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/logging/config.py	(original)
+++ python/branches/p3yk-noslice/Lib/logging/config.py	Fri Dec 15 05:21:50 2006
@@ -27,7 +27,7 @@
 To use, simply 'import logging' and log away!
 """
 
-import sys, logging, logging.handlers, string, socket, struct, os, traceback
+import sys, logging, logging.handlers, string, socket, struct, os, traceback, types
 
 try:
     import thread
@@ -110,7 +110,7 @@
     flist = string.split(flist, ",")
     formatters = {}
     for form in flist:
-        sectname = "formatter_%s" % form
+        sectname = "formatter_%s" % string.strip(form)
         opts = cp.options(sectname)
         if "format" in opts:
             fs = cp.get(sectname, "format", 1)
@@ -139,7 +139,7 @@
     handlers = {}
     fixups = [] #for inter-handler references
     for hand in hlist:
-        sectname = "handler_%s" % hand
+        sectname = "handler_%s" % string.strip(hand)
         klass = cp.get(sectname, "class")
         opts = cp.options(sectname)
         if "formatter" in opts:
@@ -176,6 +176,7 @@
     # configure the root first
     llist = cp.get("loggers", "keys")
     llist = string.split(llist, ",")
+    llist = map(lambda x: string.strip(x), llist)
     llist.remove("root")
     sectname = "logger_root"
     root = logging.root
@@ -190,7 +191,7 @@
     if len(hlist):
         hlist = string.split(hlist, ",")
         for hand in hlist:
-            log.addHandler(handlers[hand])
+            log.addHandler(handlers[string.strip(hand)])
 
     #and now the others...
     #we don't want to lose the existing loggers,
@@ -225,7 +226,7 @@
         if len(hlist):
             hlist = string.split(hlist, ",")
             for hand in hlist:
-                logger.addHandler(handlers[hand])
+                logger.addHandler(handlers[string.strip(hand)])
 
     #Disable any old loggers. There's no point deleting
     #them as other threads may continue to hold references

Modified: python/branches/p3yk-noslice/Lib/logging/handlers.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/logging/handlers.py	(original)
+++ python/branches/p3yk-noslice/Lib/logging/handlers.py	Fri Dec 15 05:21:50 2006
@@ -590,11 +590,11 @@
         self.address = address
         self.facility = facility
         if type(address) == types.StringType:
-            self._connect_unixsocket(address)
             self.unixsocket = 1
+            self._connect_unixsocket(address)
         else:
-            self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
             self.unixsocket = 0
+            self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 
         self.formatter = None
 

Modified: python/branches/p3yk-noslice/Lib/macpath.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/macpath.py	(original)
+++ python/branches/p3yk-noslice/Lib/macpath.py	Fri Dec 15 05:21:50 2006
@@ -2,6 +2,7 @@
 
 import os
 from stat import *
+from genericpath import *
 
 __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
            "basename","dirname","commonprefix","getsize","getmtime",
@@ -101,31 +102,6 @@
     components = split(s)
     return len(components) == 2 and components[1] == ''
 
-def isdir(s):
-    """Return true if the pathname refers to an existing directory."""
-
-    try:
-        st = os.stat(s)
-    except os.error:
-        return 0
-    return S_ISDIR(st.st_mode)
-
-
-# Get size, mtime, atime of files.
-
-def getsize(filename):
-    """Return the size of a file, reported by os.stat()."""
-    return os.stat(filename).st_size
-
-def getmtime(filename):
-    """Return the last modification time of a file, reported by os.stat()."""
-    return os.stat(filename).st_mtime
-
-def getatime(filename):
-    """Return the last access time of a file, reported by os.stat()."""
-    return os.stat(filename).st_atime
-
-
 def islink(s):
     """Return true if the pathname refers to a symbolic link."""
 
@@ -135,29 +111,6 @@
     except:
         return False
 
-
-def isfile(s):
-    """Return true if the pathname refers to an existing regular file."""
-
-    try:
-        st = os.stat(s)
-    except os.error:
-        return False
-    return S_ISREG(st.st_mode)
-
-def getctime(filename):
-    """Return the creation time of a file, reported by os.stat()."""
-    return os.stat(filename).st_ctime
-
-def exists(s):
-    """Test whether a path exists.  Returns False for broken symbolic links"""
-
-    try:
-        st = os.stat(s)
-    except os.error:
-        return False
-    return True
-
 # Is `stat`/`lstat` a meaningful difference on the Mac?  This is safe in any
 # case.
 
@@ -170,20 +123,6 @@
         return False
     return True
 
-# Return the longest prefix of all list elements.
-
-def commonprefix(m):
-    "Given a list of pathnames, returns the longest common leading component"
-    if not m: return ''
-    s1 = min(m)
-    s2 = max(m)
-    n = min(len(s1), len(s2))
-    for i in xrange(n):
-        if s1[i] != s2[i]:
-            return s1[:i]
-    return s1[:n]
-
-
 def expandvars(path):
     """Dummy to retain interface-compatibility with other operating systems."""
     return path

Modified: python/branches/p3yk-noslice/Lib/mailbox.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/mailbox.py	(original)
+++ python/branches/p3yk-noslice/Lib/mailbox.py	Fri Dec 15 05:21:50 2006
@@ -2,6 +2,12 @@
 
 """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
 
+# Notes for authors of new mailbox subclasses:
+#
+# Remember to fsync() changes to disk before closing a modified file
+# or returning from a flush() method.  See functions _sync_flush() and
+# _sync_close().
+
 import sys
 import os
 import time
@@ -235,7 +241,7 @@
         try:
             self._dump_message(message, tmp_file)
         finally:
-            tmp_file.close()
+            _sync_close(tmp_file)
         if isinstance(message, MaildirMessage):
             subdir = message.get_subdir()
             suffix = self.colon + message.get_info()
@@ -246,7 +252,19 @@
             suffix = ''
         uniq = os.path.basename(tmp_file.name).split(self.colon)[0]
         dest = os.path.join(self._path, subdir, uniq + suffix)
-        os.rename(tmp_file.name, dest)
+        try:
+            if hasattr(os, 'link'):
+                os.link(tmp_file.name, dest)
+                os.remove(tmp_file.name)
+            else:
+                os.rename(tmp_file.name, dest)
+        except OSError, e:
+            os.remove(tmp_file.name)
+            if e.errno == errno.EEXIST:
+                raise ExternalClashError('Name clash with existing message: %s'
+                                         % dest)
+            else:
+                raise
         if isinstance(message, MaildirMessage):
             os.utime(dest, (os.path.getatime(dest), message.get_date()))
         return uniq
@@ -364,12 +382,14 @@
 
     def get_folder(self, folder):
         """Return a Maildir instance for the named folder."""
-        return Maildir(os.path.join(self._path, '.' + folder), create=False)
+        return Maildir(os.path.join(self._path, '.' + folder),
+                       factory=self._factory,
+                       create=False)
 
     def add_folder(self, folder):
         """Create a folder and return a Maildir instance representing it."""
         path = os.path.join(self._path, '.' + folder)
-        result = Maildir(path)
+        result = Maildir(path, factory=self._factory)
         maildirfolder_path = os.path.join(path, 'maildirfolder')
         if not os.path.exists(maildirfolder_path):
             os.close(os.open(maildirfolder_path, os.O_CREAT | os.O_WRONLY))
@@ -420,12 +440,17 @@
         except OSError, e:
             if e.errno == errno.ENOENT:
                 Maildir._count += 1
-                return open(path, 'wb+')
+                try:
+                    return _create_carefully(path)
+                except OSError, e:
+                    if e.errno != errno.EEXIST:
+                        raise
             else:
                 raise
-        else:
-            raise ExternalClashError('Name clash prevented file creation: %s' %
-                                     path)
+
+        # Fall through to here if stat succeeded or open raised EEXIST.
+        raise ExternalClashError('Name clash prevented file creation: %s' %
+                                 path)
 
     def _refresh(self):
         """Update table of contents mapping."""
@@ -560,7 +585,8 @@
             new_file.close()
             os.remove(new_file.name)
             raise
-        new_file.close()
+        _sync_close(new_file)
+        # self._file is about to get replaced, so no need to sync.
         self._file.close()
         try:
             os.rename(new_file.name, self._path)
@@ -575,7 +601,7 @@
         self._toc = new_toc
         self._pending = False
         if self._locked:
-            _lock_file(new_file, dotlock=False)
+            _lock_file(self._file, dotlock=False)
 
     def _pre_mailbox_hook(self, f):
         """Called before writing the mailbox to file f."""
@@ -594,7 +620,7 @@
         self.flush()
         if self._locked:
             self.unlock()
-        self._file.close()
+        self._file.close()  # Sync has been done by self.flush() above.
 
     def _lookup(self, key=None):
         """Return (start, stop) or raise KeyError."""
@@ -784,7 +810,7 @@
                 if self._locked:
                     _unlock_file(f)
         finally:
-            f.close()
+            _sync_close(f)
         return new_key
 
     def remove(self, key):
@@ -831,7 +857,7 @@
                 if self._locked:
                     _unlock_file(f)
         finally:
-            f.close()
+            _sync_close(f)
 
     def get_message(self, key):
         """Return a Message representation or raise a KeyError."""
@@ -918,7 +944,7 @@
         """Unlock the mailbox if it is locked."""
         if self._locked:
             _unlock_file(self._file)
-            self._file.close()
+            _sync_close(self._file)
             del self._file
             self._locked = False
 
@@ -941,11 +967,13 @@
 
     def get_folder(self, folder):
         """Return an MH instance for the named folder."""
-        return MH(os.path.join(self._path, folder), create=False)
+        return MH(os.path.join(self._path, folder),
+                  factory=self._factory, create=False)
 
     def add_folder(self, folder):
         """Create a folder and return an MH instance representing it."""
-        return MH(os.path.join(self._path, folder))
+        return MH(os.path.join(self._path, folder),
+                  factory=self._factory)
 
     def remove_folder(self, folder):
         """Delete the named folder, which must be empty."""
@@ -1013,7 +1041,7 @@
                 else:
                     f.write('\n')
         finally:
-            f.close()
+            _sync_close(f)
 
     def pack(self):
         """Re-name messages to eliminate numbering gaps. Invalidates keys."""
@@ -1023,27 +1051,13 @@
         for key in self.iterkeys():
             if key - 1 != prev:
                 changes.append((key, prev + 1))
-                f = open(os.path.join(self._path, str(key)), 'r+')
-                try:
-                    if self._locked:
-                        _lock_file(f)
-                    try:
-                        if hasattr(os, 'link'):
-                            os.link(os.path.join(self._path, str(key)),
-                                    os.path.join(self._path, str(prev + 1)))
-                            if sys.platform == 'os2emx':
-                                # cannot unlink an open file on OS/2
-                                f.close()
-                            os.unlink(os.path.join(self._path, str(key)))
-                        else:
-                            f.close()
-                            os.rename(os.path.join(self._path, str(key)),
-                                      os.path.join(self._path, str(prev + 1)))
-                    finally:
-                        if self._locked:
-                            _unlock_file(f)
-                finally:
-                    f.close()
+                if hasattr(os, 'link'):
+                    os.link(os.path.join(self._path, str(key)),
+                            os.path.join(self._path, str(prev + 1)))
+                    os.unlink(os.path.join(self._path, str(key)))
+                else:
+                    os.rename(os.path.join(self._path, str(key)),
+                              os.path.join(self._path, str(prev + 1)))
             prev += 1
         self._next_key = prev + 1
         if len(changes) == 0:
@@ -1867,6 +1881,15 @@
                                               socket.gethostname(),
                                               os.getpid()))
 
+def _sync_flush(f):
+    """Ensure changes to file f are physically on disk."""
+    f.flush()
+    os.fsync(f.fileno())
+
+def _sync_close(f):
+    """Close file f, ensuring all changes are physically on disk."""
+    _sync_flush(f)
+    f.close()
 
 ## Start: classes from the original module (for backward compatibility).
 

Modified: python/branches/p3yk-noslice/Lib/modulefinder.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/modulefinder.py	(original)
+++ python/branches/p3yk-noslice/Lib/modulefinder.py	Fri Dec 15 05:21:50 2006
@@ -1,13 +1,14 @@
 """Find modules used by a script, using introspection."""
-
 # This module should be kept compatible with Python 2.2, see PEP 291.
 
+from __future__ import generators
 import dis
 import imp
 import marshal
 import os
 import sys
 import new
+import struct
 
 if hasattr(sys.__stdout__, "newlines"):
     READ_MODE = "U"  # universal line endings
@@ -15,11 +16,12 @@
     # remain compatible with Python  < 2.3
     READ_MODE = "r"
 
-LOAD_CONST = dis.opname.index('LOAD_CONST')
-IMPORT_NAME = dis.opname.index('IMPORT_NAME')
-STORE_NAME = dis.opname.index('STORE_NAME')
-STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
+LOAD_CONST = chr(dis.opname.index('LOAD_CONST'))
+IMPORT_NAME = chr(dis.opname.index('IMPORT_NAME'))
+STORE_NAME = chr(dis.opname.index('STORE_NAME'))
+STORE_GLOBAL = chr(dis.opname.index('STORE_GLOBAL'))
 STORE_OPS = [STORE_NAME, STORE_GLOBAL]
+HAVE_ARGUMENT = chr(dis.HAVE_ARGUMENT)
 
 # Modulefinder does a good job at simulating Python's, but it can not
 # handle __path__ modifications packages make at runtime.  Therefore there
@@ -118,9 +120,9 @@
         stuff = (ext, "r", imp.PY_SOURCE)
         self.load_module(name, fp, pathname, stuff)
 
-    def import_hook(self, name, caller=None, fromlist=None):
-        self.msg(3, "import_hook", name, caller, fromlist)
-        parent = self.determine_parent(caller)
+    def import_hook(self, name, caller=None, fromlist=None, level=-1):
+        self.msg(3, "import_hook", name, caller, fromlist, level)
+        parent = self.determine_parent(caller, level=level)
         q, tail = self.find_head_package(parent, name)
         m = self.load_tail(q, tail)
         if not fromlist:
@@ -129,12 +131,26 @@
             self.ensure_fromlist(m, fromlist)
         return None
 
-    def determine_parent(self, caller):
-        self.msgin(4, "determine_parent", caller)
-        if not caller:
+    def determine_parent(self, caller, level=-1):
+        self.msgin(4, "determine_parent", caller, level)
+        if not caller or level == 0:
             self.msgout(4, "determine_parent -> None")
             return None
         pname = caller.__name__
+        if level >= 1: # relative import
+            if caller.__path__:
+                level -= 1
+            if level == 0:
+                parent = self.modules[pname]
+                assert parent is caller
+                self.msgout(4, "determine_parent ->", parent)
+                return parent
+            if pname.count(".") < level:
+                raise ImportError, "relative importpath too deep"
+            pname = ".".join(pname.split(".")[:-level])
+            parent = self.modules[pname]
+            self.msgout(4, "determine_parent ->", parent)
+            return parent
         if caller.__path__:
             parent = self.modules[pname]
             assert caller is parent
@@ -294,13 +310,13 @@
             self.badmodules[name] = {}
         self.badmodules[name][caller.__name__] = 1
 
-    def _safe_import_hook(self, name, caller, fromlist):
+    def _safe_import_hook(self, name, caller, fromlist, level=-1):
         # wrapper for self.import_hook() that won't raise ImportError
         if name in self.badmodules:
             self._add_badmodule(name, caller)
             return
         try:
-            self.import_hook(name, caller)
+            self.import_hook(name, caller, level=level)
         except ImportError, msg:
             self.msg(2, "ImportError:", str(msg))
             self._add_badmodule(name, caller)
@@ -311,38 +327,83 @@
                         self._add_badmodule(sub, caller)
                         continue
                     try:
-                        self.import_hook(name, caller, [sub])
+                        self.import_hook(name, caller, [sub], level=level)
                     except ImportError, msg:
                         self.msg(2, "ImportError:", str(msg))
                         fullname = name + "." + sub
                         self._add_badmodule(fullname, caller)
 
+    def scan_opcodes(self, co,
+                     unpack = struct.unpack):
+        # Scan the code, and yield 'interesting' opcode combinations
+        # Version for Python 2.4 and older
+        code = co.co_code
+        names = co.co_names
+        consts = co.co_consts
+        while code:
+            c = code[0]
+            if c in STORE_OPS:
+                oparg, = unpack('<H', code[1:3])
+                yield "store", (names[oparg],)
+                code = code[3:]
+                continue
+            if c == LOAD_CONST and code[3] == IMPORT_NAME:
+                oparg_1, oparg_2 = unpack('<xHxH', code[:6])
+                yield "import", (consts[oparg_1], names[oparg_2])
+                code = code[6:]
+                continue
+            if c >= HAVE_ARGUMENT:
+                code = code[3:]
+            else:
+                code = code[1:]
+
+    def scan_opcodes_25(self, co,
+                     unpack = struct.unpack):
+        # Scan the code, and yield 'interesting' opcode combinations
+        # Python 2.5 version (has absolute and relative imports)
+        code = co.co_code
+        names = co.co_names
+        consts = co.co_consts
+        LOAD_LOAD_AND_IMPORT = LOAD_CONST + LOAD_CONST + IMPORT_NAME
+        while code:
+            c = code[0]
+            if c in STORE_OPS:
+                oparg, = unpack('<H', code[1:3])
+                yield "store", (names[oparg],)
+                code = code[3:]
+                continue
+            if code[:9:3] == LOAD_LOAD_AND_IMPORT:
+                oparg_1, oparg_2, oparg_3 = unpack('<xHxHxH', code[:9])
+                level = consts[oparg_1]
+                if level == 0: # absolute import
+                    yield "absolute_import", (consts[oparg_2], names[oparg_3])
+                else: # relative import
+                    yield "relative_import", (level, consts[oparg_2], names[oparg_3])
+                code = code[9:]
+                continue
+            if c >= HAVE_ARGUMENT:
+                code = code[3:]
+            else:
+                code = code[1:]
+
     def scan_code(self, co, m):
         code = co.co_code
-        n = len(code)
-        i = 0
-        fromlist = None
-        while i < n:
-            c = code[i]
-            i = i+1
-            op = ord(c)
-            if op >= dis.HAVE_ARGUMENT:
-                oparg = ord(code[i]) + ord(code[i+1])*256
-                i = i+2
-            if op == LOAD_CONST:
-                # An IMPORT_NAME is always preceded by a LOAD_CONST, it's
-                # a tuple of "from" names, or None for a regular import.
-                # The tuple may contain "*" for "from <mod> import *"
-                fromlist = co.co_consts[oparg]
-            elif op == IMPORT_NAME:
-                assert fromlist is None or type(fromlist) is tuple
-                name = co.co_names[oparg]
+        if sys.version_info >= (2, 5):
+            scanner = self.scan_opcodes_25
+        else:
+            scanner = self.scan_opcodes
+        for what, args in scanner(co):
+            if what == "store":
+                name, = args
+                m.globalnames[name] = 1
+            elif what == "absolute_import":
+                fromlist, name = args
                 have_star = 0
                 if fromlist is not None:
                     if "*" in fromlist:
                         have_star = 1
                     fromlist = [f for f in fromlist if f != "*"]
-                self._safe_import_hook(name, m, fromlist)
+                self._safe_import_hook(name, m, fromlist, level=0)
                 if have_star:
                     # We've encountered an "import *". If it is a Python module,
                     # the code has already been parsed and we can suck out the
@@ -362,10 +423,17 @@
                             m.starimports[name] = 1
                     else:
                         m.starimports[name] = 1
-            elif op in STORE_OPS:
-                # keep track of all global names that are assigned to
-                name = co.co_names[oparg]
-                m.globalnames[name] = 1
+            elif what == "relative_import":
+                level, fromlist, name = args
+                if name:
+                    self._safe_import_hook(name, m, fromlist, level=level)
+                else:
+                    parent = self.determine_parent(m, level=level)
+                    self._safe_import_hook(parent.__name__, None, fromlist, level=0)
+            else:
+                # We don't expect anything else from the generator.
+                raise RuntimeError(what)
+
         for c in co.co_consts:
             if isinstance(c, type(co)):
                 self.scan_code(c, m)

Modified: python/branches/p3yk-noslice/Lib/ntpath.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/ntpath.py	(original)
+++ python/branches/p3yk-noslice/Lib/ntpath.py	Fri Dec 15 05:21:50 2006
@@ -8,6 +8,7 @@
 import os
 import stat
 import sys
+from genericpath import *
 
 __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
            "basename","dirname","commonprefix","getsize","getmtime",
@@ -206,86 +207,18 @@
     """Returns the directory component of a pathname"""
     return split(p)[0]
 
-
-# Return the longest prefix of all list elements.
-
-def commonprefix(m):
-    "Given a list of pathnames, returns the longest common leading component"
-    if not m: return ''
-    s1 = min(m)
-    s2 = max(m)
-    n = min(len(s1), len(s2))
-    for i in xrange(n):
-        if s1[i] != s2[i]:
-            return s1[:i]
-    return s1[:n]
-
-
-# Get size, mtime, atime of files.
-
-def getsize(filename):
-    """Return the size of a file, reported by os.stat()"""
-    return os.stat(filename).st_size
-
-def getmtime(filename):
-    """Return the last modification time of a file, reported by os.stat()"""
-    return os.stat(filename).st_mtime
-
-def getatime(filename):
-    """Return the last access time of a file, reported by os.stat()"""
-    return os.stat(filename).st_atime
-
-def getctime(filename):
-    """Return the creation time of a file, reported by os.stat()."""
-    return os.stat(filename).st_ctime
-
 # Is a path a symbolic link?
 # This will always return false on systems where posix.lstat doesn't exist.
 
 def islink(path):
-    """Test for symbolic link.  On WindowsNT/95 always returns false"""
+    """Test for symbolic link.
+    On WindowsNT/95 and OS/2 always returns false
+    """
     return False
 
-
-# Does a path exist?
-
-def exists(path):
-    """Test whether a path exists"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return True
-
+# alias exists to lexists
 lexists = exists
 
-
-# Is a path a dos directory?
-# This follows symbolic links, so both islink() and isdir() can be true
-# for the same path.
-
-def isdir(path):
-    """Test whether a path is a directory"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return stat.S_ISDIR(st.st_mode)
-
-
-# Is a path a regular file?
-# This follows symbolic links, so both islink() and isdir() can be true
-# for the same path.
-
-def isfile(path):
-    """Test whether a path is a regular file"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return stat.S_ISREG(st.st_mode)
-
-
 # Is a path a mount point?  Either a root (with or without drive letter)
 # or an UNC path with at most a / or \ after the mount point.
 

Modified: python/branches/p3yk-noslice/Lib/opcode.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/opcode.py	(original)
+++ python/branches/p3yk-noslice/Lib/opcode.py	Fri Dec 15 05:21:50 2006
@@ -54,7 +54,6 @@
 def_op('UNARY_POSITIVE', 10)
 def_op('UNARY_NEGATIVE', 11)
 def_op('UNARY_NOT', 12)
-def_op('UNARY_CONVERT', 13)
 
 def_op('UNARY_INVERT', 15)
 
@@ -101,7 +100,6 @@
 def_op('LOAD_LOCALS', 82)
 def_op('RETURN_VALUE', 83)
 def_op('IMPORT_STAR', 84)
-def_op('EXEC_STMT', 85)
 def_op('YIELD_VALUE', 86)
 def_op('POP_BLOCK', 87)
 def_op('END_FINALLY', 88)
@@ -124,12 +122,13 @@
 name_op('LOAD_NAME', 101)       # Index in name list
 def_op('BUILD_TUPLE', 102)      # Number of tuple items
 def_op('BUILD_LIST', 103)       # Number of list items
-def_op('BUILD_MAP', 104)        # Always zero for now
-name_op('LOAD_ATTR', 105)       # Index in name list
-def_op('COMPARE_OP', 106)       # Comparison operator
-hascompare.append(106)
-name_op('IMPORT_NAME', 107)     # Index in name list
-name_op('IMPORT_FROM', 108)     # Index in name list
+def_op('BUILD_SET', 104)        # Number of set items
+def_op('BUILD_MAP', 105)        # Always zero for now
+name_op('LOAD_ATTR', 106)       # Index in name list
+def_op('COMPARE_OP', 107)       # Comparison operator
+hascompare.append(107)
+name_op('IMPORT_NAME', 108)     # Index in name list
+name_op('IMPORT_FROM', 109)     # Index in name list
 
 jrel_op('JUMP_FORWARD', 110)    # Number of bytes to skip
 jrel_op('JUMP_IF_FALSE', 111)   # ""

Modified: python/branches/p3yk-noslice/Lib/optparse.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/optparse.py	(original)
+++ python/branches/p3yk-noslice/Lib/optparse.py	Fri Dec 15 05:21:50 2006
@@ -838,13 +838,13 @@
 
     __repr__ = _repr
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if isinstance(other, Values):
-            return cmp(self.__dict__, other.__dict__)
+            return self.__dict__ == other.__dict__
         elif isinstance(other, types.DictType):
-            return cmp(self.__dict__, other)
+            return self.__dict__ == other
         else:
-            return -1
+            return NotImplemented
 
     def _update_careful(self, dict):
         """

Modified: python/branches/p3yk-noslice/Lib/os.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/os.py	(original)
+++ python/branches/p3yk-noslice/Lib/os.py	Fri Dec 15 05:21:50 2006
@@ -156,11 +156,17 @@
     recursive.
 
     """
+    from errno import EEXIST
     head, tail = path.split(name)
     if not tail:
         head, tail = path.split(head)
     if head and tail and not path.exists(head):
-        makedirs(head, mode)
+        try:
+            makedirs(head, mode)
+        except OSError, e:
+            # be happy if someone already created the path
+            if e.errno != EEXIST:
+                raise
         if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
             return
     mkdir(name, mode)

Modified: python/branches/p3yk-noslice/Lib/os2emxpath.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/os2emxpath.py	(original)
+++ python/branches/p3yk-noslice/Lib/os2emxpath.py	Fri Dec 15 05:21:50 2006
@@ -7,6 +7,9 @@
 
 import os
 import stat
+from genericpath import *
+from ntpath import (expanduser, expandvars, isabs, islink, splitdrive,
+                    splitext, split, walk)
 
 __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
            "basename","dirname","commonprefix","getsize","getmtime",
@@ -36,18 +39,6 @@
     return s.replace('\\', '/').lower()
 
 
-# Return whether a path is absolute.
-# Trivial in Posix, harder on the Mac or MS-DOS.
-# For DOS it is absolute if it starts with a slash or backslash (current
-# volume), or if a pathname after the volume letter and colon / UNC resource
-# starts with a slash or backslash.
-
-def isabs(s):
-    """Test whether a path is absolute"""
-    s = splitdrive(s)[1]
-    return s != '' and s[:1] in '/\\'
-
-
 # Join two (or more) paths.
 
 def join(a, *p):
@@ -63,17 +54,6 @@
     return path
 
 
-# Split a path in a drive specification (a drive letter followed by a
-# colon) and the path specification.
-# It is always true that drivespec + pathspec == p
-def splitdrive(p):
-    """Split a pathname into drive and path specifiers. Returns a 2-tuple
-"(drive,path)";  either part may be empty"""
-    if p[1:2] == ':':
-        return p[0:2], p[2:]
-    return '', p
-
-
 # Parse UNC paths
 def splitunc(p):
     """Split a pathname into UNC mount point and relative path specifiers.
@@ -103,57 +83,6 @@
     return '', p
 
 
-# Split a path in head (everything up to the last '/') and tail (the
-# rest).  After the trailing '/' is stripped, the invariant
-# join(head, tail) == p holds.
-# The resulting head won't end in '/' unless it is the root.
-
-def split(p):
-    """Split a pathname.
-
-    Return tuple (head, tail) where tail is everything after the final slash.
-    Either part may be empty."""
-
-    d, p = splitdrive(p)
-    # set i to index beyond p's last slash
-    i = len(p)
-    while i and p[i-1] not in '/\\':
-        i = i - 1
-    head, tail = p[:i], p[i:]  # now tail has no slashes
-    # remove trailing slashes from head, unless it's all slashes
-    head2 = head
-    while head2 and head2[-1] in '/\\':
-        head2 = head2[:-1]
-    head = head2 or head
-    return d + head, tail
-
-
-# Split a path in root and extension.
-# The extension is everything starting at the last dot in the last
-# pathname component; the root is everything before that.
-# It is always true that root + ext == p.
-
-def splitext(p):
-    """Split the extension from a pathname.
-
-    Extension is everything from the last dot to the end.
-    Return (root, ext), either part may be empty."""
-    root, ext = '', ''
-    for c in p:
-        if c in ['/','\\']:
-            root, ext = root + ext + c, ''
-        elif c == '.':
-            if ext:
-                root, ext = root + ext, c
-            else:
-                ext = c
-        elif ext:
-            ext = ext + c
-        else:
-            root = root + c
-    return root, ext
-
-
 # Return the tail (basename) part of a path.
 
 def basename(p):
@@ -168,84 +97,12 @@
     return split(p)[0]
 
 
-# Return the longest prefix of all list elements.
-
-def commonprefix(m):
-    "Given a list of pathnames, returns the longest common leading component"
-    if not m: return ''
-    s1 = min(m)
-    s2 = max(m)
-    n = min(len(s1), len(s2))
-    for i in xrange(n):
-        if s1[i] != s2[i]:
-            return s1[:i]
-    return s1[:n]
-
-
-# Get size, mtime, atime of files.
-
-def getsize(filename):
-    """Return the size of a file, reported by os.stat()"""
-    return os.stat(filename).st_size
-
-def getmtime(filename):
-    """Return the last modification time of a file, reported by os.stat()"""
-    return os.stat(filename).st_mtime
-
-def getatime(filename):
-    """Return the last access time of a file, reported by os.stat()"""
-    return os.stat(filename).st_atime
-
-def getctime(filename):
-    """Return the creation time of a file, reported by os.stat()."""
-    return os.stat(filename).st_ctime
-
-# Is a path a symbolic link?
-# This will always return false on systems where posix.lstat doesn't exist.
-
-def islink(path):
-    """Test for symbolic link.  On OS/2 always returns false"""
-    return False
-
-
-# Does a path exist?
-# This is false for dangling symbolic links.
-
-def exists(path):
-    """Test whether a path exists"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return True
-
+# alias exists to lexists
 lexists = exists
 
 
 # Is a path a directory?
 
-def isdir(path):
-    """Test whether a path is a directory"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return stat.S_ISDIR(st.st_mode)
-
-
-# Is a path a regular file?
-# This follows symbolic links, so both islink() and isdir() can be true
-# for the same path.
-
-def isfile(path):
-    """Test whether a path is a regular file"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return stat.S_ISREG(st.st_mode)
-
-
 # Is a path a mount point?  Either a root (with or without drive letter)
 # or an UNC path with at most a / or \ after the mount point.
 
@@ -258,131 +115,6 @@
     return len(p) == 1 and p[0] in '/\\'
 
 
-# Directory tree walk.
-# For each directory under top (including top itself, but excluding
-# '.' and '..'), func(arg, dirname, filenames) is called, where
-# dirname is the name of the directory and filenames is the list
-# of files (and subdirectories etc.) in the directory.
-# The func may modify the filenames list, to implement a filter,
-# or to impose a different order of visiting.
-
-def walk(top, func, arg):
-    """Directory tree walk whth callback function.
-
-    walk(top, func, arg) calls func(arg, d, files) for each directory d
-    in the tree rooted at top (including top itself); files is a list
-    of all the files and subdirs in directory d."""
-    try:
-        names = os.listdir(top)
-    except os.error:
-        return
-    func(arg, top, names)
-    exceptions = ('.', '..')
-    for name in names:
-        if name not in exceptions:
-            name = join(top, name)
-            if isdir(name):
-                walk(name, func, arg)
-
-
-# Expand paths beginning with '~' or '~user'.
-# '~' means $HOME; '~user' means that user's home directory.
-# If the path doesn't begin with '~', or if the user or $HOME is unknown,
-# the path is returned unchanged (leaving error reporting to whatever
-# function is called with the expanded path as argument).
-# See also module 'glob' for expansion of *, ? and [...] in pathnames.
-# (A function should also be defined to do full *sh-style environment
-# variable expansion.)
-
-def expanduser(path):
-    """Expand ~ and ~user constructs.
-
-    If user or $HOME is unknown, do nothing."""
-    if path[:1] != '~':
-        return path
-    i, n = 1, len(path)
-    while i < n and path[i] not in '/\\':
-        i = i + 1
-    if i == 1:
-        if 'HOME' in os.environ:
-            userhome = os.environ['HOME']
-        elif not 'HOMEPATH' in os.environ:
-            return path
-        else:
-            try:
-                drive = os.environ['HOMEDRIVE']
-            except KeyError:
-                drive = ''
-            userhome = join(drive, os.environ['HOMEPATH'])
-    else:
-        return path
-    return userhome + path[i:]
-
-
-# Expand paths containing shell variable substitutions.
-# The following rules apply:
-#       - no expansion within single quotes
-#       - no escape character, except for '$$' which is translated into '$'
-#       - ${varname} is accepted.
-#       - varnames can be made out of letters, digits and the character '_'
-# XXX With COMMAND.COM you can use any characters in a variable name,
-# XXX except '^|<>='.
-
-def expandvars(path):
-    """Expand shell variables of form $var and ${var}.
-
-    Unknown variables are left unchanged."""
-    if '$' not in path:
-        return path
-    import string
-    varchars = string.letters + string.digits + '_-'
-    res = ''
-    index = 0
-    pathlen = len(path)
-    while index < pathlen:
-        c = path[index]
-        if c == '\'':   # no expansion within single quotes
-            path = path[index + 1:]
-            pathlen = len(path)
-            try:
-                index = path.index('\'')
-                res = res + '\'' + path[:index + 1]
-            except ValueError:
-                res = res + path
-                index = pathlen - 1
-        elif c == '$':  # variable or '$$'
-            if path[index + 1:index + 2] == '$':
-                res = res + c
-                index = index + 1
-            elif path[index + 1:index + 2] == '{':
-                path = path[index+2:]
-                pathlen = len(path)
-                try:
-                    index = path.index('}')
-                    var = path[:index]
-                    if var in os.environ:
-                        res = res + os.environ[var]
-                except ValueError:
-                    res = res + path
-                    index = pathlen - 1
-            else:
-                var = ''
-                index = index + 1
-                c = path[index:index + 1]
-                while c != '' and c in varchars:
-                    var = var + c
-                    index = index + 1
-                    c = path[index:index + 1]
-                if var in os.environ:
-                    res = res + os.environ[var]
-                if c != '':
-                    res = res + c
-        else:
-            res = res + c
-        index = index + 1
-    return res
-
-
 # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
 
 def normpath(path):

Modified: python/branches/p3yk-noslice/Lib/pdb.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pdb.py	(original)
+++ python/branches/p3yk-noslice/Lib/pdb.py	Fri Dec 15 05:21:50 2006
@@ -28,7 +28,7 @@
     return sys.stdin.readline()
 
 def find_function(funcname, filename):
-    cre = re.compile(r'def\s+%s\s*[(]' % funcname)
+    cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
     try:
         fp = open(filename)
     except IOError:
@@ -198,7 +198,7 @@
         globals = self.curframe.f_globals
         try:
             code = compile(line + '\n', '<stdin>', 'single')
-            exec code in globals, locals
+            exec(code, globals, locals)
         except:
             t, v = sys.exc_info()[:2]
             if type(t) == type(''):

Modified: python/branches/p3yk-noslice/Lib/plat-irix5/flp.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-irix5/flp.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-irix5/flp.py	Fri Dec 15 05:21:50 2006
@@ -329,7 +329,7 @@
 #
 def create_full_form(inst, (fdata, odatalist)):
     form = create_form(fdata)
-    exec 'inst.'+fdata.Name+' = form\n'
+    exec('inst.'+fdata.Name+' = form\n')
     for odata in odatalist:
         create_object_instance(inst, form, odata)
 
@@ -338,7 +338,7 @@
 # variable.
 #
 def merge_full_form(inst, form, (fdata, odatalist)):
-    exec 'inst.'+fdata.Name+' = form\n'
+    exec('inst.'+fdata.Name+' = form\n')
     if odatalist[0].Class != FL.BOX:
         raise error, 'merge_full_form() expects FL.BOX as first obj'
     for odata in odatalist[1:]:
@@ -374,7 +374,7 @@
         cbfunc = eval('inst.'+odata.Callback)
         obj.set_call_back(cbfunc, odata.Argument)
     if odata.Name:
-        exec 'inst.' + odata.Name + ' = obj\n'
+        exec('inst.' + odata.Name + ' = obj\n')
 #
 # Internal _create_object: Create the object and fill options
 #

Modified: python/branches/p3yk-noslice/Lib/plat-irix5/panel.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-irix5/panel.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-irix5/panel.py	Fri Dec 15 05:21:50 2006
@@ -130,7 +130,7 @@
                 stmt = lhs + '=' + repr(value)
                 if debug: print 'exec', stmt
                 try:
-                    exec stmt + '\n'
+                    exec(stmt + '\n')
                 except KeyboardInterrupt: # Don't catch this!
                     raise KeyboardInterrupt
                 except:
@@ -186,7 +186,7 @@
         if name:
             stmt = 'panel.' + name + ' = act'
             if debug: print 'exec', stmt
-            exec stmt + '\n'
+            exec(stmt + '\n')
         if is_endgroup(a):
             panel.endgroup()
         sub_al = getattrlist(a, 'al')
@@ -236,7 +236,7 @@
         act.addact(panel)
         if name:
             stmt = 'panel.' + name + ' = act'
-            exec stmt + '\n'
+            exec(stmt + '\n')
         if is_endgroup(a):
             panel.endgroup()
         sub_al = getattrlist(a, 'al')

Modified: python/branches/p3yk-noslice/Lib/plat-irix6/flp.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-irix6/flp.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-irix6/flp.py	Fri Dec 15 05:21:50 2006
@@ -328,7 +328,7 @@
 #
 def create_full_form(inst, (fdata, odatalist)):
     form = create_form(fdata)
-    exec 'inst.'+fdata.Name+' = form\n'
+    exec('inst.'+fdata.Name+' = form\n')
     for odata in odatalist:
         create_object_instance(inst, form, odata)
 
@@ -337,7 +337,7 @@
 # variable.
 #
 def merge_full_form(inst, form, (fdata, odatalist)):
-    exec 'inst.'+fdata.Name+' = form\n'
+    exec('inst.'+fdata.Name+' = form\n')
     if odatalist[0].Class != FL.BOX:
         raise error, 'merge_full_form() expects FL.BOX as first obj'
     for odata in odatalist[1:]:
@@ -373,7 +373,7 @@
         cbfunc = eval('inst.'+odata.Callback)
         obj.set_call_back(cbfunc, odata.Argument)
     if odata.Name:
-        exec 'inst.' + odata.Name + ' = obj\n'
+        exec('inst.' + odata.Name + ' = obj\n')
 #
 # Internal _create_object: Create the object and fill options
 #

Modified: python/branches/p3yk-noslice/Lib/plat-irix6/panel.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-irix6/panel.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-irix6/panel.py	Fri Dec 15 05:21:50 2006
@@ -130,7 +130,7 @@
                 stmt = lhs + '=' + repr(value)
                 if debug: print 'exec', stmt
                 try:
-                    exec stmt + '\n'
+                    exec(stmt + '\n')
                 except KeyboardInterrupt: # Don't catch this!
                     raise KeyboardInterrupt
                 except:
@@ -186,7 +186,7 @@
         if name:
             stmt = 'panel.' + name + ' = act'
             if debug: print 'exec', stmt
-            exec stmt + '\n'
+            exec(stmt + '\n')
         if is_endgroup(a):
             panel.endgroup()
         sub_al = getattrlist(a, 'al')
@@ -236,7 +236,7 @@
         act.addact(panel)
         if name:
             stmt = 'panel.' + name + ' = act'
-            exec stmt + '\n'
+            exec(stmt + '\n')
         if is_endgroup(a):
             panel.endgroup()
         sub_al = getattrlist(a, 'al')

Modified: python/branches/p3yk-noslice/Lib/plat-mac/FrameWork.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/FrameWork.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/FrameWork.py	Fri Dec 15 05:21:50 2006
@@ -602,7 +602,7 @@
     def dispatch(self, id, item, window, event):
         title, shortcut, callback, mtype = self.items[item-1]
         if callback:
-            if not self.bar.parent or type(callback) <> types.StringType:
+            if not self.bar.parent or not isinstance(callback, str):
                 menuhandler = callback
             else:
                 # callback is string
@@ -748,7 +748,7 @@
         self.parent = parent
 
     def open(self, bounds=(40, 40, 400, 400), resid=None):
-        if resid <> None:
+        if resid is not None:
             self.wid = GetNewWindow(resid, -1)
         else:
             self.wid = NewWindow(bounds, self.__class__.__name__, 1,
@@ -826,7 +826,7 @@
         # If we're not frontmost, select ourselves and wait for
         # the activate event.
         #
-        if MyFrontWindow() <> window:
+        if MyFrontWindow() != window:
             window.SelectWindow()
             return
         # We are. Handle the event.
@@ -875,7 +875,7 @@
         if DEBUG: print "control hit in", window, "on", control, "; pcode =", pcode
 
     def do_inContent(self, partcode, window, event):
-        if MyFrontWindow() <> window:
+        if MyFrontWindow() != window:
             window.SelectWindow()
             return
         (what, message, when, where, modifiers) = event

Modified: python/branches/p3yk-noslice/Lib/plat-mac/aetypes.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/aetypes.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/aetypes.py	Fri Dec 15 05:21:50 2006
@@ -128,7 +128,7 @@
         self.keyword = "%-4.4s" % str(keyword)
 
     def __repr__(self):
-        return "Keyword(%r)" % `self.keyword`
+        return "Keyword(%r)" % self.keyword
 
     def __str__(self):
         return string.strip(self.keyword)
@@ -557,12 +557,12 @@
 class %s(ComponentItem): want = '%s'
 """
 
-exec template % ("Text", 'text')
-exec template % ("Character", 'cha ')
-exec template % ("Word", 'cwor')
-exec template % ("Line", 'clin')
-exec template % ("paragraph", 'cpar')
-exec template % ("Window", 'cwin')
-exec template % ("Document", 'docu')
-exec template % ("File", 'file')
-exec template % ("InsertionPoint", 'cins')
+exec(template % ("Text", 'text'))
+exec(template % ("Character", 'cha '))
+exec(template % ("Word", 'cwor'))
+exec(template % ("Line", 'clin'))
+exec(template % ("paragraph", 'cpar'))
+exec(template % ("Window", 'cwin'))
+exec(template % ("Document", 'docu'))
+exec(template % ("File", 'file'))
+exec(template % ("InsertionPoint", 'cins'))

Modified: python/branches/p3yk-noslice/Lib/plat-mac/appletrawmain.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/appletrawmain.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/appletrawmain.py	Fri Dec 15 05:21:50 2006
@@ -57,7 +57,7 @@
         # funny) and go.
         #
         del argvemulator, os, sys, marshal, _dir, _fp
-        exec __code__
+        exec(__code__)
     else:
         sys.stderr.write("%s: neither __main__.py nor __main__.pyc found\n"%sys.argv[0])
         sys.exit(1)

Modified: python/branches/p3yk-noslice/Lib/plat-mac/buildtools.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/buildtools.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/buildtools.py	Fri Dec 15 05:21:50 2006
@@ -192,7 +192,7 @@
             'icl8', 'ics4', 'ics8', 'ICN#', 'ics#']
     if not copy_codefragment:
         skiptypes.append('cfrg')
-##  skipowner = (ownertype <> None)
+##  skipowner = (ownertype != None)
 
     # Copy the resources from the template
 

Modified: python/branches/p3yk-noslice/Lib/plat-mac/cfmfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/cfmfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/cfmfile.py	Fri Dec 15 05:21:50 2006
@@ -73,7 +73,7 @@
                 Res.CloseResFile(resref)
                 Res.UseResFile(currentresref)
             self.parse(data)
-            if self.version <> 1:
+            if self.version != 1:
                 raise error, "unknown 'cfrg' resource format"
 
     def parse(self, data):
@@ -143,7 +143,7 @@
         return data
 
     def getfragment(self):
-        if self.where <> 1:
+        if self.where != 1:
             raise error, "can't read fragment, unsupported location"
         f = open(self.path, "rb")
         f.seek(self.offset)
@@ -155,7 +155,7 @@
         return frag
 
     def copydata(self, outfile):
-        if self.where <> 1:
+        if self.where != 1:
             raise error, "can't read fragment, unsupported location"
         infile = open(self.path, "rb")
         if self.length == 0:

Modified: python/branches/p3yk-noslice/Lib/plat-mac/gensuitemodule.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/gensuitemodule.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/gensuitemodule.py	Fri Dec 15 05:21:50 2006
@@ -169,7 +169,7 @@
             aete = decode(data, verbose)
             aetelist.append((aete, res.GetResInfo()))
     finally:
-        if rf <> cur:
+        if rf != cur:
             CloseResFile(rf)
             UseResFile(cur)
     # switch back (needed for dialogs in Python)
@@ -332,7 +332,7 @@
 def getalign(f):
     if f.tell() & 1:
         c = f.read(1)
-        ##if c <> '\0':
+        ##if c != '\0':
         ##  print align:', repr(c)
 
 def getlist(f, description, getitem):
@@ -779,7 +779,7 @@
             if is_enum(a[2]):
                 kname = a[1]
                 ename = a[2][0]
-                if ename <> '****':
+                if ename != '****':
                     fp.write("        aetools.enumsubst(_arguments, %r, _Enum_%s)\n" %
                         (kname, identify(ename)))
                     self.enumsneeded[ename] = 1
@@ -810,7 +810,7 @@
         for a in arguments:
             if is_enum(a[2]):
                 ename = a[2][0]
-                if ename <> '****':
+                if ename != '****':
                     self.enumsneeded[ename] = 1
 
 #

Modified: python/branches/p3yk-noslice/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py	Fri Dec 15 05:21:50 2006
@@ -301,7 +301,7 @@
             return _arguments['----']
 
     def as_(self, _object, _attributes={}, **_arguments):
-        """as_: Coercion
+        """as: Coercion
         Required argument: an AE object reference
         Keyword argument _attributes: AppleEvent attribute dictionary
         Returns: anything

Modified: python/branches/p3yk-noslice/Lib/plat-mac/macerrors.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/macerrors.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/macerrors.py	Fri Dec 15 05:21:50 2006
@@ -1574,7 +1574,7 @@
 smFHBlockRdErr  =   -310    #Error occurred during _sGetFHeader.
 smBLFieldBad    =   -309    #ByteLanes field was bad.
 smUnExBusErr    =   -308    #Unexpected BusError
-smResrvErr  =   -307    #Fatal reserved error. Resreved field <> 0.
+smResrvErr  =   -307    #Fatal reserved error. Resreved field != 0.
 smNosInfoArray  =   -306    #No sInfoArray. Memory Mgr error.
 smDisabledSlot  =   -305    #This slot is disabled (-305 use to be smLWTstBad)
 smNoDir =   -304    #Directory offset is Nil

Modified: python/branches/p3yk-noslice/Lib/plat-mac/pimp.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/pimp.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/pimp.py	Fri Dec 15 05:21:50 2006
@@ -588,7 +588,7 @@
             }
         installTest = self._dict['Install-test'].strip() + '\n'
         try:
-            exec installTest in namespace
+            exec(installTest, namespace)
         except ImportError, arg:
             return "no", str(arg)
         except _scriptExc_NotInstalled, arg:
@@ -757,7 +757,7 @@
                 if line[0] == '#':
                     continue
                 if line[:6] == 'import':
-                    exec line
+                    exec(line)
                     continue
                 if line[-1] == '\n':
                     line = line[:-1]

Modified: python/branches/p3yk-noslice/Lib/plat-mac/plistlib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-mac/plistlib.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-mac/plistlib.py	Fri Dec 15 05:21:50 2006
@@ -374,13 +374,13 @@
     def asBase64(self, maxlinelength=76):
         return _encodeBase64(self.data, maxlinelength)
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if isinstance(other, self.__class__):
-            return cmp(self.data, other.data)
+            return self.data == other.data
         elif isinstance(other, str):
-            return cmp(self.data, other)
+            return self.data == other
         else:
-            return cmp(id(self), id(other))
+            return id(self) == id(other)
 
     def __repr__(self):
         return "%s(%s)" % (self.__class__.__name__, repr(self.data))

Modified: python/branches/p3yk-noslice/Lib/plat-riscos/riscosenviron.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-riscos/riscosenviron.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-riscos/riscosenviron.py	Fri Dec 15 05:21:50 2006
@@ -13,7 +13,7 @@
         return len(riscos.getenvdict())
     def __getitem__(self, key):
         ret = riscos.getenv(key)
-        if ret<>None:
+        if ret != None:
             return ret
         else:
             raise KeyError
@@ -31,7 +31,7 @@
     def values(self): return riscos.getenvdict().values()
     def has_key(self, key):
         value = riscos.getenv(key)
-        return value<>None
+        return value != None
     def __contains__(self, key):
         return riscos.getenv(key) is not None
     def update(self, dict):
@@ -39,7 +39,7 @@
             riscos.putenv(k, v)
     def get(self, key, failobj=None):
         value = riscos.getenv(key)
-        if value<>None:
+        if value != None:
             return value
         else:
             return failobj

Modified: python/branches/p3yk-noslice/Lib/plat-riscos/rourl2path.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-riscos/rourl2path.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-riscos/rourl2path.py	Fri Dec 15 05:21:50 2006
@@ -14,7 +14,7 @@
     """OS-specific conversion from a relative URL of the 'file' scheme
     to a file system path; not recommended for general use."""
     tp = urllib.splittype(url)[0]
-    if tp and tp <> 'file':
+    if tp and tp != 'file':
         raise RuntimeError, 'Cannot convert non-local URL to pathname'
     # Turn starting /// into /, an empty hostname means current host
     if url[:3] == '///':
@@ -39,7 +39,7 @@
         elif components[i] == '..':
             components[i] = '^'
             i += 1
-        elif components[i] == '' and i > 0 and components[i-1] <> '':
+        elif components[i] == '' and i > 0 and components[i-1] != '':
             del components[i]
         else:
             i += 1

Modified: python/branches/p3yk-noslice/Lib/plat-sunos5/STROPTS.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/plat-sunos5/STROPTS.py	(original)
+++ python/branches/p3yk-noslice/Lib/plat-sunos5/STROPTS.py	Fri Dec 15 05:21:50 2006
@@ -1550,7 +1550,7 @@
 AS_PAGLCK = 0x80
 AS_CLAIMGAP = 0x40
 AS_UNMAPWAIT = 0x20
-def AS_TYPE_64BIT(as): return \
+def AS_TYPE_64BIT(as_): return \
 
 AS_LREP_LINKEDLIST = 0
 AS_LREP_SKIPLIST = 1

Modified: python/branches/p3yk-noslice/Lib/posixpath.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/posixpath.py	(original)
+++ python/branches/p3yk-noslice/Lib/posixpath.py	Fri Dec 15 05:21:50 2006
@@ -12,6 +12,7 @@
 
 import os
 import stat
+from genericpath import *
 
 __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
            "basename","dirname","commonprefix","getsize","getmtime",
@@ -105,50 +106,24 @@
     return '', p
 
 
-# Return the tail (basename) part of a path.
+# Return the tail (basename) part of a path, same as split(path)[1].
 
 def basename(p):
     """Returns the final component of a pathname"""
-    return split(p)[1]
+    i = p.rfind('/') + 1
+    return p[i:]
 
 
-# Return the head (dirname) part of a path.
+# Return the head (dirname) part of a path, same as split(path)[0].
 
 def dirname(p):
     """Returns the directory component of a pathname"""
-    return split(p)[0]
-
-
-# Return the longest prefix of all list elements.
+    i = p.rfind('/') + 1
+    head = p[:i]
+    if head and head != '/'*len(head):
+        head = head.rstrip('/')
+    return head
 
-def commonprefix(m):
-    "Given a list of pathnames, returns the longest common leading component"
-    if not m: return ''
-    s1 = min(m)
-    s2 = max(m)
-    n = min(len(s1), len(s2))
-    for i in xrange(n):
-        if s1[i] != s2[i]:
-            return s1[:i]
-    return s1[:n]
-
-# Get size, mtime, atime of files.
-
-def getsize(filename):
-    """Return the size of a file, reported by os.stat()."""
-    return os.stat(filename).st_size
-
-def getmtime(filename):
-    """Return the last modification time of a file, reported by os.stat()."""
-    return os.stat(filename).st_mtime
-
-def getatime(filename):
-    """Return the last access time of a file, reported by os.stat()."""
-    return os.stat(filename).st_atime
-
-def getctime(filename):
-    """Return the metadata change time of a file, reported by os.stat()."""
-    return os.stat(filename).st_ctime
 
 # Is a path a symbolic link?
 # This will always return false on systems where os.lstat doesn't exist.
@@ -161,19 +136,6 @@
         return False
     return stat.S_ISLNK(st.st_mode)
 
-
-# Does a path exist?
-# This is false for dangling symbolic links.
-
-def exists(path):
-    """Test whether a path exists.  Returns False for broken symbolic links"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return True
-
-
 # Being true for dangling symbolic links is also useful.
 
 def lexists(path):
@@ -185,32 +147,6 @@
     return True
 
 
-# Is a path a directory?
-# This follows symbolic links, so both islink() and isdir() can be true
-# for the same path.
-
-def isdir(path):
-    """Test whether a path is a directory"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return stat.S_ISDIR(st.st_mode)
-
-
-# Is a path a regular file?
-# This follows symbolic links, so both islink() and isfile() can be true
-# for the same path.
-
-def isfile(path):
-    """Test whether a path is a regular file"""
-    try:
-        st = os.stat(path)
-    except os.error:
-        return False
-    return stat.S_ISREG(st.st_mode)
-
-
 # Are two filenames really pointing to the same file?
 
 def samefile(f1, f2):
@@ -328,8 +264,7 @@
         except KeyError:
             return path
         userhome = pwent.pw_dir
-    if userhome.endswith('/'):
-        i += 1
+    userhome = userhome.rstrip('/')
     return userhome + path[i:]
 
 

Modified: python/branches/p3yk-noslice/Lib/pprint.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pprint.py	(original)
+++ python/branches/p3yk-noslice/Lib/pprint.py	Fri Dec 15 05:21:50 2006
@@ -246,7 +246,12 @@
         append = components.append
         level += 1
         saferepr = _safe_repr
-        for k, v in sorted(object.items()):
+        items = object.items()
+        try:
+            items = sorted(items)
+        except TypeError:
+            items = sorted(items, key=lambda (k, v): (str(type(k)), k, v))
+        for k, v in items:
             krepr, kreadable, krecur = saferepr(k, context, maxlevels, level)
             vrepr, vreadable, vrecur = saferepr(v, context, maxlevels, level)
             append("%s: %s" % (krepr, vrepr))

Modified: python/branches/p3yk-noslice/Lib/profile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/profile.py	(original)
+++ python/branches/p3yk-noslice/Lib/profile.py	Fri Dec 15 05:21:50 2006
@@ -459,7 +459,7 @@
         self.set_cmd(cmd)
         sys.setprofile(self.dispatcher)
         try:
-            exec cmd in globals, locals
+            exec(cmd, globals, locals)
         finally:
             sys.setprofile(None)
         return self

Modified: python/branches/p3yk-noslice/Lib/pstats.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pstats.py	(original)
+++ python/branches/p3yk-noslice/Lib/pstats.py	Fri Dec 15 05:21:50 2006
@@ -116,7 +116,7 @@
 
     def load_stats(self, arg):
         if not arg:  self.stats = {}
-        elif type(arg) == type(""):
+        elif isinstance(arg, basestring):
             f = open(arg, 'rb')
             self.stats = marshal.load(f)
             f.close()
@@ -173,7 +173,7 @@
 
     def dump_stats(self, filename):
         """Write the profile data to a file we know how to load back."""
-        f = file(filename, 'wb')
+        f = open(filename, 'wb')
         try:
             marshal.dump(self.stats, f)
         finally:

Modified: python/branches/p3yk-noslice/Lib/pty.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pty.py	(original)
+++ python/branches/p3yk-noslice/Lib/pty.py	Fri Dec 15 05:21:50 2006
@@ -118,6 +118,10 @@
         if (slave_fd > STDERR_FILENO):
             os.close (slave_fd)
 
+        # Explicitly open the tty to make it become a controlling tty.
+        tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
+        os.close(tmp_fd)
+
     # Parent and child process.
     return pid, master_fd
 

Modified: python/branches/p3yk-noslice/Lib/pyclbr.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pyclbr.py	(original)
+++ python/branches/p3yk-noslice/Lib/pyclbr.py	Fri Dec 15 05:21:50 2006
@@ -172,7 +172,7 @@
                     # else it's a nested def
                 else:
                     # it's a function
-                    dict[meth_name] = Function(module, meth_name, file, lineno)
+                    dict[meth_name] = Function(fullmodule, meth_name, file, lineno)
                 stack.append((None, thisindent)) # Marker for nested fns
             elif token == 'class':
                 lineno, thisindent = start

Modified: python/branches/p3yk-noslice/Lib/pydoc.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pydoc.py	(original)
+++ python/branches/p3yk-noslice/Lib/pydoc.py	Fri Dec 15 05:21:50 2006
@@ -1564,7 +1564,7 @@
         'CLASSES': ('ref/types', 'class SPECIALMETHODS PRIVATENAMES'),
         'MODULES': ('lib/typesmodules', 'import'),
         'PACKAGES': 'import',
-        'EXPRESSIONS': ('ref/summary', 'lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES BACKQUOTES'),
+        'EXPRESSIONS': ('ref/summary', 'lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES'),
         'OPERATORS': 'EXPRESSIONS',
         'PRECEDENCE': 'EXPRESSIONS',
         'OBJECTS': ('ref/objects', 'TYPES'),
@@ -1587,14 +1587,13 @@
         'IDENTIFIERS': ('ref/identifiers', 'keywords SPECIALIDENTIFIERS'),
         'SPECIALIDENTIFIERS': ('ref/id-classes', ''),
         'PRIVATENAMES': ('ref/atom-identifiers', ''),
-        'LITERALS': ('ref/atom-literals', 'STRINGS BACKQUOTES NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS'),
+        'LITERALS': ('ref/atom-literals', 'STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS'),
         'TUPLES': 'SEQUENCES',
         'TUPLELITERALS': ('ref/exprlists', 'TUPLES LITERALS'),
         'LISTS': ('lib/typesseq-mutable', 'LISTLITERALS'),
         'LISTLITERALS': ('ref/lists', 'LISTS LITERALS'),
         'DICTIONARIES': ('lib/typesmapping', 'DICTIONARYLITERALS'),
         'DICTIONARYLITERALS': ('ref/dict', 'DICTIONARIES LITERALS'),
-        'BACKQUOTES': ('ref/string-conversions', 'repr str STRINGS LITERALS'),
         'ATTRIBUTES': ('ref/attribute-references', 'getattr hasattr setattr ATTRIBUTEMETHODS'),
         'SUBSCRIPTS': ('ref/subscriptions', 'SEQUENCEMETHODS1'),
         'SLICINGS': ('ref/slicings', 'SEQUENCEMETHODS2'),

Modified: python/branches/p3yk-noslice/Lib/rexec.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/rexec.py	(original)
+++ python/branches/p3yk-noslice/Lib/rexec.py	Fri Dec 15 05:21:50 2006
@@ -58,7 +58,7 @@
         self.name = name
 
     for m in FileBase.ok_file_methods + ('close',):
-        exec TEMPLATE % (m, m)
+        exec(TEMPLATE % (m, m))
 
 
 class RHooks(ihooks.Hooks):
@@ -310,7 +310,7 @@
 
         """
         m = self.add_module('__main__')
-        exec code in m.__dict__
+        exec(code, m.__dict__)
 
     def r_eval(self, code):
         """Evaluate code within a restricted environment.

Modified: python/branches/p3yk-noslice/Lib/runpy.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/runpy.py	(original)
+++ python/branches/p3yk-noslice/Lib/runpy.py	Fri Dec 15 05:21:50 2006
@@ -29,7 +29,7 @@
     run_globals.update(__name__ = mod_name,
                        __file__ = mod_fname,
                        __loader__ = mod_loader)
-    exec code in run_globals
+    exec(code, run_globals)
     return run_globals
 
 def _run_module_code(code, init_globals=None,

Modified: python/branches/p3yk-noslice/Lib/sgmllib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/sgmllib.py	(original)
+++ python/branches/p3yk-noslice/Lib/sgmllib.py	Fri Dec 15 05:21:50 2006
@@ -29,12 +29,7 @@
 shorttagopen = re.compile('<[a-zA-Z][-.a-zA-Z0-9]*/')
 shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/')
 piclose = re.compile('>')
-starttag = re.compile(r'<[a-zA-Z][-_.:a-zA-Z0-9]*\s*('
-        r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
-        r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~@]'
-        r'[][\-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~\'"@]*(?=[\s>/<])))?'
-    r')*\s*/?\s*(?=[<>])')
-endtag = re.compile(r'</?[a-zA-Z][-_.:a-zA-Z0-9]*\s*/?\s*(?=[<>])')
+endbracket = re.compile('[<>]')
 tagfind = re.compile('[a-zA-Z][-_.a-zA-Z0-9]*')
 attrfind = re.compile(
     r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
@@ -254,10 +249,14 @@
             self.finish_shorttag(tag, data)
             self.__starttag_text = rawdata[start_pos:match.end(1) + 1]
             return k
-        match = starttag.match(rawdata, i)
+        # XXX The following should skip matching quotes (' or ")
+        # As a shortcut way to exit, this isn't so bad, but shouldn't
+        # be used to locate the actual end of the start tag since the
+        # < or > characters may be embedded in an attribute value.
+        match = endbracket.search(rawdata, i+1)
         if not match:
             return -1
-        j = match.end(0)
+        j = match.start(0)
         # Now parse the data between i+1 and j into a tag and attrs
         attrs = []
         if rawdata[i:i+2] == '<>':
@@ -306,10 +305,10 @@
     # Internal -- parse endtag
     def parse_endtag(self, i):
         rawdata = self.rawdata
-        match = endtag.match(rawdata, i)
+        match = endbracket.search(rawdata, i+1)
         if not match:
             return -1
-        j = match.end(0)
+        j = match.start(0)
         tag = rawdata[i+2:j].strip().lower()
         if rawdata[j] == '>':
             j = j+1

Modified: python/branches/p3yk-noslice/Lib/site.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/site.py	(original)
+++ python/branches/p3yk-noslice/Lib/site.py	Fri Dec 15 05:21:50 2006
@@ -135,7 +135,7 @@
             if line.startswith("#"):
                 continue
             if line.startswith("import"):
-                exec line
+                exec(line)
                 continue
             line = line.rstrip()
             dir, dircase = makepath(sitedir, line)
@@ -274,7 +274,7 @@
             for filename in self.__files:
                 filename = os.path.join(dir, filename)
                 try:
-                    fp = file(filename, "rU")
+                    fp = open(filename, "rU")
                     data = fp.read()
                     fp.close()
                     break

Modified: python/branches/p3yk-noslice/Lib/smtplib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/smtplib.py	(original)
+++ python/branches/p3yk-noslice/Lib/smtplib.py	Fri Dec 15 05:21:50 2006
@@ -52,9 +52,10 @@
 __all__ = ["SMTPException","SMTPServerDisconnected","SMTPResponseException",
            "SMTPSenderRefused","SMTPRecipientsRefused","SMTPDataError",
            "SMTPConnectError","SMTPHeloError","SMTPAuthenticationError",
-           "quoteaddr","quotedata","SMTP"]
+           "quoteaddr","quotedata","SMTP","SMTP_SSL"]
 
 SMTP_PORT = 25
+SMTP_SSL_PORT = 465
 CRLF="\r\n"
 
 OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
@@ -240,6 +241,7 @@
 
         """
         self.esmtp_features = {}
+        self.default_port = SMTP_PORT
         if host:
             (code, msg) = self.connect(host, port)
             if code != 220:
@@ -271,6 +273,13 @@
         """
         self.debuglevel = debuglevel
 
+    def _get_socket(self,af, socktype, proto,sa):
+        # This makes it simpler for SMTP_SSL to use the SMTP connect code
+        # and just alter the socket connection bit.
+        self.sock = socket.socket(af, socktype, proto)
+        if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
+        self.sock.connect(sa)
+
     def connect(self, host='localhost', port = 0):
         """Connect to a host on a given port.
 
@@ -289,16 +298,14 @@
                 try: port = int(port)
                 except ValueError:
                     raise socket.error, "nonnumeric port"
-        if not port: port = SMTP_PORT
+        if not port: port = self.default_port
         if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
         msg = "getaddrinfo returns an empty list"
         self.sock = None
         for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
             af, socktype, proto, canonname, sa = res
             try:
-                self.sock = socket.socket(af, socktype, proto)
-                if self.debuglevel > 0: print>>stderr, 'connect:', sa
-                self.sock.connect(sa)
+                self._get_socket(af,socktype,proto,sa)
             except socket.error, msg:
                 if self.debuglevel > 0: print>>stderr, 'connect fail:', msg
                 if self.sock:
@@ -716,6 +723,28 @@
         self.docmd("quit")
         self.close()
 
+class SMTP_SSL(SMTP):
+    """ This is a subclass derived from SMTP that connects over an SSL encrypted
+    socket (to use this class you need a socket module that was compiled with SSL
+    support). If host is not specified, '' (the local host) is used. If port is
+    omitted, the standard SMTP-over-SSL port (465) is used. keyfile and certfile
+    are also optional - they can contain a PEM formatted private key and
+    certificate chain file for the SSL connection.
+    """
+    def __init__(self, host = '', port = 0, local_hostname = None,
+                 keyfile = None, certfile = None):
+        self.keyfile = keyfile
+        self.certfile = certfile
+        SMTP.__init__(self,host,port,local_hostname)
+        self.default_port = SMTP_SSL_PORT
+
+    def _get_socket(self,af, socktype, proto,sa):
+        self.sock = socket.socket(af, socktype, proto)
+        if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
+        self.sock.connect(sa)
+        sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)
+        self.sock = SSLFakeSocket(self.sock, sslobj)
+        self.file = SSLFakeFile(sslobj)
 
 # Test the sendmail method, which tests most of the others.
 # Note: This always sends to localhost.

Modified: python/branches/p3yk-noslice/Lib/socket.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/socket.py	(original)
+++ python/branches/p3yk-noslice/Lib/socket.py	Fri Dec 15 05:21:50 2006
@@ -191,7 +191,7 @@
     _s = ("def %s(self, *args): return self._sock.%s(*args)\n\n"
           "%s.__doc__ = _realsocket.%s.__doc__\n")
     for _m in _socketmethods:
-        exec _s % (_m, _m, _m, _m)
+        exec(_s % (_m, _m, _m, _m))
     del _m, _s
 
 socket = SocketType = _socketobject

Modified: python/branches/p3yk-noslice/Lib/sqlite3/test/types.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/sqlite3/test/types.py	(original)
+++ python/branches/p3yk-noslice/Lib/sqlite3/test/types.py	Fri Dec 15 05:21:50 2006
@@ -86,6 +86,12 @@
             else:
                 return 1
 
+        def __eq__(self, other):
+            c = self.__cmp__(other)
+            if c is NotImplemented:
+                return c
+            return c == 0
+
         def __conform__(self, protocol):
             if protocol is sqlite.PrepareProtocol:
                 return self.val

Modified: python/branches/p3yk-noslice/Lib/subprocess.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/subprocess.py	(original)
+++ python/branches/p3yk-noslice/Lib/subprocess.py	Fri Dec 15 05:21:50 2006
@@ -420,7 +420,8 @@
 
 def _cleanup():
     for inst in _active[:]:
-        if inst.poll(_deadstate=sys.maxint) >= 0:
+        res = inst.poll(_deadstate=sys.maxint)
+        if res is not None and res >= 0:
             try:
                 _active.remove(inst)
             except ValueError:
@@ -965,6 +966,8 @@
 
             if isinstance(args, types.StringTypes):
                 args = [args]
+            else:
+                args = list(args)
 
             if shell:
                 args = ["/bin/sh", "-c"] + args
@@ -1000,14 +1003,10 @@
                     if errwrite:
                         os.dup2(errwrite, 2)
 
-                    # Close pipe fds.  Make sure we doesn't close the same
-                    # fd more than once.
-                    if p2cread:
-                        os.close(p2cread)
-                    if c2pwrite and c2pwrite not in (p2cread,):
-                        os.close(c2pwrite)
-                    if errwrite and errwrite not in (p2cread, c2pwrite):
-                        os.close(errwrite)
+                    # Close pipe fds.  Make sure we don't close the same
+                    # fd more than once, or standard fds.
+                    for fd in set((p2cread, c2pwrite, errwrite))-set((0,1,2)):
+                        if fd: os.close(fd)
 
                     # Close all other fds, if asked for
                     if close_fds:

Modified: python/branches/p3yk-noslice/Lib/symbol.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/symbol.py	(original)
+++ python/branches/p3yk-noslice/Lib/symbol.py	Fri Dec 15 05:21:50 2006
@@ -43,57 +43,56 @@
 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
+assert_stmt = 289
+compound_stmt = 290
+if_stmt = 291
+while_stmt = 292
+for_stmt = 293
+try_stmt = 294
+with_stmt = 295
+with_var = 296
+except_clause = 297
+suite = 298
+testlist_safe = 299
+old_test = 300
+old_lambdef = 301
+test = 302
+or_test = 303
+and_test = 304
+not_test = 305
+comparison = 306
+comp_op = 307
+expr = 308
+xor_expr = 309
+and_expr = 310
+shift_expr = 311
+arith_expr = 312
+term = 313
+factor = 314
+power = 315
+atom = 316
+listmaker = 317
+testlist_gexp = 318
+lambdef = 319
+trailer = 320
+subscriptlist = 321
+subscript = 322
+sliceop = 323
+exprlist = 324
+testlist = 325
+dictsetmaker = 326
+classdef = 327
+arglist = 328
+argument = 329
+list_iter = 330
+list_for = 331
+list_if = 332
+gen_iter = 333
+gen_for = 334
+gen_if = 335
+testlist1 = 336
+encoding_decl = 337
+yield_expr = 338
 #--end constants--
 
 sym_name = {}

Modified: python/branches/p3yk-noslice/Lib/symtable.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/symtable.py	(original)
+++ python/branches/p3yk-noslice/Lib/symtable.py	Fri Dec 15 05:21:50 2006
@@ -4,7 +4,7 @@
 from _symtable import USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, \
      DEF_STAR, DEF_DOUBLESTAR, DEF_INTUPLE, DEF_FREE, \
      DEF_FREE_GLOBAL, DEF_FREE_CLASS, DEF_IMPORT, DEF_BOUND, \
-     OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC
+     OPT_IMPORT_STAR
 
 import weakref
 
@@ -94,8 +94,8 @@
         return bool(self._table.children)
 
     def has_exec(self):
-        """Return true if the scope uses exec"""
-        return bool(self._table.optimized & (OPT_EXEC | OPT_BARE_EXEC))
+        """Return true if the scope uses exec.  Deprecated method."""
+        return False
 
     def has_import_star(self):
         """Return true if the scope uses import *"""

Modified: python/branches/p3yk-noslice/Lib/tarfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/tarfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/tarfile.py	Fri Dec 15 05:21:50 2006
@@ -49,6 +49,7 @@
 import errno
 import time
 import struct
+import copy
 
 if sys.platform == 'mac':
     # This module needs work for MacOS9, especially in the area of pathname
@@ -65,6 +66,8 @@
 # from tarfile import *
 __all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError"]
 
+from __builtin__ import open as _open # Since 'open' is TarFile.open
+
 #---------------------------------------------------------
 # tar constants
 #---------------------------------------------------------
@@ -136,7 +139,7 @@
 def stn(s, length):
     """Convert a python string to a null-terminated string buffer.
     """
-    return s[:length-1] + (length - len(s) - 1) * NUL + NUL
+    return s[:length] + (length - len(s)) * NUL
 
 def nti(s):
     """Convert a number field to a python number.
@@ -144,7 +147,7 @@
     # There are two possible encodings for a number field, see
     # itn() below.
     if s[0] != chr(0200):
-        n = int(s.rstrip(NUL) or "0", 8)
+        n = int(s.rstrip(NUL + " ") or "0", 8)
     else:
         n = 0L
         for i in xrange(len(s) - 1):
@@ -793,7 +796,6 @@
         """Construct a TarInfo object. name is the optional name
            of the member.
         """
-
         self.name = name        # member name (dirnames must end with '/')
         self.mode = 0666        # file permissions
         self.uid = 0            # user id
@@ -807,8 +809,6 @@
         self.gname = "group"    # group name
         self.devmajor = 0       # device major number
         self.devminor = 0       # device minor number
-        self.prefix = ""        # prefix to filename or information
-                                # about sparse files
 
         self.offset = 0         # the tar header starts here
         self.offset_data = 0    # the file's data starts here
@@ -840,24 +840,74 @@
         tarinfo.gname = buf[297:329].rstrip(NUL)
         tarinfo.devmajor = nti(buf[329:337])
         tarinfo.devminor = nti(buf[337:345])
-        tarinfo.prefix = buf[345:500]
+        prefix = buf[345:500].rstrip(NUL)
+
+        if prefix and not tarinfo.issparse():
+            tarinfo.name = prefix + "/" + tarinfo.name
 
         if tarinfo.chksum not in calc_chksums(buf):
             raise ValueError("invalid header")
         return tarinfo
 
     def tobuf(self, posix=False):
-        """Return a tar header block as a 512 byte string.
+        """Return a tar header as a string of 512 byte blocks.
         """
+        buf = ""
+        type = self.type
+        prefix = ""
+
+        if self.name.endswith("/"):
+            type = DIRTYPE
+
+        if type in (GNUTYPE_LONGNAME, GNUTYPE_LONGLINK):
+            # Prevent "././@LongLink" from being normalized.
+            name = self.name
+        else:
+            name = normpath(self.name)
+
+        if type == DIRTYPE:
+            # directories should end with '/'
+            name += "/"
+
+        linkname = self.linkname
+        if linkname:
+            # if linkname is empty we end up with a '.'
+            linkname = normpath(linkname)
+
+        if posix:
+            if self.size > MAXSIZE_MEMBER:
+                raise ValueError("file is too large (>= 8 GB)")
+
+            if len(self.linkname) > LENGTH_LINK:
+                raise ValueError("linkname is too long (>%d)" % (LENGTH_LINK))
+
+            if len(name) > LENGTH_NAME:
+                prefix = name[:LENGTH_PREFIX + 1]
+                while prefix and prefix[-1] != "/":
+                    prefix = prefix[:-1]
+
+                name = name[len(prefix):]
+                prefix = prefix[:-1]
+
+                if not prefix or len(name) > LENGTH_NAME:
+                    raise ValueError("name is too long")
+
+        else:
+            if len(self.linkname) > LENGTH_LINK:
+                buf += self._create_gnulong(self.linkname, GNUTYPE_LONGLINK)
+
+            if len(name) > LENGTH_NAME:
+                buf += self._create_gnulong(name, GNUTYPE_LONGNAME)
+
         parts = [
-            stn(self.name, 100),
+            stn(name, 100),
             itn(self.mode & 07777, 8, posix),
             itn(self.uid, 8, posix),
             itn(self.gid, 8, posix),
             itn(self.size, 12, posix),
             itn(self.mtime, 12, posix),
             "        ", # checksum field
-            self.type,
+            type,
             stn(self.linkname, 100),
             stn(MAGIC, 6),
             stn(VERSION, 2),
@@ -865,15 +915,38 @@
             stn(self.gname, 32),
             itn(self.devmajor, 8, posix),
             itn(self.devminor, 8, posix),
-            stn(self.prefix, 155)
+            stn(prefix, 155)
         ]
 
-        buf = struct.pack("%ds" % BLOCKSIZE, "".join(parts))
-        chksum = calc_chksums(buf)[0]
-        buf = buf[:148] + "%06o\0" % chksum + buf[155:]
+        buf += struct.pack("%ds" % BLOCKSIZE, "".join(parts))
+        chksum = calc_chksums(buf[-BLOCKSIZE:])[0]
+        buf = buf[:-364] + "%06o\0" % chksum + buf[-357:]
         self.buf = buf
         return buf
 
+    def _create_gnulong(self, name, type):
+        """Create a GNU longname/longlink header from name.
+           It consists of an extended tar header, with the length
+           of the longname as size, followed by data blocks,
+           which contain the longname as a null terminated string.
+        """
+        name += NUL
+
+        tarinfo = self.__class__()
+        tarinfo.name = "././@LongLink"
+        tarinfo.type = type
+        tarinfo.mode = 0
+        tarinfo.size = len(name)
+
+        # create extended header
+        buf = tarinfo.tobuf()
+        # create name blocks
+        buf += name
+        blocks, remainder = divmod(len(name), BLOCKSIZE)
+        if remainder > 0:
+            buf += (BLOCKSIZE - remainder) * NUL
+        return buf
+
     def isreg(self):
         return self.type in REGULAR_TYPES
     def isfile(self):
@@ -934,7 +1007,7 @@
         self.mode = {"r": "rb", "a": "r+b", "w": "wb"}[mode]
 
         if not fileobj:
-            fileobj = file(self.name, self.mode)
+            fileobj = _open(self.name, self.mode)
             self._extfileobj = False
         else:
             if self.name is None and hasattr(fileobj, "name"):
@@ -1083,7 +1156,7 @@
         tarname = pre + ext
 
         if fileobj is None:
-            fileobj = file(name, mode + "b")
+            fileobj = _open(name, mode + "b")
 
         if mode != "r":
             name = tarname
@@ -1355,7 +1428,7 @@
 
         # Append the tar header and data to the archive.
         if tarinfo.isreg():
-            f = file(name, "rb")
+            f = _open(name, "rb")
             self.addfile(tarinfo, f)
             f.close()
 
@@ -1377,50 +1450,11 @@
         """
         self._check("aw")
 
-        tarinfo.name = normpath(tarinfo.name)
-        if tarinfo.isdir():
-            # directories should end with '/'
-            tarinfo.name += "/"
-
-        if tarinfo.linkname:
-            tarinfo.linkname = normpath(tarinfo.linkname)
-
-        if tarinfo.size > MAXSIZE_MEMBER:
-            if self.posix:
-                raise ValueError("file is too large (>= 8 GB)")
-            else:
-                self._dbg(2, "tarfile: Created GNU tar largefile header")
-
-
-        if len(tarinfo.linkname) > LENGTH_LINK:
-            if self.posix:
-                raise ValueError("linkname is too long (>%d)" % (LENGTH_LINK))
-            else:
-                self._create_gnulong(tarinfo.linkname, GNUTYPE_LONGLINK)
-                tarinfo.linkname = tarinfo.linkname[:LENGTH_LINK -1]
-                self._dbg(2, "tarfile: Created GNU tar extension LONGLINK")
-
-        if len(tarinfo.name) > LENGTH_NAME:
-            if self.posix:
-                prefix = tarinfo.name[:LENGTH_PREFIX + 1]
-                while prefix and prefix[-1] != "/":
-                    prefix = prefix[:-1]
-
-                name = tarinfo.name[len(prefix):]
-                prefix = prefix[:-1]
-
-                if not prefix or len(name) > LENGTH_NAME:
-                    raise ValueError("name is too long (>%d)" % (LENGTH_NAME))
-
-                tarinfo.name   = name
-                tarinfo.prefix = prefix
-            else:
-                self._create_gnulong(tarinfo.name, GNUTYPE_LONGNAME)
-                tarinfo.name = tarinfo.name[:LENGTH_NAME - 1]
-                self._dbg(2, "tarfile: Created GNU tar extension LONGNAME")
+        tarinfo = copy.copy(tarinfo)
 
-        self.fileobj.write(tarinfo.tobuf(self.posix))
-        self.offset += BLOCKSIZE
+        buf = tarinfo.tobuf(self.posix)
+        self.fileobj.write(buf)
+        self.offset += len(buf)
 
         # If there's data to follow, append it.
         if fileobj is not None:
@@ -1617,7 +1651,7 @@
         """Make a file called targetpath.
         """
         source = self.extractfile(tarinfo)
-        target = file(targetpath, "wb")
+        target = _open(targetpath, "wb")
         copyfileobj(source, target)
         source.close()
         target.close()
@@ -1779,12 +1813,6 @@
         if tarinfo.isreg() and tarinfo.name.endswith("/"):
             tarinfo.type = DIRTYPE
 
-        # The prefix field is used for filenames > 100 in
-        # the POSIX standard.
-        # name = prefix + '/' + name
-        tarinfo.name = normpath(os.path.join(tarinfo.prefix.rstrip(NUL),
-                                             tarinfo.name))
-
         # Directory names should have a '/' at the end.
         if tarinfo.isdir():
             tarinfo.name += "/"
@@ -1909,10 +1937,6 @@
         self.offset += self._block(tarinfo.size)
         tarinfo.size = origsize
 
-        # Clear the prefix field so that it is not used
-        # as a pathname in next().
-        tarinfo.prefix = ""
-
         return tarinfo
 
     #--------------------------------------------------------------------------
@@ -1970,31 +1994,6 @@
         else:
             return TarIter(self)
 
-    def _create_gnulong(self, name, type):
-        """Write a GNU longname/longlink member to the TarFile.
-           It consists of an extended tar header, with the length
-           of the longname as size, followed by data blocks,
-           which contain the longname as a null terminated string.
-        """
-        name += NUL
-
-        tarinfo = TarInfo()
-        tarinfo.name = "././@LongLink"
-        tarinfo.type = type
-        tarinfo.mode = 0
-        tarinfo.size = len(name)
-
-        # write extended header
-        self.fileobj.write(tarinfo.tobuf())
-        self.offset += BLOCKSIZE
-        # write name blocks
-        self.fileobj.write(name)
-        blocks, remainder = divmod(tarinfo.size, BLOCKSIZE)
-        if remainder > 0:
-            self.fileobj.write(NUL * (BLOCKSIZE - remainder))
-            blocks += 1
-        self.offset += blocks * BLOCKSIZE
-
     def _dbg(self, level, msg):
         """Write debugging output to sys.stderr.
         """

Modified: python/branches/p3yk-noslice/Lib/test/README
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/README	(original)
+++ python/branches/p3yk-noslice/Lib/test/README	Fri Dec 15 05:21:50 2006
@@ -379,8 +379,8 @@
       point numbers when you expect them to only be approximately equal
       withing a fuzz factor (``test_support.FUZZ``, which defaults to 1e-6).
 
-    * ``check_syntax(statement)`` - make sure that the statement is *not*
-      correct Python syntax.
+    * ``check_syntax_error(testcase, statement)`` - make sure that the
+      statement is *not* correct Python syntax.
 
 
 Python and C statement coverage results are currently available at

Modified: python/branches/p3yk-noslice/Lib/test/crashers/bogus_code_obj.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/crashers/bogus_code_obj.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/crashers/bogus_code_obj.py	Fri Dec 15 05:21:50 2006
@@ -16,4 +16,4 @@
 
 co = types.CodeType(0, 0, 0, 0, '\x04\x71\x00\x00', (),
                     (), (), '', '', 1, '')
-exec co
+exec(co)

Modified: python/branches/p3yk-noslice/Lib/test/list_tests.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/list_tests.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/list_tests.py	Fri Dec 15 05:21:50 2006
@@ -37,7 +37,7 @@
 
         self.assertEqual(str(a0), str(l0))
         self.assertEqual(repr(a0), repr(l0))
-        self.assertEqual(`a2`, `l2`)
+        self.assertEqual(repr(a2), repr(l2))
         self.assertEqual(str(a2), "[0, 1, 2]")
         self.assertEqual(repr(a2), "[0, 1, 2]")
 
@@ -269,7 +269,6 @@
         self.assertRaises(TypeError, a.insert)
 
     def test_pop(self):
-        from decimal import Decimal
         a = self.type2test([-1, 0, 1])
         a.pop()
         self.assertEqual(a, [-1, 0])
@@ -281,8 +280,6 @@
         self.assertRaises(IndexError, a.pop)
         self.assertRaises(TypeError, a.pop, 42, 42)
         a = self.type2test([0, 10, 20, 30, 40])
-        self.assertEqual(a.pop(Decimal(2)), 20)
-        self.assertRaises(IndexError, a.pop, Decimal(25))
 
     def test_remove(self):
         a = self.type2test([0, 0, 1])

Modified: python/branches/p3yk-noslice/Lib/test/mapping_tests.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/mapping_tests.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/mapping_tests.py	Fri Dec 15 05:21:50 2006
@@ -60,10 +60,10 @@
         for k in self.other:
             self.failIf(k in d)
         #cmp
-        self.assertEqual(cmp(p,p), 0)
-        self.assertEqual(cmp(d,d), 0)
-        self.assertEqual(cmp(p,d), -1)
-        self.assertEqual(cmp(d,p), 1)
+        self.assertEqual(p, p)
+        self.assertEqual(d, d)
+        self.assertNotEqual(p, d)
+        self.assertNotEqual(d, p)
         #__non__zero__
         if p: self.fail("Empty mapping must compare to False")
         if not d: self.fail("Full mapping must compare to True")
@@ -623,9 +623,10 @@
         d = self._full_mapping({1: BadRepr()})
         self.assertRaises(Exc, repr, d)
 
-    def test_le(self):
-        self.assert_(not (self._empty_mapping() < self._empty_mapping()))
-        self.assert_(not (self._full_mapping({1: 2}) < self._full_mapping({1L: 2L})))
+    def test_eq(self):
+        self.assertEqual(self._empty_mapping(), self._empty_mapping())
+        self.assertEqual(self._full_mapping({1: 2}),
+                         self._full_mapping({1L: 2L}))
 
         class Exc(Exception): pass
 
@@ -633,16 +634,12 @@
             def __eq__(self, other):
                 raise Exc()
             def __hash__(self):
-                return 42
+                return 1
 
         d1 = self._full_mapping({BadCmp(): 1})
         d2 = self._full_mapping({1: 1})
-        try:
-            d1 < d2
-        except Exc:
-            pass
-        else:
-            self.fail("< didn't raise Exc")
+        self.assertRaises(Exc, lambda: BadCmp()==1)
+        self.assertRaises(Exc, lambda: d1==d2)
 
     def test_setdefault(self):
         TestMappingProtocol.test_setdefault(self)

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_MimeWriter
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_MimeWriter	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,110 +0,0 @@
-test_MimeWriter
-From: bwarsaw at cnri.reston.va.us
-Date: Mon Feb 12 17:21:48 EST 1996
-To: kss-submit at cnri.reston.va.us
-MIME-Version: 1.0
-Content-Type: multipart/knowbot;
-    boundary="801spam999";
-    version="0.1"
-
-This is a multi-part message in MIME format.
-
---801spam999
-Content-Type: multipart/knowbot-metadata;
-    boundary="802spam999"
-
-
---802spam999
-Content-Type: message/rfc822
-KP-Metadata-Type: simple
-KP-Access: read-only
-
-KPMD-Interpreter: python
-KPMD-Interpreter-Version: 1.3
-KPMD-Owner-Name: Barry Warsaw
-KPMD-Owner-Rendezvous: bwarsaw at cnri.reston.va.us
-KPMD-Home-KSS: kss.cnri.reston.va.us
-KPMD-Identifier: hdl://cnri.kss/my_first_knowbot
-KPMD-Launch-Date: Mon Feb 12 16:39:03 EST 1996
-
---802spam999
-Content-Type: text/isl
-KP-Metadata-Type: complex
-KP-Metadata-Key: connection
-KP-Access: read-only
-KP-Connection-Description: Barry's Big Bass Business
-KP-Connection-Id: B4
-KP-Connection-Direction: client
-
-INTERFACE Seller-1;
-
-TYPE Seller = OBJECT
-    DOCUMENTATION "A simple Seller interface to test ILU"
-    METHODS
-            price():INTEGER,
-    END;
-
---802spam999
-Content-Type: message/external-body;
-    access-type="URL";
-    URL="hdl://cnri.kss/generic-knowbot"
-
-Content-Type: text/isl
-KP-Metadata-Type: complex
-KP-Metadata-Key: generic-interface
-KP-Access: read-only
-KP-Connection-Description: Generic Interface for All Knowbots
-KP-Connection-Id: generic-kp
-KP-Connection-Direction: client
-
-
---802spam999--
-
---801spam999
-Content-Type: multipart/knowbot-code;
-    boundary="803spam999"
-
-
---803spam999
-Content-Type: text/plain
-KP-Module-Name: BuyerKP
-
-class Buyer:
-    def __setup__(self, maxprice):
-        self._maxprice = maxprice
-
-    def __main__(self, kos):
-        """Entry point upon arrival at a new KOS."""
-        broker = kos.broker()
-        # B4 == Barry's Big Bass Business :-)
-        seller = broker.lookup('Seller_1.Seller', 'B4')
-        if seller:
-            price = seller.price()
-            print 'Seller wants $', price, '... '
-            if price > self._maxprice:
-                print 'too much!'
-            else:
-                print "I'll take it!"
-        else:
-            print 'no seller found here'
-
---803spam999--
-
---801spam999
-Content-Type: multipart/knowbot-state;
-    boundary="804spam999"
-KP-Main-Module: main
-
-
---804spam999
-Content-Type: text/plain
-KP-Module-Name: main
-
-# instantiate a buyer instance and put it in a magic place for the KOS
-# to find.
-__kp__ = Buyer()
-__kp__.__setup__(500)
-
---804spam999--
-
---801spam999--

Modified: python/branches/p3yk-noslice/Lib/test/output/test_cProfile
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/output/test_cProfile	(original)
+++ python/branches/p3yk-noslice/Lib/test/output/test_cProfile	Fri Dec 15 05:21:50 2006
@@ -1,5 +1,5 @@
 test_cProfile
-         126 function calls (106 primitive calls) in 1.000 CPU seconds
+         127 function calls (107 primitive calls) in 1.000 CPU seconds
 
    Ordered by: standard name
 
@@ -14,6 +14,7 @@
         4    0.116    0.029    0.120    0.030 test_cProfile.py:78(helper1)
         2    0.000    0.000    0.140    0.070 test_cProfile.py:89(helper2_indirect)
         8    0.312    0.039    0.400    0.050 test_cProfile.py:93(helper2)
+        1    0.000    0.000    1.000    1.000 {exec}
        12    0.000    0.000    0.012    0.001 {hasattr}
         4    0.000    0.000    0.000    0.000 {method 'append' of 'list' objects}
         1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
@@ -44,6 +45,7 @@
                                                            2    0.078    0.100  test_cProfile.py:93(helper2)
 test_cProfile.py:93(helper2)                      ->       8    0.064    0.080  test_cProfile.py:103(subhelper)
                                                            8    0.000    0.008  {hasattr}
+{exec}                                            ->       1    0.000    1.000  <string>:1(<module>)
 {hasattr}                                         ->      12    0.012    0.012  test_cProfile.py:115(__getattr__)
 {method 'append' of 'list' objects}               ->
 {method 'disable' of '_lsprof.Profiler' objects}  ->
@@ -55,7 +57,7 @@
 
 Function                                          was called by...
                                                       ncalls  tottime  cumtime
-<string>:1(<module>)                              <-
+<string>:1(<module>)                              <-       1    0.000    1.000  {exec}
 test_cProfile.py:103(subhelper)                   <-       8    0.064    0.080  test_cProfile.py:93(helper2)
 test_cProfile.py:115(__getattr__)                 <-      16    0.016    0.016  test_cProfile.py:103(subhelper)
                                                           12    0.012    0.012  {hasattr}
@@ -69,6 +71,7 @@
 test_cProfile.py:89(helper2_indirect)             <-       2    0.000    0.140  test_cProfile.py:60(helper)
 test_cProfile.py:93(helper2)                      <-       6    0.234    0.300  test_cProfile.py:60(helper)
                                                            2    0.078    0.100  test_cProfile.py:89(helper2_indirect)
+{exec}                                            <-
 {hasattr}                                         <-       4    0.000    0.004  test_cProfile.py:78(helper1)
                                                            8    0.000    0.008  test_cProfile.py:93(helper2)
 {method 'append' of 'list' objects}               <-       4    0.000    0.000  test_cProfile.py:78(helper1)

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_cgi
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_cgi	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,42 +0,0 @@
-test_cgi
-'' => []
-'&' => []
-'&&' => []
-'=' => [('', '')]
-'=a' => [('', 'a')]
-'a' => [('a', '')]
-'a=' => [('a', '')]
-'a=' => [('a', '')]
-'&a=b' => [('a', 'b')]
-'a=a+b&b=b+c' => [('a', 'a b'), ('b', 'b c')]
-'a=1&a=2' => [('a', '1'), ('a', '2')]
-''
-'&'
-'&&'
-';'
-';&;'
-'='
-'=&='
-'=;='
-'=a'
-'&=a'
-'=a&'
-'=&a'
-'b=a'
-'b+=a'
-'a=b=a'
-'a=+b=a'
-'&b=a'
-'b&=a'
-'a=a+b&b=b+c'
-'a=a+b&a=b+a'
-'x=1&y=2.0&z=2-3.%2b0'
-'x=1;y=2.0&z=2-3.%2b0'
-'x=1;y=2.0;z=2-3.%2b0'
-'Hbc5161168c542333633315dee1182227:key_store_seqid=400006&cuyer=r&view=bustomer&order_id=0bb2e248638833d48cb7fed300000f1b&expire=964546263&lobale=en-US&kid=130003.300038&ss=env'
-'group_id=5470&set=custom&_assigned_to=31392&_status=1&_category=100&SUBMIT=Browse'
-Testing log
-Testing initlog 1
-Testing log 2
-Test FieldStorage methods that use readline
-Test basic FieldStorage multipart parsing

Modified: python/branches/p3yk-noslice/Lib/test/output/test_class
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/output/test_class	(original)
+++ python/branches/p3yk-noslice/Lib/test/output/test_class	Fri Dec 15 05:21:50 2006
@@ -51,16 +51,14 @@
 __hash__: ()
 __repr__: ()
 __str__: ()
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
-__cmp__: (1,)
+__eq__: (1,)
+__lt__: (1,)
+__gt__: (1,)
+__ne__: (1,)
+__eq__: (1,)
+__gt__: (1,)
+__lt__: (1,)
+__ne__: (1,)
 __del__: ()
 __getattr__: ('spam',)
 __setattr__: ('eggs', 'spam, spam, spam and ham')

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_cookie
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_cookie	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,32 +0,0 @@
-test_cookie
-<SimpleCookie: chips='ahoy' vienna='finger'>
-Set-Cookie: chips=ahoy
-Set-Cookie: vienna=finger
-  chips 'ahoy' 'ahoy'
-Set-Cookie: chips=ahoy
-  vienna 'finger' 'finger'
-Set-Cookie: vienna=finger
-<SimpleCookie: keebler='E=mc2; L="Loves"; fudge=\n;'>
-Set-Cookie: keebler="E=mc2; L=\"Loves\"; fudge=\012;"
-  keebler 'E=mc2; L="Loves"; fudge=\n;' 'E=mc2; L="Loves"; fudge=\n;'
-Set-Cookie: keebler="E=mc2; L=\"Loves\"; fudge=\012;"
-<SimpleCookie: keebler='E=mc2'>
-Set-Cookie: keebler=E=mc2
-  keebler 'E=mc2' 'E=mc2'
-Set-Cookie: keebler=E=mc2
-Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme
-
-        <script type="text/javascript">
-        <!-- begin hiding
-        document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme; Version=1";
-        // end hiding -->
-        </script>
-        
-
-        <script type="text/javascript">
-        <!-- begin hiding
-        document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme";
-        // end hiding -->
-        </script>
-        
-If anything blows up after this line, it's from Cookie's doctest.

Modified: python/branches/p3yk-noslice/Lib/test/output/test_extcall
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/output/test_extcall	(original)
+++ python/branches/p3yk-noslice/Lib/test/output/test_extcall	Fri Dec 15 05:21:50 2006
@@ -9,9 +9,9 @@
 (1, 2, 3) {'a': 4, 'b': 5}
 (1, 2, 3, 4, 5) {'a': 6, 'b': 7}
 (1, 2, 3, 6, 7) {'a': 8, 'b': 9, 'x': 4, 'y': 5}
-TypeError: g() takes at least 1 argument (0 given)
-TypeError: g() takes at least 1 argument (0 given)
-TypeError: g() takes at least 1 argument (0 given)
+TypeError: g() takes at least 1 positional argument (0 given)
+TypeError: g() takes at least 1 positional argument (0 given)
+TypeError: g() takes at least 1 positional argument (0 given)
 1 () {}
 1 (2,) {}
 1 (2, 3) {}
@@ -35,24 +35,24 @@
 3 512 True
 3
 3
-za () {} -> za() takes exactly 1 argument (0 given)
+za () {} -> za() takes exactly 1 positional argument (0 given)
 za () {'a': 'aa'} -> ok za aa B D E V a
 za () {'d': 'dd'} -> za() got an unexpected keyword argument 'd'
 za () {'a': 'aa', 'd': 'dd'} -> za() got an unexpected keyword argument 'd'
 za () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> za() got an unexpected keyword argument 'b'
-za (1, 2) {} -> za() takes exactly 1 argument (2 given)
-za (1, 2) {'a': 'aa'} -> za() takes exactly 1 non-keyword argument (2 given)
-za (1, 2) {'d': 'dd'} -> za() takes exactly 1 non-keyword argument (2 given)
-za (1, 2) {'a': 'aa', 'd': 'dd'} -> za() takes exactly 1 non-keyword argument (2 given)
-za (1, 2) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> za() takes exactly 1 non-keyword argument (2 given)
-za (1, 2, 3, 4, 5) {} -> za() takes exactly 1 argument (5 given)
-za (1, 2, 3, 4, 5) {'a': 'aa'} -> za() takes exactly 1 non-keyword argument (5 given)
-za (1, 2, 3, 4, 5) {'d': 'dd'} -> za() takes exactly 1 non-keyword argument (5 given)
-za (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> za() takes exactly 1 non-keyword argument (5 given)
-za (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> za() takes exactly 1 non-keyword argument (5 given)
-zade () {} -> zade() takes at least 1 argument (0 given)
+za (1, 2) {} -> za() takes exactly 1 positional argument (2 given)
+za (1, 2) {'a': 'aa'} -> za() takes exactly 1 non-keyword positional argument (2 given)
+za (1, 2) {'d': 'dd'} -> za() takes exactly 1 non-keyword positional argument (2 given)
+za (1, 2) {'a': 'aa', 'd': 'dd'} -> za() takes exactly 1 non-keyword positional argument (2 given)
+za (1, 2) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> za() takes exactly 1 non-keyword positional argument (2 given)
+za (1, 2, 3, 4, 5) {} -> za() takes exactly 1 positional argument (5 given)
+za (1, 2, 3, 4, 5) {'a': 'aa'} -> za() takes exactly 1 non-keyword positional argument (5 given)
+za (1, 2, 3, 4, 5) {'d': 'dd'} -> za() takes exactly 1 non-keyword positional argument (5 given)
+za (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> za() takes exactly 1 non-keyword positional argument (5 given)
+za (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> za() takes exactly 1 non-keyword positional argument (5 given)
+zade () {} -> zade() takes at least 1 positional argument (0 given)
 zade () {'a': 'aa'} -> ok zade aa B d e V a
-zade () {'d': 'dd'} -> zade() takes at least 1 non-keyword argument (0 given)
+zade () {'d': 'dd'} -> zade() takes at least 1 non-keyword positional argument (0 given)
 zade () {'a': 'aa', 'd': 'dd'} -> ok zade aa B dd e V d
 zade () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zade() got an unexpected keyword argument 'b'
 zade (1, 2) {} -> ok zade 1 B 2 e V e
@@ -60,30 +60,30 @@
 zade (1, 2) {'d': 'dd'} -> zade() got multiple values for keyword argument 'd'
 zade (1, 2) {'a': 'aa', 'd': 'dd'} -> zade() got multiple values for keyword argument 'a'
 zade (1, 2) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zade() got multiple values for keyword argument 'a'
-zade (1, 2, 3, 4, 5) {} -> zade() takes at most 3 arguments (5 given)
-zade (1, 2, 3, 4, 5) {'a': 'aa'} -> zade() takes at most 3 non-keyword arguments (5 given)
-zade (1, 2, 3, 4, 5) {'d': 'dd'} -> zade() takes at most 3 non-keyword arguments (5 given)
-zade (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zade() takes at most 3 non-keyword arguments (5 given)
-zade (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zade() takes at most 3 non-keyword arguments (5 given)
-zabk () {} -> zabk() takes exactly 2 arguments (0 given)
-zabk () {'a': 'aa'} -> zabk() takes exactly 2 non-keyword arguments (1 given)
-zabk () {'d': 'dd'} -> zabk() takes exactly 2 non-keyword arguments (0 given)
-zabk () {'a': 'aa', 'd': 'dd'} -> zabk() takes exactly 2 non-keyword arguments (1 given)
+zade (1, 2, 3, 4, 5) {} -> zade() takes at most 3 positional arguments (5 given)
+zade (1, 2, 3, 4, 5) {'a': 'aa'} -> zade() takes at most 3 non-keyword positional arguments (5 given)
+zade (1, 2, 3, 4, 5) {'d': 'dd'} -> zade() takes at most 3 non-keyword positional arguments (5 given)
+zade (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zade() takes at most 3 non-keyword positional arguments (5 given)
+zade (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zade() takes at most 3 non-keyword positional arguments (5 given)
+zabk () {} -> zabk() takes exactly 2 positional arguments (0 given)
+zabk () {'a': 'aa'} -> zabk() takes exactly 2 non-keyword positional arguments (1 given)
+zabk () {'d': 'dd'} -> zabk() takes exactly 2 non-keyword positional arguments (0 given)
+zabk () {'a': 'aa', 'd': 'dd'} -> zabk() takes exactly 2 non-keyword positional arguments (1 given)
 zabk () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> ok zabk aa bb D E V {'d': 'dd', 'e': 'ee'}
 zabk (1, 2) {} -> ok zabk 1 2 D E V {}
 zabk (1, 2) {'a': 'aa'} -> zabk() got multiple values for keyword argument 'a'
 zabk (1, 2) {'d': 'dd'} -> ok zabk 1 2 D E V {'d': 'dd'}
 zabk (1, 2) {'a': 'aa', 'd': 'dd'} -> zabk() got multiple values for keyword argument 'a'
 zabk (1, 2) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabk() got multiple values for keyword argument 'a'
-zabk (1, 2, 3, 4, 5) {} -> zabk() takes exactly 2 arguments (5 given)
-zabk (1, 2, 3, 4, 5) {'a': 'aa'} -> zabk() takes exactly 2 non-keyword arguments (5 given)
-zabk (1, 2, 3, 4, 5) {'d': 'dd'} -> zabk() takes exactly 2 non-keyword arguments (5 given)
-zabk (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zabk() takes exactly 2 non-keyword arguments (5 given)
-zabk (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabk() takes exactly 2 non-keyword arguments (5 given)
-zabdv () {} -> zabdv() takes at least 2 arguments (0 given)
-zabdv () {'a': 'aa'} -> zabdv() takes at least 2 non-keyword arguments (1 given)
-zabdv () {'d': 'dd'} -> zabdv() takes at least 2 non-keyword arguments (0 given)
-zabdv () {'a': 'aa', 'd': 'dd'} -> zabdv() takes at least 2 non-keyword arguments (1 given)
+zabk (1, 2, 3, 4, 5) {} -> zabk() takes exactly 2 positional arguments (5 given)
+zabk (1, 2, 3, 4, 5) {'a': 'aa'} -> zabk() takes exactly 2 non-keyword positional arguments (5 given)
+zabk (1, 2, 3, 4, 5) {'d': 'dd'} -> zabk() takes exactly 2 non-keyword positional arguments (5 given)
+zabk (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zabk() takes exactly 2 non-keyword positional arguments (5 given)
+zabk (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabk() takes exactly 2 non-keyword positional arguments (5 given)
+zabdv () {} -> zabdv() takes at least 2 positional arguments (0 given)
+zabdv () {'a': 'aa'} -> zabdv() takes at least 2 non-keyword positional arguments (1 given)
+zabdv () {'d': 'dd'} -> zabdv() takes at least 2 non-keyword positional arguments (0 given)
+zabdv () {'a': 'aa', 'd': 'dd'} -> zabdv() takes at least 2 non-keyword positional arguments (1 given)
 zabdv () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabdv() got an unexpected keyword argument 'e'
 zabdv (1, 2) {} -> ok zabdv 1 2 d E () e
 zabdv (1, 2) {'a': 'aa'} -> zabdv() got multiple values for keyword argument 'a'
@@ -95,10 +95,10 @@
 zabdv (1, 2, 3, 4, 5) {'d': 'dd'} -> zabdv() got multiple values for keyword argument 'd'
 zabdv (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zabdv() got multiple values for keyword argument 'a'
 zabdv (1, 2, 3, 4, 5) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabdv() got multiple values for keyword argument 'a'
-zabdevk () {} -> zabdevk() takes at least 2 arguments (0 given)
-zabdevk () {'a': 'aa'} -> zabdevk() takes at least 2 non-keyword arguments (1 given)
-zabdevk () {'d': 'dd'} -> zabdevk() takes at least 2 non-keyword arguments (0 given)
-zabdevk () {'a': 'aa', 'd': 'dd'} -> zabdevk() takes at least 2 non-keyword arguments (1 given)
+zabdevk () {} -> zabdevk() takes at least 2 positional arguments (0 given)
+zabdevk () {'a': 'aa'} -> zabdevk() takes at least 2 non-keyword positional arguments (1 given)
+zabdevk () {'d': 'dd'} -> zabdevk() takes at least 2 non-keyword positional arguments (0 given)
+zabdevk () {'a': 'aa', 'd': 'dd'} -> zabdevk() takes at least 2 non-keyword positional arguments (1 given)
 zabdevk () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> ok zabdevk aa bb dd ee () {}
 zabdevk (1, 2) {} -> ok zabdevk 1 2 d e () {}
 zabdevk (1, 2) {'a': 'aa'} -> zabdevk() got multiple values for keyword argument 'a'

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_global
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_global	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,5 +0,0 @@
-test_global
-got SyntaxError as expected
-got SyntaxError as expected
-got SyntaxError as expected
-as expected, no SyntaxError

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_grammar
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_grammar	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,69 +0,0 @@
-test_grammar
-1. Parser
-1.1 Tokens
-1.1.1 Backslashes
-1.1.2 Numeric literals
-1.1.2.1 Plain integers
-1.1.2.2 Long integers
-1.1.2.3 Floating point
-1.1.3 String literals
-1.2 Grammar
-single_input
-file_input
-expr_input
-eval_input
-funcdef
-lambdef
-simple_stmt
-expr_stmt
-print_stmt
-1 2 3
-1 2 3
-1 1 1
-extended print_stmt
-1 2 3
-1 2 3
-1 1 1
-hello world
-del_stmt
-pass_stmt
-flow_stmt
-break_stmt
-continue_stmt
-continue + try/except ok
-continue + try/finally ok
-testing continue and break in try/except in loop
-return_stmt
-yield_stmt
-raise_stmt
-import_name
-import_from
-global_stmt
-exec_stmt
-assert_stmt
-if_stmt
-while_stmt
-for_stmt
-try_stmt
-suite
-test
-comparison
-binary mask ops
-shift ops
-additive ops
-multiplicative ops
-unary ops
-selectors
-
-[1, (1,), (1, 2), (1, 2, 3)]
-atoms
-classdef
-['Apple', 'Banana', 'Coco  nut']
-[3, 6, 9, 12, 15]
-[3, 4, 5]
-[(1, 'Apple'), (1, 'Banana'), (1, 'Coconut'), (2, 'Apple'), (2, 'Banana'), (2, 'Coconut'), (3, 'Apple'), (3, 'Banana'), (3, 'Coconut'), (4, 'Apple'), (4, 'Banana'), (4, 'Coconut'), (5, 'Apple'), (5, 'Banana'), (5, 'Coconut')]
-[(1, 'Banana'), (1, 'Coconut'), (2, 'Banana'), (2, 'Coconut'), (3, 'Banana'), (3, 'Coconut'), (4, 'Banana'), (4, 'Coconut'), (5, 'Banana'), (5, 'Coconut')]
-[[1], [1, 1], [1, 2, 4], [1, 3, 9, 27], [1, 4, 16, 64, 256]]
-[False, False, False]
-[[1, 2], [3, 4], [5, 6]]
-[('Boeing', 'Airliner'), ('Boeing', 'Engine'), ('Ford', 'Engine'), ('Macdonalds', 'Cheeseburger')]

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_httplib
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_httplib	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,13 +0,0 @@
-test_httplib
-reply: 'HTTP/1.1 200 Ok\r\n'
-Text
-reply: 'HTTP/1.1 400.100 Not Ok\r\n'
-BadStatusLine raised as expected
-InvalidURL raised as expected
-InvalidURL raised as expected
-reply: 'HTTP/1.1 200 OK\r\n'
-header: Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"
-header: Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"
-reply: 'HTTP/1.1 200 OK\r\n'
-header: Content-Length: 14432
-

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_math
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_math	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,28 +0,0 @@
-test_math
-math module, testing with eps 1e-05
-constants
-acos
-asin
-atan
-atan2
-ceil
-cos
-cosh
-degrees
-exp
-fabs
-floor
-fmod
-frexp
-hypot
-ldexp
-log
-log10
-modf
-pow
-radians
-sin
-sinh
-sqrt
-tan
-tanh

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_mmap
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_mmap	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,38 +0,0 @@
-test_mmap
-<type 'mmap.mmap'>
-  Position of foo: 1.0 pages
-  Length of file: 2.0 pages
-  Contents of byte 0: '\x00'
-  Contents of first 3 bytes: '\x00\x00\x00'
-
-  Modifying file's content...
-  Contents of byte 0: '3'
-  Contents of first 3 bytes: '3\x00\x00'
-  Contents of second page: '\x00foobar\x00'
-  Regex match on mmap (page start, length of match): 1.0 6
-  Seek to zeroth byte
-  Seek to 42nd byte
-  Seek to last byte
-  Try to seek to negative position...
-  Try to seek beyond end of mmap...
-  Try to seek to negative position...
-  Attempting resize()
-  Creating 10 byte test data file.
-  Opening mmap with access=ACCESS_READ
-  Ensuring that readonly mmap can't be slice assigned.
-  Ensuring that readonly mmap can't be item assigned.
-  Ensuring that readonly mmap can't be write() to.
-  Ensuring that readonly mmap can't be write_byte() to.
-  Ensuring that readonly mmap can't be resized.
-  Opening mmap with size too big
-  Opening mmap with access=ACCESS_WRITE
-  Modifying write-through memory map.
-  Opening mmap with access=ACCESS_COPY
-  Modifying copy-on-write memory map.
-  Ensuring copy-on-write maps cannot be resized.
-  Ensuring invalid access parameter raises exception.
-  Try opening a bad file descriptor...
-  Ensuring that passing 0 as map length sets map size to current file size.
-  Ensuring that passing 0 as map length sets map size to current file size.
-  anonymous mmap.mmap(-1, PAGESIZE)...
- Test passed

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_nis
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_nis	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,2 +0,0 @@
-test_nis
-nis.maps()

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_opcodes
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_opcodes	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,6 +0,0 @@
-test_opcodes
-2. Opcodes
-XXX Not yet fully implemented
-2.1 try inside for loop
-2.2 raise class exceptions
-2.3 comparing function objects

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_openpty
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_openpty	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,2 +0,0 @@
-test_openpty
-Ping!

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_poll
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_poll	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,19 +0,0 @@
-test_poll
-Running poll test 1
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
- This is a test.
-Poll test 1 complete
-Running poll test 2
-Poll test 2 complete
-Running poll test 3
-Poll test 3 complete

Modified: python/branches/p3yk-noslice/Lib/test/output/test_profile
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/output/test_profile	(original)
+++ python/branches/p3yk-noslice/Lib/test/output/test_profile	Fri Dec 15 05:21:50 2006
@@ -1,11 +1,12 @@
 test_profile
-         127 function calls (107 primitive calls) in 1.000 CPU seconds
+         128 function calls (108 primitive calls) in 1.000 CPU seconds
 
    Ordered by: standard name
 
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
         4    0.000    0.000    0.000    0.000 :0(append)
         4    0.000    0.000    0.000    0.000 :0(exc_info)
+        1    0.000    0.000    1.000    1.000 :0(exec)
        12    0.000    0.000    0.012    0.001 :0(hasattr)
         8    0.000    0.000    0.000    0.000 :0(range)
         1    0.000    0.000    0.000    0.000 :0(setprofile)
@@ -28,13 +29,14 @@
 Function                              called...
 :0(append)                            ->
 :0(exc_info)                          ->
+:0(exec)                              -> <string>:1(<module>)(1)    1.000
 :0(hasattr)                           -> test_profile.py:115(__getattr__)(12)    0.028
 :0(range)                             ->
 :0(setprofile)                        ->
 <string>:1(<module>)                  -> test_profile.py:30(testfunc)(1)    1.000
 profile:0(profiler)                   -> profile:0(testfunc())(1)    1.000
-profile:0(testfunc())                 -> :0(setprofile)(1)    0.000
-                                         <string>:1(<module>)(1)    1.000
+profile:0(testfunc())                 -> :0(exec)(1)    1.000
+                                         :0(setprofile)(1)    0.000
 test_profile.py:103(subhelper)        -> :0(range)(8)    0.000
                                          test_profile.py:115(__getattr__)(16)    0.028
 test_profile.py:115(__getattr__)      ->
@@ -60,11 +62,12 @@
 Function                              was called by...
 :0(append)                            <- test_profile.py:78(helper1)(4)    0.120
 :0(exc_info)                          <- test_profile.py:78(helper1)(4)    0.120
+:0(exec)                              <- profile:0(testfunc())(1)    1.000
 :0(hasattr)                           <- test_profile.py:78(helper1)(4)    0.120
                                          test_profile.py:93(helper2)(8)    0.400
 :0(range)                             <- test_profile.py:103(subhelper)(8)    0.080
 :0(setprofile)                        <- profile:0(testfunc())(1)    1.000
-<string>:1(<module>)                  <- profile:0(testfunc())(1)    1.000
+<string>:1(<module>)                  <- :0(exec)(1)    1.000
 profile:0(profiler)                   <-
 profile:0(testfunc())                 <- profile:0(profiler)(1)    0.000
 test_profile.py:103(subhelper)        <- test_profile.py:93(helper2)(8)    0.400

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_regex
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_regex	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,29 +0,0 @@
-test_regex
-no match: -1
-successful search: 6
-caught expected exception
-failed awk syntax: -1
-successful awk syntax: 2
-failed awk syntax: -1
-matching with group names and compile()
--1
-caught expected exception
-matching with group names and symcomp()
-7
-801 999
-801
-('801', '999')
-('801', '999')
-realpat: \([0-9]+\) *\([0-9]+\)
-groupindex: {'one': 1, 'two': 2}
-not case folded search: -1
-case folded search: 6
-__members__: ['last', 'regs', 'translate', 'groupindex', 'realpat', 'givenpat']
-regs: ((6, 11), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1), (-1, -1))
-last: HELLO WORLD
-translate: 256
-givenpat: world
-match with pos: -1
-search with pos: 18
-bogus group: ('world', None, None)
-no name: caught expected exception

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_scope
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_scope	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,24 +0,0 @@
-test_scope
-1. simple nesting
-2. extra nesting
-3. simple nesting + rebinding
-4. nesting with global but no free
-5. nesting through class
-6. nesting plus free ref to global
-7. nearest enclosing scope
-8. mixed freevars and cellvars
-9. free variable in method
-10. recursion
-11. unoptimized namespaces
-12. lambdas
-13. UnboundLocal
-14. complex definitions
-15. scope of global statements
-16. check leaks
-17. class and global
-18. verify that locals() works
-19. var is bound and free in class
-20. interaction with trace function
-20. eval and exec with free variables
-21. list comprehension with local variables
-22. eval with free variables

Modified: python/branches/p3yk-noslice/Lib/test/output/test_tokenize
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/output/test_tokenize	(original)
+++ python/branches/p3yk-noslice/Lib/test/output/test_tokenize	Fri Dec 15 05:21:50 2006
@@ -1,15 +1,23 @@
 test_tokenize
-1,0-1,35:	COMMENT	"# Tests for the 'tokenize' module.\n"
-2,0-2,43:	COMMENT	'# Large bits stolen from test_grammar.py. \n'
+1,0-1,34:	COMMENT	"# Tests for the 'tokenize' module."
+1,34-1,35:	NL	'\n'
+2,0-2,42:	COMMENT	'# Large bits stolen from test_grammar.py. '
+2,42-2,43:	NL	'\n'
 3,0-3,1:	NL	'\n'
-4,0-4,11:	COMMENT	'# Comments\n'
+4,0-4,10:	COMMENT	'# Comments'
+4,10-4,11:	NL	'\n'
 5,0-5,3:	STRING	'"#"'
 5,3-5,4:	NEWLINE	'\n'
-6,0-6,3:	COMMENT	"#'\n"
-7,0-7,3:	COMMENT	'#"\n'
-8,0-8,3:	COMMENT	'#\\\n'
-9,7-9,9:	COMMENT	'#\n'
-10,4-10,10:	COMMENT	'# abc\n'
+6,0-6,2:	COMMENT	"#'"
+6,2-6,3:	NL	'\n'
+7,0-7,2:	COMMENT	'#"'
+7,2-7,3:	NL	'\n'
+8,0-8,2:	COMMENT	'#\\'
+8,2-8,3:	NL	'\n'
+9,7-9,8:	COMMENT	'#'
+9,8-9,9:	NL	'\n'
+10,4-10,9:	COMMENT	'# abc'
+10,9-10,10:	NL	'\n'
 11,0-12,4:	STRING	"'''#\n#'''"
 12,4-12,5:	NEWLINE	'\n'
 13,0-13,1:	NL	'\n'
@@ -19,7 +27,8 @@
 14,7-14,8:	COMMENT	'#'
 14,8-14,9:	NEWLINE	'\n'
 15,0-15,1:	NL	'\n'
-16,0-16,25:	COMMENT	'# Balancing continuation\n'
+16,0-16,24:	COMMENT	'# Balancing continuation'
+16,24-16,25:	NL	'\n'
 17,0-17,1:	NL	'\n'
 18,0-18,1:	NAME	'a'
 18,2-18,3:	OP	'='
@@ -63,18 +72,19 @@
 24,4-24,5:	OP	'('
 24,5-24,8:	NAME	'len'
 24,8-24,9:	OP	'('
-24,9-24,10:	OP	'`'
-24,10-24,11:	NAME	'y'
-24,11-24,12:	OP	'`'
-24,12-24,13:	OP	')'
-24,14-24,15:	OP	'+'
-24,16-24,17:	NUMBER	'5'
-24,17-24,18:	OP	'*'
-24,18-24,19:	NAME	'x'
-24,20-24,21:	OP	'-'
-24,22-24,23:	NAME	'a'
-24,23-24,24:	OP	'['
-24,24-24,25:	NL	'\n'
+24,9-24,13:	NAME	'repr'
+24,13-24,14:	OP	'('
+24,14-24,15:	NAME	'y'
+24,15-24,16:	OP	')'
+24,16-24,17:	OP	')'
+24,18-24,19:	OP	'+'
+24,20-24,21:	NUMBER	'5'
+24,21-24,22:	OP	'*'
+24,22-24,23:	NAME	'x'
+24,24-24,25:	OP	'-'
+24,26-24,27:	NAME	'a'
+24,27-24,28:	OP	'['
+24,28-24,29:	NL	'\n'
 25,3-25,4:	NUMBER	'3'
 25,5-25,6:	OP	']'
 25,6-25,7:	NL	'\n'
@@ -92,7 +102,8 @@
 29,2-29,3:	OP	')'
 29,3-29,4:	NEWLINE	'\n'
 30,0-30,1:	NL	'\n'
-31,0-31,37:	COMMENT	'# Backslash means line continuation:\n'
+31,0-31,36:	COMMENT	'# Backslash means line continuation:'
+31,36-31,37:	NL	'\n'
 32,0-32,1:	NAME	'x'
 32,2-32,3:	OP	'='
 32,4-32,5:	NUMBER	'1'
@@ -100,19 +111,21 @@
 33,2-33,3:	NUMBER	'1'
 33,3-33,4:	NEWLINE	'\n'
 34,0-34,1:	NL	'\n'
-35,0-35,55:	COMMENT	'# Backslash does not means continuation in comments :\\\n'
+35,0-35,54:	COMMENT	'# Backslash does not means continuation in comments :\\'
+35,54-35,55:	NL	'\n'
 36,0-36,1:	NAME	'x'
 36,2-36,3:	OP	'='
 36,4-36,5:	NUMBER	'0'
 36,5-36,6:	NEWLINE	'\n'
 37,0-37,1:	NL	'\n'
-38,0-38,20:	COMMENT	'# Ordinary integers\n'
+38,0-38,19:	COMMENT	'# Ordinary integers'
+38,19-38,20:	NL	'\n'
 39,0-39,4:	NUMBER	'0xff'
-39,5-39,7:	OP	'<>'
+39,5-39,7:	OP	'!='
 39,8-39,11:	NUMBER	'255'
 39,11-39,12:	NEWLINE	'\n'
 40,0-40,4:	NUMBER	'0377'
-40,5-40,7:	OP	'<>'
+40,5-40,7:	OP	'!='
 40,8-40,11:	NUMBER	'255'
 40,11-40,12:	NEWLINE	'\n'
 41,0-41,10:	NUMBER	'2147483647'
@@ -137,7 +150,8 @@
 44,15-44,16:	NUMBER	'1'
 44,16-44,17:	NEWLINE	'\n'
 45,0-45,1:	NL	'\n'
-46,0-46,16:	COMMENT	'# Long integers\n'
+46,0-46,15:	COMMENT	'# Long integers'
+46,15-46,16:	NL	'\n'
 47,0-47,1:	NAME	'x'
 47,2-47,3:	OP	'='
 47,4-47,6:	NUMBER	'0L'
@@ -171,7 +185,8 @@
 54,4-54,35:	NUMBER	'123456789012345678901234567890l'
 54,35-54,36:	NEWLINE	'\n'
 55,0-55,1:	NL	'\n'
-56,0-56,25:	COMMENT	'# Floating-point numbers\n'
+56,0-56,24:	COMMENT	'# Floating-point numbers'
+56,24-56,25:	NL	'\n'
 57,0-57,1:	NAME	'x'
 57,2-57,3:	OP	'='
 57,4-57,8:	NUMBER	'3.14'
@@ -184,7 +199,8 @@
 59,2-59,3:	OP	'='
 59,4-59,9:	NUMBER	'0.314'
 59,9-59,10:	NEWLINE	'\n'
-60,0-60,18:	COMMENT	'# XXX x = 000.314\n'
+60,0-60,17:	COMMENT	'# XXX x = 000.314'
+60,17-60,18:	NL	'\n'
 61,0-61,1:	NAME	'x'
 61,2-61,3:	OP	'='
 61,4-61,8:	NUMBER	'.314'
@@ -218,7 +234,8 @@
 68,4-68,9:	NUMBER	'3.1e4'
 68,9-68,10:	NEWLINE	'\n'
 69,0-69,1:	NL	'\n'
-70,0-70,18:	COMMENT	'# String literals\n'
+70,0-70,17:	COMMENT	'# String literals'
+70,17-70,18:	NL	'\n'
 71,0-71,1:	NAME	'x'
 71,2-71,3:	OP	'='
 71,4-71,6:	STRING	"''"
@@ -366,7 +383,8 @@
 125,6-126,3:	STRING	"uR'''spam\n'''"
 126,3-126,4:	NEWLINE	'\n'
 127,0-127,1:	NL	'\n'
-128,0-128,14:	COMMENT	'# Indentation\n'
+128,0-128,13:	COMMENT	'# Indentation'
+128,13-128,14:	NL	'\n'
 129,0-129,2:	NAME	'if'
 129,3-129,4:	NUMBER	'1'
 129,4-129,5:	OP	':'
@@ -438,7 +456,8 @@
 142,14-142,15:	NUMBER	'2'
 142,15-142,16:	NEWLINE	'\n'
 143,0-143,1:	NL	'\n'
-144,0-144,12:	COMMENT	'# Operators\n'
+144,0-144,11:	COMMENT	'# Operators'
+144,11-144,12:	NL	'\n'
 145,0-145,1:	NL	'\n'
 146,0-146,0:	DEDENT	''
 146,0-146,0:	DEDENT	''
@@ -484,7 +503,7 @@
 149,2-149,3:	OP	','
 149,4-149,5:	NAME	'y'
 149,5-149,6:	OP	')'
-149,7-149,9:	OP	'<>'
+149,7-149,9:	OP	'!='
 149,10-149,11:	OP	'('
 149,11-149,12:	OP	'{'
 149,12-149,15:	STRING	"'a'"
@@ -500,7 +519,8 @@
 149,27-149,28:	OP	')'
 149,28-149,29:	NEWLINE	'\n'
 150,0-150,1:	NL	'\n'
-151,0-151,13:	COMMENT	'# comparison\n'
+151,0-151,12:	COMMENT	'# comparison'
+151,12-151,13:	NL	'\n'
 152,0-152,2:	NAME	'if'
 152,3-152,4:	NUMBER	'1'
 152,5-152,6:	OP	'<'
@@ -513,7 +533,7 @@
 152,21-152,22:	NUMBER	'1'
 152,23-152,25:	OP	'<='
 152,26-152,27:	NUMBER	'1'
-152,28-152,30:	OP	'<>'
+152,28-152,30:	OP	'!='
 152,31-152,32:	NUMBER	'1'
 152,33-152,35:	OP	'!='
 152,36-152,37:	NUMBER	'1'
@@ -531,7 +551,8 @@
 152,67-152,71:	NAME	'pass'
 152,71-152,72:	NEWLINE	'\n'
 153,0-153,1:	NL	'\n'
-154,0-154,9:	COMMENT	'# binary\n'
+154,0-154,8:	COMMENT	'# binary'
+154,8-154,9:	NL	'\n'
 155,0-155,1:	NAME	'x'
 155,2-155,3:	OP	'='
 155,4-155,5:	NUMBER	'1'
@@ -551,7 +572,8 @@
 157,8-157,9:	NUMBER	'1'
 157,9-157,10:	NEWLINE	'\n'
 158,0-158,1:	NL	'\n'
-159,0-159,8:	COMMENT	'# shift\n'
+159,0-159,7:	COMMENT	'# shift'
+159,7-159,8:	NL	'\n'
 160,0-160,1:	NAME	'x'
 160,2-160,3:	OP	'='
 160,4-160,5:	NUMBER	'1'
@@ -561,7 +583,8 @@
 160,14-160,15:	NUMBER	'1'
 160,15-160,16:	NEWLINE	'\n'
 161,0-161,1:	NL	'\n'
-162,0-162,11:	COMMENT	'# additive\n'
+162,0-162,10:	COMMENT	'# additive'
+162,10-162,11:	NL	'\n'
 163,0-163,1:	NAME	'x'
 163,2-163,3:	OP	'='
 163,4-163,5:	NUMBER	'1'
@@ -575,7 +598,8 @@
 163,20-163,21:	NUMBER	'1'
 163,21-163,22:	NEWLINE	'\n'
 164,0-164,1:	NL	'\n'
-165,0-165,17:	COMMENT	'# multiplicative\n'
+165,0-165,16:	COMMENT	'# multiplicative'
+165,16-165,17:	NL	'\n'
 166,0-166,1:	NAME	'x'
 166,2-166,3:	OP	'='
 166,4-166,5:	NUMBER	'1'
@@ -587,7 +611,8 @@
 166,16-166,17:	NUMBER	'1'
 166,17-166,18:	NEWLINE	'\n'
 167,0-167,1:	NL	'\n'
-168,0-168,8:	COMMENT	'# unary\n'
+168,0-168,7:	COMMENT	'# unary'
+168,7-168,8:	NL	'\n'
 169,0-169,1:	NAME	'x'
 169,2-169,3:	OP	'='
 169,4-169,5:	OP	'~'
@@ -625,7 +650,8 @@
 170,24-170,25:	NUMBER	'1'
 170,25-170,26:	NEWLINE	'\n'
 171,0-171,1:	NL	'\n'
-172,0-172,11:	COMMENT	'# selector\n'
+172,0-172,10:	COMMENT	'# selector'
+172,10-172,11:	NL	'\n'
 173,0-173,6:	NAME	'import'
 173,7-173,10:	NAME	'sys'
 173,10-173,11:	OP	','

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_types
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_types	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,15 +0,0 @@
-test_types
-6. Built-in types
-6.1 Truth value testing
-6.2 Boolean operations
-6.3 Comparisons
-6.4 Numeric types (mostly conversions)
-6.4.1 32-bit integers
-6.4.2 Long integers
-6.4.3 Floating point numbers
-6.5 Sequence types
-6.5.1 Strings
-6.5.2 Tuples [see test_tuple.py]
-6.5.3 Lists [see test_list.py]
-6.6 Mappings == Dictionaries [see test_dict.py]
-Buffers

Deleted: /python/branches/p3yk-noslice/Lib/test/output/test_xdrlib
==============================================================================
--- /python/branches/p3yk-noslice/Lib/test/output/test_xdrlib	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,19 +0,0 @@
-test_xdrlib
-pack test 0 succeeded
-pack test 1 succeeded
-pack test 2 succeeded
-pack test 3 succeeded
-pack test 4 succeeded
-pack test 5 succeeded
-pack test 6 succeeded
-pack test 7 succeeded
-pack test 8 succeeded
-unpack test 0 succeeded : 9
-unpack test 1 succeeded : True
-unpack test 2 succeeded : False
-unpack test 3 succeeded : 45
-unpack test 4 succeeded : 1.89999997616
-unpack test 5 succeeded : 1.9
-unpack test 6 succeeded : hello world
-unpack test 7 succeeded : [0, 1, 2, 3, 4]
-unpack test 8 succeeded : ['what', 'is', 'hapnin', 'doctor']

Modified: python/branches/p3yk-noslice/Lib/test/outstanding_bugs.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/outstanding_bugs.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/outstanding_bugs.py	Fri Dec 15 05:21:50 2006
@@ -9,19 +9,14 @@
 import unittest
 from test import test_support
 
-class TestBug1385040(unittest.TestCase):
-    def testSyntaxError(self):
-        import compiler
-
-        # The following snippet gives a SyntaxError in the interpreter
-        #
-        # If you compile and exec it, the call foo(7) returns (7, 1)
-        self.assertRaises(SyntaxError, compiler.compile,
-                          "def foo(a=1, b): return a, b\n\n", "<string>", "exec")
+#
+# No test cases for outstanding bugs at the moment.
+#
 
 
 def test_main():
-    test_support.run_unittest(TestBug1385040)
+    #test_support.run_unittest()
+    pass
 
 if __name__ == "__main__":
     test_main()

Modified: python/branches/p3yk-noslice/Lib/test/pickletester.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/pickletester.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/pickletester.py	Fri Dec 15 05:21:50 2006
@@ -65,8 +65,8 @@
             copy_reg.add_extension(pair[0], pair[1], code)
 
 class C:
-    def __cmp__(self, other):
-        return cmp(self.__dict__, other.__dict__)
+    def __eq__(self, other):
+        return self.__dict__ == other.__dict__
 
 import __main__
 __main__.C = C

Modified: python/branches/p3yk-noslice/Lib/test/string_tests.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/string_tests.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/string_tests.py	Fri Dec 15 05:21:50 2006
@@ -1055,7 +1055,7 @@
         # from raymond's original specification
         S = 'http://www.python.org'
         self.checkequal(('http', '://', 'www.python.org'), S, 'rpartition', '://')
-        self.checkequal(('http://www.python.org', '', ''), S, 'rpartition', '?')
+        self.checkequal(('', '', 'http://www.python.org'), S, 'rpartition', '?')
         self.checkequal(('', 'http://', 'www.python.org'), S, 'rpartition', 'http://')
         self.checkequal(('http://www.python.', 'org', ''), S, 'rpartition', 'org')
 

Modified: python/branches/p3yk-noslice/Lib/test/test_MimeWriter.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_MimeWriter.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_MimeWriter.py	Fri Dec 15 05:21:50 2006
@@ -7,6 +7,8 @@
 
 """
 
+import unittest, sys, StringIO
+from test.test_support import run_unittest
 
 from MimeWriter import MimeWriter
 
@@ -77,94 +79,213 @@
         ]
 
 
-def main():
-    import sys
+OUTPUT = '''\
+From: bwarsaw at cnri.reston.va.us
+Date: Mon Feb 12 17:21:48 EST 1996
+To: kss-submit at cnri.reston.va.us
+MIME-Version: 1.0
+Content-Type: multipart/knowbot;
+    boundary="801spam999";
+    version="0.1"
+
+This is a multi-part message in MIME format.
+
+--801spam999
+Content-Type: multipart/knowbot-metadata;
+    boundary="802spam999"
+
+
+--802spam999
+Content-Type: message/rfc822
+KP-Metadata-Type: simple
+KP-Access: read-only
+
+KPMD-Interpreter: python
+KPMD-Interpreter-Version: 1.3
+KPMD-Owner-Name: Barry Warsaw
+KPMD-Owner-Rendezvous: bwarsaw at cnri.reston.va.us
+KPMD-Home-KSS: kss.cnri.reston.va.us
+KPMD-Identifier: hdl://cnri.kss/my_first_knowbot
+KPMD-Launch-Date: Mon Feb 12 16:39:03 EST 1996
+
+--802spam999
+Content-Type: text/isl
+KP-Metadata-Type: complex
+KP-Metadata-Key: connection
+KP-Access: read-only
+KP-Connection-Description: Barry's Big Bass Business
+KP-Connection-Id: B4
+KP-Connection-Direction: client
 
-    # Toplevel headers
+INTERFACE Seller-1;
+
+TYPE Seller = OBJECT
+    DOCUMENTATION "A simple Seller interface to test ILU"
+    METHODS
+            price():INTEGER,
+    END;
+
+--802spam999
+Content-Type: message/external-body;
+    access-type="URL";
+    URL="hdl://cnri.kss/generic-knowbot"
+
+Content-Type: text/isl
+KP-Metadata-Type: complex
+KP-Metadata-Key: generic-interface
+KP-Access: read-only
+KP-Connection-Description: Generic Interface for All Knowbots
+KP-Connection-Id: generic-kp
+KP-Connection-Direction: client
+
+
+--802spam999--
+
+--801spam999
+Content-Type: multipart/knowbot-code;
+    boundary="803spam999"
+
+
+--803spam999
+Content-Type: text/plain
+KP-Module-Name: BuyerKP
+
+class Buyer:
+    def __setup__(self, maxprice):
+        self._maxprice = maxprice
+
+    def __main__(self, kos):
+        """Entry point upon arrival at a new KOS."""
+        broker = kos.broker()
+        # B4 == Barry's Big Bass Business :-)
+        seller = broker.lookup('Seller_1.Seller', 'B4')
+        if seller:
+            price = seller.price()
+            print 'Seller wants $', price, '... '
+            if price > self._maxprice:
+                print 'too much!'
+            else:
+                print "I'll take it!"
+        else:
+            print 'no seller found here'
+
+--803spam999--
+
+--801spam999
+Content-Type: multipart/knowbot-state;
+    boundary="804spam999"
+KP-Main-Module: main
+
+
+--804spam999
+Content-Type: text/plain
+KP-Module-Name: main
+
+# instantiate a buyer instance and put it in a magic place for the KOS
+# to find.
+__kp__ = Buyer()
+__kp__.__setup__(500)
+
+--804spam999--
+
+--801spam999--
+'''
+
+class MimewriterTest(unittest.TestCase):
+
+    def test(self):
+        buf = StringIO.StringIO()
+
+        # Toplevel headers
+
+        toplevel = MimeWriter(buf)
+        toplevel.addheader("From", "bwarsaw at cnri.reston.va.us")
+        toplevel.addheader("Date", "Mon Feb 12 17:21:48 EST 1996")
+        toplevel.addheader("To", "kss-submit at cnri.reston.va.us")
+        toplevel.addheader("MIME-Version", "1.0")
 
-    toplevel = MimeWriter(sys.stdout)
-    toplevel.addheader("From", "bwarsaw at cnri.reston.va.us")
-    toplevel.addheader("Date", "Mon Feb 12 17:21:48 EST 1996")
-    toplevel.addheader("To", "kss-submit at cnri.reston.va.us")
-    toplevel.addheader("MIME-Version", "1.0")
+        # Toplevel body parts
 
-    # Toplevel body parts
+        f = toplevel.startmultipartbody("knowbot", "801spam999",
+                                        [("version", "0.1")], prefix=0)
+        f.write("This is a multi-part message in MIME format.\n")
 
-    f = toplevel.startmultipartbody("knowbot", "801spam999",
-                                    [("version", "0.1")], prefix=0)
-    f.write("This is a multi-part message in MIME format.\n")
+        # First toplevel body part: metadata
 
-    # First toplevel body part: metadata
+        md = toplevel.nextpart()
+        md.startmultipartbody("knowbot-metadata", "802spam999")
 
-    md = toplevel.nextpart()
-    md.startmultipartbody("knowbot-metadata", "802spam999")
+        # Metadata part 1
 
-    # Metadata part 1
+        md1 = md.nextpart()
+        md1.addheader("KP-Metadata-Type", "simple")
+        md1.addheader("KP-Access", "read-only")
+        m = MimeWriter(md1.startbody("message/rfc822"))
+        for key, value in SIMPLE_METADATA:
+            m.addheader("KPMD-" + key, value)
+        m.flushheaders()
+        del md1
 
-    md1 = md.nextpart()
-    md1.addheader("KP-Metadata-Type", "simple")
-    md1.addheader("KP-Access", "read-only")
-    m = MimeWriter(md1.startbody("message/rfc822"))
-    for key, value in SIMPLE_METADATA:
-        m.addheader("KPMD-" + key, value)
-    m.flushheaders()
-    del md1
+        # Metadata part 2
 
-    # Metadata part 2
+        md2 = md.nextpart()
+        for key, value in COMPLEX_METADATA:
+            md2.addheader("KP-" + key, value)
+        f = md2.startbody("text/isl")
+        f.write(SELLER)
+        del md2
 
-    md2 = md.nextpart()
-    for key, value in COMPLEX_METADATA:
-        md2.addheader("KP-" + key, value)
-    f = md2.startbody("text/isl")
-    f.write(SELLER)
-    del md2
+        # Metadata part 3
 
-    # Metadata part 3
+        md3 = md.nextpart()
+        f = md3.startbody("message/external-body",
+                          [("access-type", "URL"),
+                           ("URL", "hdl://cnri.kss/generic-knowbot")])
+        m = MimeWriter(f)
+        for key, value in EXTERNAL_METADATA:
+            md3.addheader("KP-" + key, value)
+        md3.startbody("text/isl")
+        # Phantom body doesn't need to be written
 
-    md3 = md.nextpart()
-    f = md3.startbody("message/external-body",
-                      [("access-type", "URL"),
-                       ("URL", "hdl://cnri.kss/generic-knowbot")])
-    m = MimeWriter(f)
-    for key, value in EXTERNAL_METADATA:
-        md3.addheader("KP-" + key, value)
-    md3.startbody("text/isl")
-    # Phantom body doesn't need to be written
+        md.lastpart()
 
-    md.lastpart()
+        # Second toplevel body part: code
 
-    # Second toplevel body part: code
+        code = toplevel.nextpart()
+        code.startmultipartbody("knowbot-code", "803spam999")
 
-    code = toplevel.nextpart()
-    code.startmultipartbody("knowbot-code", "803spam999")
+        # Code: buyer program source
 
-    # Code: buyer program source
+        buyer = code.nextpart()
+        buyer.addheader("KP-Module-Name", "BuyerKP")
+        f = buyer.startbody("text/plain")
+        f.write(BUYER)
 
-    buyer = code.nextpart()
-    buyer.addheader("KP-Module-Name", "BuyerKP")
-    f = buyer.startbody("text/plain")
-    f.write(BUYER)
+        code.lastpart()
 
-    code.lastpart()
+        # Third toplevel body part: state
 
-    # Third toplevel body part: state
+        state = toplevel.nextpart()
+        state.addheader("KP-Main-Module", "main")
+        state.startmultipartbody("knowbot-state", "804spam999")
 
-    state = toplevel.nextpart()
-    state.addheader("KP-Main-Module", "main")
-    state.startmultipartbody("knowbot-state", "804spam999")
+        # State: a bunch of assignments
 
-    # State: a bunch of assignments
+        st = state.nextpart()
+        st.addheader("KP-Module-Name", "main")
+        f = st.startbody("text/plain")
+        f.write(STATE)
 
-    st = state.nextpart()
-    st.addheader("KP-Module-Name", "main")
-    f = st.startbody("text/plain")
-    f.write(STATE)
+        state.lastpart()
 
-    state.lastpart()
+        # End toplevel body parts
 
-    # End toplevel body parts
+        toplevel.lastpart()
 
-    toplevel.lastpart()
+        self.assertEqual(buf.getvalue(), OUTPUT)
 
+def test_main():
+    run_unittest(MimewriterTest)
 
-main()
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_StringIO.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_StringIO.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_StringIO.py	Fri Dec 15 05:21:50 2006
@@ -62,6 +62,7 @@
         eq(f.getvalue(), 'abcde')
         f.write('xyz')
         eq(f.getvalue(), 'abcdexyz')
+        self.assertRaises(IOError, f.truncate, -1)
         f.close()
         self.assertRaises(ValueError, f.write, 'frobnitz')
 
@@ -120,6 +121,28 @@
 class TestcStringIO(TestGenericStringIO):
     MODULE = cStringIO
 
+    def test_unicode(self):
+
+        if not test_support.have_unicode: return
+
+        # The cStringIO module converts Unicode strings to character
+        # strings when writing them to cStringIO objects.
+        # Check that this works.
+
+        f = self.MODULE.StringIO()
+        f.write(unicode(self._line[:5]))
+        s = f.getvalue()
+        self.assertEqual(s, 'abcde')
+        self.assertEqual(type(s), types.StringType)
+
+        f = self.MODULE.StringIO(unicode(self._line[:5]))
+        s = f.getvalue()
+        self.assertEqual(s, 'abcde')
+        self.assertEqual(type(s), types.StringType)
+
+        self.assertRaises(UnicodeEncodeError, self.MODULE.StringIO,
+                          unicode('\xf4', 'latin-1'))
+
 import sys
 if sys.platform.startswith('java'):
     # Jython doesn't have a buffer object, so we just do a useless

Modified: python/branches/p3yk-noslice/Lib/test/test___all__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test___all__.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test___all__.py	Fri Dec 15 05:21:50 2006
@@ -15,7 +15,7 @@
     def check_all(self, modname):
         names = {}
         try:
-            exec "import %s" % modname in names
+            exec("import %s" % modname, names)
         except ImportError:
             # Silent fail here seems the best route since some modules
             # may not be available in all environments.
@@ -23,7 +23,7 @@
         verify(hasattr(sys.modules[modname], "__all__"),
                "%s has no __all__ attribute" % modname)
         names = {}
-        exec "from %s import *" % modname in names
+        exec("from %s import *" % modname, names)
         if "__builtins__" in names:
             del names["__builtins__"]
         keys = set(names)

Modified: python/branches/p3yk-noslice/Lib/test/test___future__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test___future__.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test___future__.py	Fri Dec 15 05:21:50 2006
@@ -1,59 +1,63 @@
 #! /usr/bin/env python
-from test.test_support import verbose, verify
-from types import TupleType, StringType, IntType
+import unittest
+from test import test_support
 import __future__
 
 GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
 
 features = __future__.all_feature_names
 
-# Verify that all_feature_names appears correct.
-given_feature_names = features[:]
-for name in dir(__future__):
-    obj = getattr(__future__, name, None)
-    if obj is not None and isinstance(obj, __future__._Feature):
-        verify(name in given_feature_names,
-               "%r should have been in all_feature_names" % name)
-        given_feature_names.remove(name)
-verify(len(given_feature_names) == 0,
-       "all_feature_names has too much: %r" % given_feature_names)
-del given_feature_names
-
-for feature in features:
-    value = getattr(__future__, feature)
-    if verbose:
-        print "Checking __future__ ", feature, "value", value
-
-    optional = value.getOptionalRelease()
-    mandatory = value.getMandatoryRelease()
-
-    verify(type(optional) is TupleType, "optional isn't tuple")
-    verify(len(optional) == 5, "optional isn't 5-tuple")
-    major, minor, micro, level, serial = optional
-    verify(type(major) is IntType, "optional major isn't int")
-    verify(type(minor) is IntType, "optional minor isn't int")
-    verify(type(micro) is IntType, "optional micro isn't int")
-    verify(isinstance(level, basestring), "optional level isn't string")
-    verify(level in GOOD_SERIALS,
-           "optional level string has unknown value")
-    verify(type(serial) is IntType, "optional serial isn't int")
-
-    verify(type(mandatory) is TupleType or
-           mandatory is None, "mandatory isn't tuple or None")
-    if mandatory is not None:
-        verify(len(mandatory) == 5, "mandatory isn't 5-tuple")
-        major, minor, micro, level, serial = mandatory
-        verify(type(major) is IntType, "mandatory major isn't int")
-        verify(type(minor) is IntType, "mandatory minor isn't int")
-        verify(type(micro) is IntType, "mandatory micro isn't int")
-        verify(isinstance(level, basestring), "mandatory level isn't string")
-        verify(level in GOOD_SERIALS,
-               "mandatory serial string has unknown value")
-        verify(type(serial) is IntType, "mandatory serial isn't int")
-        verify(optional < mandatory,
-               "optional not less than mandatory, and mandatory not None")
-
-    verify(hasattr(value, "compiler_flag"),
-           "feature is missing a .compiler_flag attr")
-    verify(type(getattr(value, "compiler_flag")) is IntType,
-           ".compiler_flag isn't int")
+class FutureTest(unittest.TestCase):
+
+    def test_names(self):
+        # Verify that all_feature_names appears correct.
+        given_feature_names = features[:]
+        for name in dir(__future__):
+            obj = getattr(__future__, name, None)
+            if obj is not None and isinstance(obj, __future__._Feature):
+                self.assert_(
+                    name in given_feature_names,
+                    "%r should have been in all_feature_names" % name
+                )
+                given_feature_names.remove(name)
+        self.assertEqual(len(given_feature_names), 0,
+               "all_feature_names has too much: %r" % given_feature_names)
+
+    def test_attributes(self):
+        for feature in features:
+            value = getattr(__future__, feature)
+
+            optional = value.getOptionalRelease()
+            mandatory = value.getMandatoryRelease()
+
+            a = self.assert_
+            e = self.assertEqual
+            def check(t, name):
+                a(isinstance(t, tuple), "%s isn't tuple" % name)
+                e(len(t), 5, "%s isn't 5-tuple" % name)
+                (major, minor, micro, level, serial) = t
+                a(isinstance(major, int), "%s major isn't int"  % name)
+                a(isinstance(minor, int), "%s minor isn't int" % name)
+                a(isinstance(micro, int), "%s micro isn't int" % name)
+                a(isinstance(level, basestring),
+                    "%s level isn't string" % name)
+                a(level in GOOD_SERIALS,
+                       "%s level string has unknown value" % name)
+                a(isinstance(serial, int), "%s serial isn't int" % name)
+
+            check(optional, "optional")
+            if mandatory is not None:
+                check(mandatory, "mandatory")
+                a(optional < mandatory,
+                       "optional not less than mandatory, and mandatory not None")
+
+            a(hasattr(value, "compiler_flag"),
+                   "feature is missing a .compiler_flag attr")
+            a(isinstance(getattr(value, "compiler_flag"), int),
+                   ".compiler_flag isn't int")
+
+def test_main():
+    test_support.run_unittest(FutureTest)
+
+if __name__ == "__main__":
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_array.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_array.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_array.py	Fri Dec 15 05:21:50 2006
@@ -85,6 +85,13 @@
         self.assertNotEqual(id(a), id(b))
         self.assertEqual(a, b)
 
+    def test_deepcopy(self):
+        import copy
+        a = array.array(self.typecode, self.example)
+        b = copy.deepcopy(a)
+        self.assertNotEqual(id(a), id(b))
+        self.assertEqual(a, b)
+
     def test_pickle(self):
         for protocol in (0, 1, 2):
             a = array.array(self.typecode, self.example)

Modified: python/branches/p3yk-noslice/Lib/test/test_ast.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_ast.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_ast.py	Fri Dec 15 05:21:50 2006
@@ -50,8 +50,6 @@
     "import sys",
     # ImportFrom
     "from sys import v",
-    # Exec
-    "exec 'v'",
     # Global
     "global v",
     # Expr
@@ -94,8 +92,6 @@
   "1 < 2 < 3",
   # Call
   "f(1,2,c=3,*d,**e)",
-  # Repr
-  "`v`",
   # Num
   "10L",
   # Str
@@ -155,9 +151,9 @@
 
 #### EVERYTHING BELOW IS GENERATED #####
 exec_results = [
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, []), [('Pass', (1, 9))], [])]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], None, [], []), [('Pass', (1, 9))], [])]),
 ('Module', [('ClassDef', (1, 0), 'C', [], [('Pass', (1, 8))])]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, []), [('Return', (1, 8), ('Num', (1, 15), 1))], [])]),
+('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))]),
 ('Module', [('AugAssign', (1, 0), ('Name', (1, 0), 'v', ('Store',)), ('Add',), ('Num', (1, 5), 1))]),
@@ -171,7 +167,6 @@
 ('Module', [('Assert', (1, 0), ('Name', (1, 7), 'v', ('Load',)), None)]),
 ('Module', [('Import', (1, 0), [('alias', 'sys', None)])]),
 ('Module', [('ImportFrom', (1, 0), 'sys', [('alias', 'v', None)], 0)]),
-('Module', [('Exec', (1, 0), ('Str', (1, 5), 'v'), None, None)]),
 ('Module', [('Global', (1, 0), ['v'])]),
 ('Module', [('Expr', (1, 0), ('Num', (1, 0), 1))]),
 ('Module', [('Pass', (1, 0))]),
@@ -185,13 +180,12 @@
 ('Expression', ('BoolOp', (1, 0), ('And',), [('Name', (1, 0), 'a', ('Load',)), ('Name', (1, 6), 'b', ('Load',))])),
 ('Expression', ('BinOp', (1, 0), ('Name', (1, 0), 'a', ('Load',)), ('Add',), ('Name', (1, 4), 'b', ('Load',)))),
 ('Expression', ('UnaryOp', (1, 0), ('Not',), ('Name', (1, 4), 'v', ('Load',)))),
-('Expression', ('Lambda', (1, 0), ('arguments', [], None, None, []), ('Name', (1, 7), 'None', ('Load',)))),
+('Expression', ('Lambda', (1, 0), ('arguments', [], None, [], None, [], []), ('Name', (1, 7), 'None', ('Load',)))),
 ('Expression', ('Dict', (1, 0), [('Num', (1, 2), 1)], [('Num', (1, 4), 2)])),
 ('Expression', ('ListComp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))])])),
 ('Expression', ('GeneratorExp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))])])),
 ('Expression', ('Compare', (1, 0), ('Num', (1, 0), 1), [('Lt',), ('Lt',)], [('Num', (1, 4), 2), ('Num', (1, 8), 3)])),
 ('Expression', ('Call', (1, 0), ('Name', (1, 0), 'f', ('Load',)), [('Num', (1, 2), 1), ('Num', (1, 4), 2)], [('keyword', 'c', ('Num', (1, 8), 3))], ('Name', (1, 11), 'd', ('Load',)), ('Name', (1, 15), 'e', ('Load',)))),
-('Expression', ('Repr', (1, 0), ('Name', (1, 1), 'v', ('Load',)))),
 ('Expression', ('Num', (1, 0), 10L)),
 ('Expression', ('Str', (1, 0), 'string')),
 ('Expression', ('Attribute', (1, 0), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',))),

Modified: python/branches/p3yk-noslice/Lib/test/test_binascii.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_binascii.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_binascii.py	Fri Dec 15 05:21:50 2006
@@ -134,7 +134,7 @@
             pass
         else:
             self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError")
-        self.assertEqual(binascii.a2b_qp("= "), "")
+        self.assertEqual(binascii.a2b_qp("= "), "= ")
         self.assertEqual(binascii.a2b_qp("=="), "=")
         self.assertEqual(binascii.a2b_qp("=AX"), "=AX")
         self.assertRaises(TypeError, binascii.b2a_qp, foo="bar")

Modified: python/branches/p3yk-noslice/Lib/test/test_binop.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_binop.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_binop.py	Fri Dec 15 05:21:50 2006
@@ -302,7 +302,7 @@
         self.assertEqual(10.0, Rat(10))
 
     def test_future_div(self):
-        exec future_test
+        exec(future_test)
 
     # XXX Ran out of steam; TO DO: divmod, div, future division
 

Modified: python/branches/p3yk-noslice/Lib/test/test_bisect.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_bisect.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_bisect.py	Fri Dec 15 05:21:50 2006
@@ -174,8 +174,13 @@
 
 class CmpErr:
     "Dummy element that always raises an error during comparison"
-    def __cmp__(self, other):
+    def __lt__(self, other):
         raise ZeroDivisionError
+    __gt__ = __lt__
+    __le__ = __lt__
+    __ge__ = __lt__
+    __eq__ = __lt__
+    __ne__ = __lt__
 
 class TestErrorHandling(unittest.TestCase):
 

Modified: python/branches/p3yk-noslice/Lib/test/test_bool.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_bool.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_bool.py	Fri Dec 15 05:21:50 2006
@@ -246,7 +246,7 @@
 
     def test_fileclosed(self):
         try:
-            f = file(test_support.TESTFN, "w")
+            f = open(test_support.TESTFN, "w")
             self.assertIs(f.closed, False)
             f.close()
             self.assertIs(f.closed, True)
@@ -335,24 +335,51 @@
 
     def test_convert_to_bool(self):
         # Verify that TypeError occurs when bad things are returned
-        # from __nonzero__().  This isn't really a bool test, but
+        # from __bool__().  This isn't really a bool test, but
         # it's related.
         check = lambda o: self.assertRaises(TypeError, bool, o)
         class Foo(object):
-            def __nonzero__(self):
+            def __bool__(self):
                 return self
         check(Foo())
 
         class Bar(object):
-            def __nonzero__(self):
+            def __bool__(self):
                 return "Yes"
         check(Bar())
 
         class Baz(int):
-            def __nonzero__(self):
+            def __bool__(self):
                 return self
         check(Baz())
 
+        # __bool__() must return a bool not an int
+        class Spam(int):
+            def __bool__(self):
+                return 1
+        check(Spam())
+
+        class Eggs:
+            def __len__(self):
+                return -1
+        self.assertRaises(ValueError, bool, Eggs())
+
+    def test_sane_len(self):
+        # this test just tests our assumptions about __len__
+        # this will start failing if __len__ changes assertions
+        for badval in ['illegal', -1, 1 << 32]:
+            class A:
+                def __len__(self):
+                    return badval
+            try:
+                bool(A())
+            except (Exception), e_bool:
+                pass
+            try:
+                len(A())
+            except (Exception), e_len:
+                pass
+            self.assertEqual(str(e_bool), str(e_len))
 
 def test_main():
     test_support.run_unittest(BoolTest)

Modified: python/branches/p3yk-noslice/Lib/test/test_bsddb3.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_bsddb3.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_bsddb3.py	Fri Dec 15 05:21:50 2006
@@ -8,7 +8,7 @@
 
 # When running as a script instead of within the regrtest framework, skip the
 # requires test, since it's obvious we want to run them.
-if __name__ <> '__main__':
+if __name__ != '__main__':
     requires('bsddb')
 
 verbose = False

Modified: python/branches/p3yk-noslice/Lib/test/test_bufio.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_bufio.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_bufio.py	Fri Dec 15 05:21:50 2006
@@ -1,60 +1,66 @@
-from test.test_support import verify, TestFailed, TESTFN
+import unittest
+from test import test_support
 
 # Simple test to ensure that optimizations in fileobject.c deliver
 # the expected results.  For best testing, run this under a debug-build
 # Python too (to exercise asserts in the C code).
 
-# Repeat string 'pattern' as often as needed to reach total length
-# 'length'.  Then call try_one with that string, a string one larger
-# than that, and a string one smaller than that.  The main driver
-# feeds this all small sizes and various powers of 2, so we exercise
-# all likely stdio buffer sizes, and "off by one" errors on both
-# sides.
-def drive_one(pattern, length):
-    q, r = divmod(length, len(pattern))
-    teststring = pattern * q + pattern[:r]
-    verify(len(teststring) == length)
-    try_one(teststring)
-    try_one(teststring + "x")
-    try_one(teststring[:-1])
-
-# Write s + "\n" + s to file, then open it and ensure that successive
-# .readline()s deliver what we wrote.
-def try_one(s):
-    # Since C doesn't guarantee we can write/read arbitrary bytes in text
-    # files, use binary mode.
-    f = open(TESTFN, "wb")
-    # write once with \n and once without
-    f.write(s)
-    f.write("\n")
-    f.write(s)
-    f.close()
-    f = open(TESTFN, "rb")
-    line = f.readline()
-    if line != s + "\n":
-        raise TestFailed("Expected %r got %r" % (s + "\n", line))
-    line = f.readline()
-    if line != s:
-        raise TestFailed("Expected %r got %r" % (s, line))
-    line = f.readline()
-    if line:
-        raise TestFailed("Expected EOF but got %r" % line)
-    f.close()
-
-# A pattern with prime length, to avoid simple relationships with
-# stdio buffer sizes.
-primepat = "1234567890\00\01\02\03\04\05\06"
-
-nullpat = "\0" * 1000
-
-try:
-    for size in range(1, 257) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
-                      16384, 32768, 65536, 1000000]:
-        drive_one(primepat, size)
-        drive_one(nullpat, size)
-finally:
-    try:
-        import os
-        os.unlink(TESTFN)
-    except:
-        pass
+lengths = range(1, 257) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
+                           16384, 32768, 65536, 1000000]
+
+class BufferSizeTest(unittest.TestCase):
+    def try_one(self, s):
+        # Write s + "\n" + s to file, then open it and ensure that successive
+        # .readline()s deliver what we wrote.
+
+        # Since C doesn't guarantee we can write/read arbitrary bytes in text
+        # files, use binary mode.
+        f = open(test_support.TESTFN, "wb")
+        try:
+            # write once with \n and once without
+            f.write(s)
+            f.write("\n")
+            f.write(s)
+            f.close()
+            f = open(test_support.TESTFN, "rb")
+            line = f.readline()
+            self.assertEqual(line, s + "\n")
+            line = f.readline()
+            self.assertEqual(line, s)
+            line = f.readline()
+            self.assert_(not line) # Must be at EOF
+            f.close()
+        finally:
+            try:
+                import os
+                os.unlink(test_support.TESTFN)
+            except:
+                pass
+
+    def drive_one(self, pattern):
+        for length in lengths:
+            # Repeat string 'pattern' as often as needed to reach total length
+            # 'length'.  Then call try_one with that string, a string one larger
+            # than that, and a string one smaller than that.  Try this with all
+            # small sizes and various powers of 2, so we exercise all likely
+            # stdio buffer sizes, and "off by one" errors on both sides.
+            q, r = divmod(length, len(pattern))
+            teststring = pattern * q + pattern[:r]
+            self.assertEqual(len(teststring), length)
+            self.try_one(teststring)
+            self.try_one(teststring + "x")
+            self.try_one(teststring[:-1])
+
+    def test_primepat(self):
+        # A pattern with prime length, to avoid simple relationships with
+        # stdio buffer sizes.
+        self.drive_one("1234567890\00\01\02\03\04\05\06")
+
+    def test_nullpat(self):
+        self.drive_one("\0" * 1000)
+
+def test_main():
+    test_support.run_unittest(BufferSizeTest)
+
+if __name__ == "__main__":
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_builtin.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_builtin.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_builtin.py	Fri Dec 15 05:21:50 2006
@@ -94,7 +94,7 @@
 ]
 
 class TestFailingBool:
-    def __nonzero__(self):
+    def __bool__(self):
         raise RuntimeError
 
 class TestFailingIter:
@@ -116,6 +116,7 @@
         self.assertEqual(abs(0), 0)
         self.assertEqual(abs(1234), 1234)
         self.assertEqual(abs(-1234), 1234)
+        self.assertTrue(abs(-sys.maxint-1) > 0)
         # float
         self.assertEqual(abs(0.0), 0.0)
         self.assertEqual(abs(3.14), 3.14)
@@ -155,6 +156,11 @@
         S = [10, 20, 30]
         self.assertEqual(any(x > 42 for x in S), False)
 
+    def test_neg(self):
+        x = -sys.maxint-1
+        self.assert_(isinstance(x, int))
+        self.assertEqual(-x, sys.maxint+1)
+
     def test_callable(self):
         self.assert_(callable(len))
         def f(): pass
@@ -179,7 +185,8 @@
         self.assertRaises(ValueError, chr, 256)
         self.assertRaises(TypeError, chr)
 
-    def test_cmp(self):
+    def XXX_test_cmp(self):
+        # cmp() is no longer supported
         self.assertEqual(cmp(-1, 1), -1)
         self.assertEqual(cmp(1, -1), 1)
         self.assertEqual(cmp(1, 1), 0)
@@ -397,6 +404,29 @@
         self.assertRaises(IOError, execfile, os.curdir)
         self.assertRaises(IOError, execfile, "I_dont_exist")
 
+    def test_exec(self):
+        g = {}
+        exec('z = 1', g)
+        if '__builtins__' in g:
+            del g['__builtins__']
+        self.assertEqual(g, {'z': 1})
+
+        exec(u'z = 1+1', g)
+        if '__builtins__' in g:
+            del g['__builtins__']
+        self.assertEqual(g, {'z': 2})
+        g = {}
+        l = {}
+
+        import warnings
+        warnings.filterwarnings("ignore", "global statement", module="<string>")
+        exec('global a; a = 1; b = 2', g, l)
+        if '__builtins__' in g:
+            del g['__builtins__']
+        if '__builtins__' in l:
+            del l['__builtins__']
+        self.assertEqual((g, l), ({'a': 1}, {'b': 2}))
+
     def test_filter(self):
         self.assertEqual(filter(lambda c: 'a' <= c <= 'z', 'Hello World'), 'elloorld')
         self.assertEqual(filter(None, [1, 'hello', [], [3], '', None, 9, 0]), [1, 'hello', [3], 9])
@@ -665,9 +695,11 @@
                         pass
 
         s = repr(-1-sys.maxint)
-        self.assertEqual(int(s)+1, -sys.maxint)
+        x = int(s)
+        self.assertEqual(x+1, -sys.maxint)
+        self.assert_(isinstance(x, int))
         # should return long
-        int(s[1:])
+        self.assertEqual(int(s[1:]), sys.maxint+1)
 
         # should return long
         x = int(1e100)
@@ -685,6 +717,11 @@
         self.assertRaises(ValueError, int, '123\0')
         self.assertRaises(ValueError, int, '53', 40)
 
+        # SF bug 1545497: embedded NULs were not detected with
+        # explicit base
+        self.assertRaises(ValueError, int, '123\0', 10)
+        self.assertRaises(ValueError, int, '123\x00 245', 20)
+
         x = int('1' * 600)
         self.assert_(isinstance(x, long))
 
@@ -1135,8 +1172,14 @@
             map(None, Squares(3), Squares(2)),
             [(0,0), (1,1), (4,None)]
         )
+        def Max(a, b):
+            if a is None:
+                return b
+            if b is None:
+                return a
+            return max(a, b)
         self.assertEqual(
-            map(max, Squares(3), Squares(2)),
+            map(Max, Squares(3), Squares(2)),
             [0, 1, 4]
         )
         self.assertRaises(TypeError, map)
@@ -1168,7 +1211,7 @@
             "max(1, 2, key=1)",             # keyfunc is not callable
             ):
             try:
-                exec(stmt) in globals()
+                exec(stmt, globals())
             except TypeError:
                 pass
             else:
@@ -1204,7 +1247,7 @@
         class BadNumber:
             def __cmp__(self, other):
                 raise ValueError
-        self.assertRaises(ValueError, min, (42, BadNumber()))
+        self.assertRaises(TypeError, min, (42, BadNumber()))
 
         for stmt in (
             "min(key=int)",                 # no args
@@ -1214,7 +1257,7 @@
             "min(1, 2, key=1)",             # keyfunc is not callable
             ):
             try:
-                exec(stmt) in globals()
+                exec(stmt, globals())
             except TypeError:
                 pass
             else:
@@ -1382,8 +1425,11 @@
         self.assertRaises(ValueError, range, a, a + 1, long(0))
 
         class badzero(int):
-            def __cmp__(self, other):
+            def __eq__(self, other):
                 raise RuntimeError
+            __ne__ = __lt__ = __gt__ = __le__ = __ge__ = __eq__
+
+        # XXX This won't (but should!) raise RuntimeError if a is an int...
         self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
 
         # Reject floats when it would require PyLongs to represent.
@@ -1547,18 +1593,18 @@
         a = (1, 2, 3)
         b = (4, 5, 6)
         t = [(1, 4), (2, 5), (3, 6)]
-        self.assertEqual(zip(a, b), t)
+        self.assertEqual(list(zip(a, b)), t)
         b = [4, 5, 6]
-        self.assertEqual(zip(a, b), t)
+        self.assertEqual(list(zip(a, b)), t)
         b = (4, 5, 6, 7)
-        self.assertEqual(zip(a, b), t)
+        self.assertEqual(list(zip(a, b)), t)
         class I:
             def __getitem__(self, i):
                 if i < 0 or i > 2: raise IndexError
                 return i + 4
-        self.assertEqual(zip(a, I()), t)
-        self.assertEqual(zip(), [])
-        self.assertEqual(zip(*[]), [])
+        self.assertEqual(list(zip(a, I())), t)
+        self.assertEqual(list(zip()), [])
+        self.assertEqual(list(zip(*[])), [])
         self.assertRaises(TypeError, zip, None)
         class G:
             pass
@@ -1574,7 +1620,7 @@
                 else:
                     return i
         self.assertEqual(
-            zip(SequenceWithoutALength(), xrange(2**30)),
+            list(zip(SequenceWithoutALength(), xrange(2**30))),
             list(enumerate(range(5)))
         )
 
@@ -1584,7 +1630,7 @@
                     raise ValueError
                 else:
                     return i
-        self.assertRaises(ValueError, zip, BadSeq(), BadSeq())
+        self.assertRaises(ValueError, list, zip(BadSeq(), BadSeq()))
 
 class TestSorted(unittest.TestCase):
 
@@ -1597,7 +1643,7 @@
 
         data.reverse()
         random.shuffle(copy)
-        self.assertEqual(data, sorted(copy, cmp=lambda x, y: cmp(y,x)))
+        self.assertEqual(data, sorted(copy, cmp=lambda x, y: (x < y) - (x > y)))
         self.assertNotEqual(data, copy)
         random.shuffle(copy)
         self.assertEqual(data, sorted(copy, key=lambda x: -x))

Modified: python/branches/p3yk-noslice/Lib/test/test_bytes.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_bytes.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_bytes.py	Fri Dec 15 05:21:50 2006
@@ -245,6 +245,9 @@
 
         b[3:5] = [3, 4, 5, 6]
         self.assertEqual(b, bytes(range(10)))
+        
+        b[3:0] = [42, 42, 42]
+        self.assertEqual(b, bytes([0, 1, 2, 42, 42, 42, 3, 4, 5, 6, 7, 8, 9]))
 
     def test_extended_set_del_slice(self):
         indices = (None, 1, 5, 11, 19, 100, -1, -2, -5, -11, -19, -100)

Modified: python/branches/p3yk-noslice/Lib/test/test_bz2.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_bz2.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_bz2.py	Fri Dec 15 05:21:50 2006
@@ -243,7 +243,7 @@
         self.createTempFile()
         bz2f = BZ2File(self.filename, "U")
         bz2f.close()
-        f = file(self.filename)
+        f = open(self.filename)
         f.seek(0, 2)
         self.assertEqual(f.tell(), len(self.DATA))
         f.close()

Modified: python/branches/p3yk-noslice/Lib/test/test_calendar.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_calendar.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_calendar.py	Fri Dec 15 05:21:50 2006
@@ -212,7 +212,7 @@
         self.assertEqual(calendar.isleap(2003), 0)
 
     def test_setfirstweekday(self):
-        self.assertRaises(ValueError, calendar.setfirstweekday, 'flabber')
+        self.assertRaises(TypeError, calendar.setfirstweekday, 'flabber')
         self.assertRaises(ValueError, calendar.setfirstweekday, -1)
         self.assertRaises(ValueError, calendar.setfirstweekday, 200)
         orig = calendar.firstweekday()

Modified: python/branches/p3yk-noslice/Lib/test/test_cfgparser.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_cfgparser.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_cfgparser.py	Fri Dec 15 05:21:50 2006
@@ -1,9 +1,29 @@
 import ConfigParser
 import StringIO
 import unittest
+import UserDict
 
 from test import test_support
 
+class SortedDict(UserDict.UserDict):
+    def items(self):
+        result = self.data.items()
+        result.sort()
+        return result
+
+    def keys(self):
+        result = self.data.keys()
+        result.sort()
+        return result
+    
+    def values(self):
+        result = self.items()
+        return [i[1] for i in values]
+
+    def iteritems(self): return iter(self.items())
+    def iterkeys(self): return iter(self.keys())
+    __iter__ = iterkeys
+    def itervalues(self): return iter(self.values())
 
 class TestCaseBase(unittest.TestCase):
     def newconfig(self, defaults=None):
@@ -414,12 +434,36 @@
         self.assertRaises(TypeError, cf.set, "sect", "option2", 1.0)
         self.assertRaises(TypeError, cf.set, "sect", "option2", object())
 
+class SortedTestCase(RawConfigParserTestCase):
+    def newconfig(self, defaults=None):
+        self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)
+        return self.cf
+
+    def test_sorted(self):
+        self.fromstring("[b]\n"
+                        "o4=1\n"
+                        "o3=2\n"
+                        "o2=3\n"
+                        "o1=4\n"
+                        "[a]\n"
+                        "k=v\n")        
+        output = StringIO.StringIO()
+        self.cf.write(output)
+        self.assertEquals(output.getvalue(),
+                          "[a]\n"
+                          "k = v\n\n"       
+                          "[b]\n"
+                          "o1 = 4\n"
+                          "o2 = 3\n"
+                          "o3 = 2\n"
+                          "o4 = 1\n\n")
 
 def test_main():
     test_support.run_unittest(
         ConfigParserTestCase,
         RawConfigParserTestCase,
-        SafeConfigParserTestCase
+        SafeConfigParserTestCase,
+        SortedTestCase
     )
 
 if __name__ == "__main__":

Modified: python/branches/p3yk-noslice/Lib/test/test_cgi.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_cgi.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_cgi.py	Fri Dec 15 05:21:50 2006
@@ -1,8 +1,9 @@
-from test.test_support import verify, verbose
+from test.test_support import run_unittest
 import cgi
 import os
 import sys
 import tempfile
+import unittest
 from StringIO import StringIO
 
 class HackedSysModule:
@@ -25,13 +26,11 @@
     def __str__(self):
         return str(self.err)
 
-    def __cmp__(self, anExc):
+    def __eq__(self, anExc):
         if not isinstance(anExc, Exception):
-            return -1
-        x = cmp(self.err.__class__, anExc.__class__)
-        if x != 0:
-            return x
-        return cmp(self.err.args, anExc.args)
+            return NotImplemented
+        return (self.err.__class__ == anExc.__class__ and
+                self.err.args == anExc.args)
 
     def __getattr__(self, attr):
         return getattr(self.err, attr)
@@ -118,10 +117,10 @@
       })
     ]
 
-def norm(list):
-    if type(list) == type([]):
-        list.sort()
-    return list
+def norm(seq):
+    if isinstance(seq, list):
+        seq.sort(key=repr)
+    return seq
 
 def first_elts(list):
     return map(lambda x:x[0], list)
@@ -129,119 +128,124 @@
 def first_second_elts(list):
     return map(lambda p:(p[0], p[1][0]), list)
 
-def main():
-    for orig, expect in parse_qsl_test_cases:
-        result = cgi.parse_qsl(orig, keep_blank_values=True)
-        print repr(orig), '=>', result
-        verify(result == expect, "Error parsing %s" % repr(orig))
-
-    for orig, expect in parse_strict_test_cases:
-        # Test basic parsing
-        print repr(orig)
-        d = do_test(orig, "GET")
-        verify(d == expect, "Error parsing %s" % repr(orig))
-        d = do_test(orig, "POST")
-        verify(d == expect, "Error parsing %s" % repr(orig))
-
-        env = {'QUERY_STRING': orig}
-        fcd = cgi.FormContentDict(env)
-        sd = cgi.SvFormContentDict(env)
-        fs = cgi.FieldStorage(environ=env)
-        if type(expect) == type({}):
-            # test dict interface
-            verify(len(expect) == len(fcd))
-            verify(norm(expect.keys()) == norm(fcd.keys()))
-            verify(norm(expect.values()) == norm(fcd.values()))
-            verify(norm(expect.items()) == norm(fcd.items()))
-            verify(fcd.get("nonexistent field", "default") == "default")
-            verify(len(sd) == len(fs))
-            verify(norm(sd.keys()) == norm(fs.keys()))
-            verify(fs.getvalue("nonexistent field", "default") == "default")
-            # test individual fields
-            for key in expect.keys():
-                expect_val = expect[key]
-                verify(key in fcd)
-                verify(norm(fcd[key]) == norm(expect[key]))
-                verify(fcd.get(key, "default") == fcd[key])
-                verify(key in fs)
-                if len(expect_val) > 1:
-                    single_value = 0
-                else:
-                    single_value = 1
-                try:
-                    val = sd[key]
-                except IndexError:
-                    verify(not single_value)
-                    verify(fs.getvalue(key) == expect_val)
+class CgiTests(unittest.TestCase):
+
+    def test_qsl(self):
+        for orig, expect in parse_qsl_test_cases:
+            result = cgi.parse_qsl(orig, keep_blank_values=True)
+            self.assertEqual(result, expect, "Error parsing %s" % repr(orig))
+
+    def test_strict(self):
+        for orig, expect in parse_strict_test_cases:
+            # Test basic parsing
+            d = do_test(orig, "GET")
+            self.assertEqual(d, expect, "Error parsing %s" % repr(orig))
+            d = do_test(orig, "POST")
+            self.assertEqual(d, expect, "Error parsing %s" % repr(orig))
+
+            env = {'QUERY_STRING': orig}
+            fcd = cgi.FormContentDict(env)
+            sd = cgi.SvFormContentDict(env)
+            fs = cgi.FieldStorage(environ=env)
+            if type(expect) == type({}):
+                # test dict interface
+                self.assertEqual(len(expect), len(fcd))
+                self.assertEqual(norm(expect.keys()), norm(fcd.keys()))
+                self.assertEqual(norm(expect.values()), norm(fcd.values()))
+                self.assertEqual(norm(expect.items()), norm(fcd.items()))
+                self.assertEqual(fcd.get("nonexistent field", "default"), "default")
+                self.assertEqual(len(sd), len(fs))
+                self.assertEqual(norm(sd.keys()), norm(fs.keys()))
+                self.assertEqual(fs.getvalue("nonexistent field", "default"), "default")
+                # test individual fields
+                for key in expect.keys():
+                    expect_val = expect[key]
+                    self.assert_(key in fcd)
+                    self.assertEqual(norm(fcd[key]), norm(expect[key]))
+                    self.assertEqual(fcd.get(key, "default"), fcd[key])
+                    self.assert_(key in fs)
+                    if len(expect_val) > 1:
+                        single_value = 0
+                    else:
+                        single_value = 1
+                    try:
+                        val = sd[key]
+                    except IndexError:
+                        self.failIf(single_value)
+                        self.assertEqual(fs.getvalue(key), expect_val)
+                    else:
+                        self.assert_(single_value)
+                        self.assertEqual(val, expect_val[0])
+                        self.assertEqual(fs.getvalue(key), expect_val[0])
+                    self.assertEqual(norm(sd.getlist(key)), norm(expect_val))
+                    if single_value:
+                        self.assertEqual(norm(sd.values()),
+                               first_elts(norm(expect.values())))
+                        self.assertEqual(norm(sd.items()),
+                               first_second_elts(norm(expect.items())))
+
+    def test_weird_formcontentdict(self):
+        # Test the weird FormContentDict classes
+        env = {'QUERY_STRING': "x=1&y=2.0&z=2-3.%2b0&1=1abc"}
+        expect = {'x': 1, 'y': 2.0, 'z': '2-3.+0', '1': '1abc'}
+        d = cgi.InterpFormContentDict(env)
+        for k, v in expect.items():
+            self.assertEqual(d[k], v)
+        for k, v in d.items():
+            self.assertEqual(expect[k], v)
+        self.assertEqual(norm(expect.values()), norm(d.values()))
+
+    def test_log(self):
+        cgi.log("Testing")
+
+        cgi.logfp = StringIO()
+        cgi.initlog("%s", "Testing initlog 1")
+        cgi.log("%s", "Testing log 2")
+        self.assertEqual(cgi.logfp.getvalue(), "Testing initlog 1\nTesting log 2\n")
+        if os.path.exists("/dev/null"):
+            cgi.logfp = None
+            cgi.logfile = "/dev/null"
+            cgi.initlog("%s", "Testing log 3")
+            cgi.log("Testing log 4")
+
+    def test_fieldstorage_readline(self):
+        # FieldStorage uses readline, which has the capacity to read all
+        # contents of the input file into memory; we use readline's size argument
+        # to prevent that for files that do not contain any newlines in
+        # non-GET/HEAD requests
+        class TestReadlineFile:
+            def __init__(self, file):
+                self.file = file
+                self.numcalls = 0
+
+            def readline(self, size=None):
+                self.numcalls += 1
+                if size:
+                    return self.file.readline(size)
                 else:
-                    verify(single_value)
-                    verify(val == expect_val[0])
-                    verify(fs.getvalue(key) == expect_val[0])
-                verify(norm(sd.getlist(key)) == norm(expect_val))
-                if single_value:
-                    verify(norm(sd.values()) == \
-                           first_elts(norm(expect.values())))
-                    verify(norm(sd.items()) == \
-                           first_second_elts(norm(expect.items())))
-
-    # Test the weird FormContentDict classes
-    env = {'QUERY_STRING': "x=1&y=2.0&z=2-3.%2b0&1=1abc"}
-    expect = {'x': 1, 'y': 2.0, 'z': '2-3.+0', '1': '1abc'}
-    d = cgi.InterpFormContentDict(env)
-    for k, v in expect.items():
-        verify(d[k] == v)
-    for k, v in d.items():
-        verify(expect[k] == v)
-    verify(norm(expect.values()) == norm(d.values()))
-
-    print "Testing log"
-    cgi.log("Testing")
-    cgi.logfp = sys.stdout
-    cgi.initlog("%s", "Testing initlog 1")
-    cgi.log("%s", "Testing log 2")
-    if os.path.exists("/dev/null"):
-        cgi.logfp = None
-        cgi.logfile = "/dev/null"
-        cgi.initlog("%s", "Testing log 3")
-        cgi.log("Testing log 4")
-
-    print "Test FieldStorage methods that use readline"
-    # FieldStorage uses readline, which has the capacity to read all
-    # contents of the input file into memory; we use readline's size argument
-    # to prevent that for files that do not contain any newlines in
-    # non-GET/HEAD requests
-    class TestReadlineFile:
-        def __init__(self, file):
-            self.file = file
-            self.numcalls = 0
-
-        def readline(self, size=None):
-            self.numcalls += 1
-            if size:
-                return self.file.readline(size)
-            else:
-                return self.file.readline()
-
-        def __getattr__(self, name):
-            file = self.__dict__['file']
-            a = getattr(file, name)
-            if not isinstance(a, int):
-                setattr(self, name, a)
-            return a
-
-    f = TestReadlineFile(tempfile.TemporaryFile())
-    f.write('x' * 256 * 1024)
-    f.seek(0)
-    env = {'REQUEST_METHOD':'PUT'}
-    fs = cgi.FieldStorage(fp=f, environ=env)
-    # if we're not chunking properly, readline is only called twice
-    # (by read_binary); if we are chunking properly, it will be called 5 times
-    # as long as the chunksize is 1 << 16.
-    verify(f.numcalls > 2)
-
-    print "Test basic FieldStorage multipart parsing"
-    env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'}
-    postdata = """-----------------------------721837373350705526688164684
+                    return self.file.readline()
+
+            def __getattr__(self, name):
+                file = self.__dict__['file']
+                a = getattr(file, name)
+                if not isinstance(a, int):
+                    setattr(self, name, a)
+                return a
+
+        f = TestReadlineFile(tempfile.TemporaryFile())
+        f.write('x' * 256 * 1024)
+        f.seek(0)
+        env = {'REQUEST_METHOD':'PUT'}
+        fs = cgi.FieldStorage(fp=f, environ=env)
+        # if we're not chunking properly, readline is only called twice
+        # (by read_binary); if we are chunking properly, it will be called 5 times
+        # as long as the chunksize is 1 << 16.
+        self.assert_(f.numcalls > 2)
+
+    def test_fieldstorage_multipart(self):
+        #Test basic FieldStorage multipart parsing
+        env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'}
+        postdata = """-----------------------------721837373350705526688164684
 Content-Disposition: form-data; name="id"
 
 1234
@@ -261,15 +265,19 @@
  Add\x20
 -----------------------------721837373350705526688164684--
 """
-    fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env)
-    verify(len(fs.list) == 4)
-    expect = [{'name':'id', 'filename':None, 'value':'1234'},
-              {'name':'title', 'filename':None, 'value':''},
-              {'name':'file', 'filename':'test.txt','value':'Testing 123.\n'},
-              {'name':'submit', 'filename':None, 'value':' Add '}]
-    for x in range(len(fs.list)):
-        for k, exp in expect[x].items():
-            got = getattr(fs.list[x], k)
-            verify(got == exp)
+        fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env)
+        self.assertEquals(len(fs.list), 4)
+        expect = [{'name':'id', 'filename':None, 'value':'1234'},
+                  {'name':'title', 'filename':None, 'value':''},
+                  {'name':'file', 'filename':'test.txt','value':'Testing 123.\n'},
+                  {'name':'submit', 'filename':None, 'value':' Add '}]
+        for x in range(len(fs.list)):
+            for k, exp in expect[x].items():
+                got = getattr(fs.list[x], k)
+                self.assertEquals(got, exp)
+
+def test_main():
+    run_unittest(CgiTests)
 
-main()
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_class.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_class.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_class.py	Fri Dec 15 05:21:50 2006
@@ -100,6 +100,30 @@
         print "__cmp__:", args
         return 0
 
+    def __eq__(self, *args):
+        print "__eq__:", args
+        return True
+
+    def __ne__(self, *args):
+        print "__ne__:", args
+        return False
+
+    def __lt__(self, *args):
+        print "__lt__:", args
+        return False
+
+    def __le__(self, *args):
+        print "__le__:", args
+        return True
+
+    def __gt__(self, *args):
+        print "__gt__:", args
+        return False
+
+    def __ge__(self, *args):
+        print "__ge__:", args
+        return True
+
     def __del__(self, *args):
         print "__del__:", args
 
@@ -112,7 +136,7 @@
 
 d = {}
 for method in testmeths:
-    exec method_template % locals() in d
+    exec(method_template % locals(), d)
 for k in d:
     setattr(AllTests, k, d[k])
 del d, k
@@ -162,6 +186,14 @@
 
 # List/dict operations
 
+class Empty: pass
+
+try:
+    1 in Empty()
+    print 'failed, should have raised TypeError'
+except TypeError:
+    pass
+
 1 in testme
 
 testme[1]
@@ -220,12 +252,10 @@
 testme == 1
 testme < 1
 testme > 1
-testme <> 1
 testme != 1
 1 == testme
 1 < testme
 1 > testme
-1 <> testme
 1 != testme
 
 # This test has to be last (duh.)
@@ -269,7 +299,7 @@
     """Raise TestFailed if executing 'stmt' does not raise 'exception'
     """
     try:
-        exec stmt
+        exec(stmt)
     except exception:
         pass
     else:

Modified: python/branches/p3yk-noslice/Lib/test/test_code.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_code.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_code.py	Fri Dec 15 05:21:50 2006
@@ -9,6 +9,7 @@
 >>> dump(f.func_code)
 name: f
 argcount: 1
+kwonlyargcount: 0
 names: ()
 varnames: ('x', 'g')
 cellvars: ('x',)
@@ -20,6 +21,7 @@
 >>> dump(f(4).func_code)
 name: g
 argcount: 1
+kwonlyargcount: 0
 names: ()
 varnames: ('y',)
 cellvars: ()
@@ -34,9 +36,11 @@
 ...     c = a * b
 ...     return c
 ...
+
 >>> dump(h.func_code)
 name: h
 argcount: 2
+kwonlyargcount: 0
 names: ()
 varnames: ('x', 'y', 'a', 'b', 'c')
 cellvars: ()
@@ -53,6 +57,7 @@
 >>> dump(attrs.func_code)
 name: attrs
 argcount: 1
+kwonlyargcount: 0
 names: ('attr1', 'attr2', 'attr3')
 varnames: ('obj',)
 cellvars: ()
@@ -70,6 +75,7 @@
 >>> dump(optimize_away.func_code)
 name: optimize_away
 argcount: 0
+kwonlyargcount: 0
 names: ()
 varnames: ()
 cellvars: ()
@@ -78,6 +84,22 @@
 flags: 67
 consts: ("'doc string'", 'None')
 
+>>> def keywordonly_args(a,b,*,k1):
+...     return a,b,k1
+...
+
+>>> dump(keywordonly_args.func_code)
+name: keywordonly_args
+argcount: 2
+kwonlyargcount: 1
+names: ()
+varnames: ('a', 'b', 'k1')
+cellvars: ()
+freevars: ()
+nlocals: 3
+flags: 67
+consts: ('None',)
+
 """
 
 def consts(t):
@@ -91,8 +113,8 @@
 
 def dump(co):
     """Print out a text representation of a code object."""
-    for attr in ["name", "argcount", "names", "varnames", "cellvars",
-                 "freevars", "nlocals", "flags"]:
+    for attr in ["name", "argcount", "kwonlyargcount", "names", "varnames",
+                 "cellvars", "freevars", "nlocals", "flags"]:
         print "%s: %s" % (attr, getattr(co, "co_" + attr))
     print "consts:", tuple(consts(co.co_consts))
 

Modified: python/branches/p3yk-noslice/Lib/test/test_codecencodings_cn.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_codecencodings_cn.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_codecencodings_cn.py	Fri Dec 15 05:21:50 2006
@@ -32,6 +32,7 @@
         ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"),
         ("abc\x80\x80\xc1\xc4", "ignore",  u"abc\u804a"),
         ("\x83\x34\x83\x31", "strict", None),
+        (u"\u30fb", "strict", None),
     )
 
 class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase):
@@ -45,6 +46,7 @@
         ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"),
         ("abc\x80\x80\xc1\xc4", "ignore",  u"abc\u804a"),
         ("abc\x84\x39\x84\x39\xc1\xc4", "replace", u"abc\ufffd\u804a"),
+        (u"\u30fb", "strict", "\x819\xa79"),
     )
     has_iso10646 = True
 

Modified: python/branches/p3yk-noslice/Lib/test/test_codecs.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_codecs.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_codecs.py	Fri Dec 15 05:21:50 2006
@@ -425,6 +425,10 @@
             ]
         )
 
+    def test_bug1601501(self):
+        # SF bug #1601501: check that the codec works with a buffer
+        unicode("\xef\xbb\xbf", "utf-8-sig")
+
 class EscapeDecodeTest(unittest.TestCase):
     def test_empty(self):
         self.assertEquals(codecs.escape_decode(""), ("", 0))
@@ -910,6 +914,18 @@
         f = self.reader(self.stream)
         self.assertEquals(f.readlines(), [u'\ud55c\n', u'\uae00'])
 
+class EncodedFileTest(unittest.TestCase):
+
+    def test_basic(self):
+        f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80')
+        ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8')
+        self.assertEquals(ef.read(), '\\\xd5\n\x00\x00\xae')
+
+        f = StringIO.StringIO()
+        ef = codecs.EncodedFile(f, 'utf-8', 'latin1')
+        ef.write('\xc3\xbc')
+        self.assertEquals(f.getvalue(), '\xfc')
+
 class Str2StrTest(unittest.TestCase):
 
     def test_read(self):
@@ -1050,6 +1066,14 @@
     "punycode",
     "unicode_internal"
 ]
+broken_incremental_coders = broken_unicode_with_streams[:]
+
+# The following encodings only support "strict" mode
+only_strict_mode = [
+    "idna",
+    "zlib_codec",
+    "bz2_codec",
+]
 
 try:
     import bz2
@@ -1099,6 +1123,7 @@
                     decodedresult += reader.read()
                 self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
 
+            if encoding not in broken_incremental_coders:
                 # check incremental decoder/encoder (fetched via the Python
                 # and C API) and iterencode()/iterdecode()
                 try:
@@ -1139,6 +1164,24 @@
                     result = u"".join(codecs.iterdecode(codecs.iterencode(u"", encoding), encoding))
                     self.assertEqual(result, u"")
 
+                if encoding not in only_strict_mode:
+                    # check incremental decoder/encoder with errors argument
+                    try:
+                        encoder = codecs.getincrementalencoder(encoding)("ignore")
+                        cencoder = _testcapi.codec_incrementalencoder(encoding, "ignore")
+                    except LookupError: # no IncrementalEncoder
+                        pass
+                    else:
+                        encodedresult = "".join(encoder.encode(c) for c in s)
+                        decoder = codecs.getincrementaldecoder(encoding)("ignore")
+                        decodedresult = u"".join(decoder.decode(c) for c in encodedresult)
+                        self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
+
+                        encodedresult = "".join(cencoder.encode(c) for c in s)
+                        cdecoder = _testcapi.codec_incrementaldecoder(encoding, "ignore")
+                        decodedresult = u"".join(cdecoder.decode(c) for c in encodedresult)
+                        self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
+
     def test_seek(self):
         # all codecs should be able to encode these
         s = u"%s\n%s\n" % (100*u"abc123", 100*u"def456")
@@ -1214,6 +1257,19 @@
             (u"", len(allbytes))
         )
 
+class WithStmtTest(unittest.TestCase):
+    def test_encodedfile(self):
+        f = StringIO.StringIO("\xc3\xbc")
+        with codecs.EncodedFile(f, "latin-1", "utf-8") as ef:
+            self.assertEquals(ef.read(), "\xfc")
+
+    def test_streamreaderwriter(self):
+        f = StringIO.StringIO("\xc3\xbc")
+        info = codecs.lookup("utf-8")
+        with codecs.StreamReaderWriter(f, info.streamreader,
+                                       info.streamwriter, 'strict') as srw:
+            self.assertEquals(srw.read(), u"\xfc")
+
 
 def test_main():
     test_support.run_unittest(
@@ -1234,10 +1290,12 @@
         IDNACodecTest,
         CodecsModuleTest,
         StreamReaderTest,
+        EncodedFileTest,
         Str2StrTest,
         BasicUnicodeTest,
         BasicStrTest,
-        CharmapTest
+        CharmapTest,
+        WithStmtTest,
     )
 
 

Modified: python/branches/p3yk-noslice/Lib/test/test_codeop.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_codeop.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_codeop.py	Fri Dec 15 05:21:50 2006
@@ -29,8 +29,8 @@
                 saved_stdout = sys.stdout
                 sys.stdout = cStringIO.StringIO()
                 try:
-                    exec code in d
-                    exec compile(str,"<input>","single") in r
+                    exec(code, d)
+                    exec(compile(str,"<input>","single"), r)
                 finally:
                     sys.stdout = saved_stdout
             elif symbol == 'eval':

Modified: python/branches/p3yk-noslice/Lib/test/test_compare.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_compare.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_compare.py	Fri Dec 15 05:21:50 2006
@@ -13,8 +13,8 @@
     def __repr__(self):
         return '<Cmp %s>' % self.arg
 
-    def __cmp__(self, other):
-        return cmp(self.arg, other)
+    def __eq__(self, other):
+        return self.arg == other
 
 class ComparisonTest(unittest.TestCase):
     set1 = [2, 2.0, 2L, 2+0j, Cmp(2.0)]
@@ -36,7 +36,7 @@
             L.insert(len(L)//2, Empty())
         for a in L:
             for b in L:
-                self.assertEqual(cmp(a, b), cmp(id(a), id(b)),
+                self.assertEqual(a == b, id(a) == id(b),
                                  'a=%r, b=%r' % (a, b))
 
 def test_main():

Modified: python/branches/p3yk-noslice/Lib/test/test_compile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_compile.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_compile.py	Fri Dec 15 05:21:50 2006
@@ -19,17 +19,17 @@
         self.assertRaises(SyntaxError, eval, 'lambda a,a=1:0')
         self.assertRaises(SyntaxError, eval, 'lambda a=1,a=1:0')
         try:
-            exec 'def f(a, a): pass'
+            exec('def f(a, a): pass')
             self.fail("duplicate arguments")
         except SyntaxError:
             pass
         try:
-            exec 'def f(a = 0, a = 1): pass'
+            exec('def f(a = 0, a = 1): pass')
             self.fail("duplicate keyword arguments")
         except SyntaxError:
             pass
         try:
-            exec 'def f(a): global a; a = 1'
+            exec('def f(a): global a; a = 1')
             self.fail("variable is global and local")
         except SyntaxError:
             pass
@@ -39,7 +39,7 @@
 
     def test_duplicate_global_local(self):
         try:
-            exec 'def f(a): global a; a = 1'
+            exec('def f(a): global a; a = 1')
             self.fail("variable is global and local")
         except SyntaxError:
             pass
@@ -59,22 +59,22 @@
 
         m = M()
         g = globals()
-        exec 'z = a' in g, m
+        exec('z = a', g, m)
         self.assertEqual(m.results, ('z', 12))
         try:
-            exec 'z = b' in g, m
+            exec('z = b', g, m)
         except NameError:
             pass
         else:
             self.fail('Did not detect a KeyError')
-        exec 'z = dir()' in g, m
+        exec('z = dir()', g, m)
         self.assertEqual(m.results, ('z', list('xyz')))
-        exec 'z = globals()' in g, m
+        exec('z = globals()', g, m)
         self.assertEqual(m.results, ('z', g))
-        exec 'z = locals()' in g, m
+        exec('z = locals()', g, m)
         self.assertEqual(m.results, ('z', m))
         try:
-            exec 'z = b' in m
+            exec('z = b', m)
         except TypeError:
             pass
         else:
@@ -85,7 +85,7 @@
             pass
         m = A()
         try:
-            exec 'z = a' in g, m
+            exec('z = a', g, m)
         except TypeError:
             pass
         else:
@@ -98,11 +98,12 @@
                     return 12
                 return dict.__getitem__(self, key)
         d = D()
-        exec 'z = a' in g, d
+        exec('z = a', g, d)
         self.assertEqual(d['z'], 12)
 
     def test_extended_arg(self):
         longexpr = 'x = x or ' + '-x' * 2500
+        g = {}
         code = '''
 def f(x):
     %s
@@ -121,8 +122,8 @@
         # EXTENDED_ARG/JUMP_ABSOLUTE here
     return x
 ''' % ((longexpr,)*10)
-        exec code
-        self.assertEqual(f(5), 0)
+        exec(code, g)
+        self.assertEqual(g['f'](5), 0)
 
     def test_complex_args(self):
 
@@ -146,7 +147,7 @@
 
     def test_argument_order(self):
         try:
-            exec 'def f(a=1, (b, c)): pass'
+            exec('def f(a=1, (b, c)): pass')
             self.fail("non-default args after default")
         except SyntaxError:
             pass

Modified: python/branches/p3yk-noslice/Lib/test/test_compiler.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_compiler.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_compiler.py	Fri Dec 15 05:21:50 2006
@@ -61,7 +61,7 @@
         c = compiler.compile("try:\n 1/0\nexcept:\n e = 1\nfinally:\n f = 1",
                              "<string>", "exec")
         dct = {}
-        exec c in dct
+        exec(c, dct)
         self.assertEquals(dct.get('e'), 1)
         self.assertEquals(dct.get('f'), 1)
 
@@ -73,7 +73,7 @@
         self.assert_('__doc__' in c.co_names)
         c = compiler.compile('def f():\n "doc"', '<string>', 'exec')
         g = {}
-        exec c in g
+        exec(c, g)
         self.assertEquals(g['f'].__doc__, "doc")
 
     def testLineNo(self):
@@ -113,7 +113,7 @@
                              '<string>',
                              'exec')
         dct = {}
-        exec c in dct
+        exec(c, dct)
         self.assertEquals(dct.get('result'), 3)
 
     def testGenExp(self):

Modified: python/branches/p3yk-noslice/Lib/test/test_contextlib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_contextlib.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_contextlib.py	Fri Dec 15 05:21:50 2006
@@ -330,32 +330,6 @@
                 return True
         self.boilerPlate(lock, locked)
 
-class DecimalContextTestCase(unittest.TestCase):
-
-    # XXX Somebody should write more thorough tests for this
-
-    def testBasic(self):
-        ctx = decimal.getcontext()
-        orig_context = ctx.copy()
-        try:
-            ctx.prec = save_prec = decimal.ExtendedContext.prec + 5
-            with decimal.ExtendedContext.get_manager():
-                self.assertEqual(decimal.getcontext().prec,
-                                 decimal.ExtendedContext.prec)
-            self.assertEqual(decimal.getcontext().prec, save_prec)
-            try:
-                with decimal.ExtendedContext.get_manager():
-                    self.assertEqual(decimal.getcontext().prec,
-                                     decimal.ExtendedContext.prec)
-                    1/0
-            except ZeroDivisionError:
-                self.assertEqual(decimal.getcontext().prec, save_prec)
-            else:
-                self.fail("Didn't raise ZeroDivisionError")
-        finally:
-            decimal.setcontext(orig_context)
-
-
 # This is needed to make the test actually run under regrtest.py!
 def test_main():
     run_suite(

Modified: python/branches/p3yk-noslice/Lib/test/test_cookie.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_cookie.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_cookie.py	Fri Dec 15 05:21:50 2006
@@ -1,6 +1,7 @@
 # Simple test suite for Cookie.py
 
-from test.test_support import verify, verbose, run_doctest
+from test.test_support import run_unittest, run_doctest
+import unittest
 import Cookie
 
 import warnings
@@ -8,43 +9,74 @@
                         ".* class is insecure.*",
                         DeprecationWarning)
 
-# Currently this only tests SimpleCookie
+class CookieTests(unittest.TestCase):
+    # Currently this only tests SimpleCookie
+    def test_basic(self):
+        cases = [
+            { 'data': 'chips=ahoy; vienna=finger',
+              'dict': {'chips':'ahoy', 'vienna':'finger'},
+              'repr': "<SimpleCookie: chips='ahoy' vienna='finger'>",
+              'output': 'Set-Cookie: chips=ahoy\nSet-Cookie: vienna=finger',
+            },
+
+            { 'data': 'keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"',
+              'dict': {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'},
+              'repr': '''<SimpleCookie: keebler='E=mc2; L="Loves"; fudge=\\n;'>''',
+              'output': 'Set-Cookie: keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"',
+            },
+
+            # Check illegal cookies that have an '=' char in an unquoted value
+            { 'data': 'keebler=E=mc2',
+              'dict': {'keebler' : 'E=mc2'},
+              'repr': "<SimpleCookie: keebler='E=mc2'>",
+              'output': 'Set-Cookie: keebler=E=mc2',
+            }
+        ]
+
+        for case in cases:
+            C = Cookie.SimpleCookie()
+            C.load(case['data'])
+            self.assertEqual(repr(C), case['repr'])
+            self.assertEqual(C.output(sep='\n'), case['output'])
+            for k, v in sorted(case['dict'].iteritems()):
+                self.assertEqual(C[k].value, v)
+
+    def test_load(self):
+        C = Cookie.SimpleCookie()
+        C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme')
+
+        self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE')
+        self.assertEqual(C['Customer']['version'], '1')
+        self.assertEqual(C['Customer']['path'], '/acme')
+
+        self.assertEqual(C.output(['path']),
+            'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme')
+        self.assertEqual(C.js_output(), """
+        <script type="text/javascript">
+        <!-- begin hiding
+        document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme; Version=1";
+        // end hiding -->
+        </script>
+        """)
+        self.assertEqual(C.js_output(['path']), """
+        <script type="text/javascript">
+        <!-- begin hiding
+        document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme";
+        // end hiding -->
+        </script>
+        """)
+
+    def test_quoted_meta(self):
+        # Try cookie with quoted meta-data
+        C = Cookie.SimpleCookie()
+        C.load('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"')
+        self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE')
+        self.assertEqual(C['Customer']['version'], '1')
+        self.assertEqual(C['Customer']['path'], '/acme')
+
+def test_main():
+    run_unittest(CookieTests)
+    run_doctest(Cookie)
 
-cases = [
-    ('chips=ahoy; vienna=finger', {'chips':'ahoy', 'vienna':'finger'}),
-    ('keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"',
-     {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'}),
-
-    # Check illegal cookies that have an '=' char in an unquoted value
-    ('keebler=E=mc2', {'keebler' : 'E=mc2'})
-    ]
-
-for data, dict in cases:
-    C = Cookie.SimpleCookie() ; C.load(data)
-    print repr(C)
-    print C.output(sep='\n')
-    for k, v in sorted(dict.iteritems()):
-        print ' ', k, repr( C[k].value ), repr(v)
-        verify(C[k].value == v)
-        print C[k]
-
-C = Cookie.SimpleCookie()
-C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme')
-
-verify(C['Customer'].value == 'WILE_E_COYOTE')
-verify(C['Customer']['version'] == '1')
-verify(C['Customer']['path'] == '/acme')
-
-print C.output(['path'])
-print C.js_output()
-print C.js_output(['path'])
-
-# Try cookie with quoted meta-data
-C = Cookie.SimpleCookie()
-C.load('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"')
-verify(C['Customer'].value == 'WILE_E_COYOTE')
-verify(C['Customer']['version'] == '1')
-verify(C['Customer']['path'] == '/acme')
-
-print "If anything blows up after this line, it's from Cookie's doctest."
-run_doctest(Cookie)
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_copy.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_copy.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_copy.py	Fri Dec 15 05:21:50 2006
@@ -104,8 +104,8 @@
         class C:
             def __init__(self, foo):
                 self.foo = foo
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C(42)
         self.assertEqual(copy.copy(x), x)
 
@@ -115,8 +115,8 @@
                 self.foo = foo
             def __copy__(self):
                 return C(self.foo)
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C(42)
         self.assertEqual(copy.copy(x), x)
 
@@ -126,8 +126,8 @@
                 self.foo = foo
             def __getinitargs__(self):
                 return (self.foo,)
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C(42)
         self.assertEqual(copy.copy(x), x)
 
@@ -137,8 +137,8 @@
                 self.foo = foo
             def __getstate__(self):
                 return {"foo": self.foo}
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C(42)
         self.assertEqual(copy.copy(x), x)
 
@@ -148,8 +148,8 @@
                 self.foo = foo
             def __setstate__(self, state):
                 self.foo = state["foo"]
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C(42)
         self.assertEqual(copy.copy(x), x)
 
@@ -161,8 +161,8 @@
                 return self.foo
             def __setstate__(self, state):
                 self.foo = state
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C(42)
         self.assertEqual(copy.copy(x), x)
 
@@ -304,7 +304,7 @@
         x = {}
         x['foo'] = x
         y = copy.deepcopy(x)
-        self.assertRaises(RuntimeError, cmp, y, x)
+        self.assertRaises(TypeError, cmp, y, x)
         self.assert_(y is not x)
         self.assert_(y['foo'] is y)
         self.assertEqual(len(y), 1)
@@ -319,8 +319,8 @@
         class C:
             def __init__(self, foo):
                 self.foo = foo
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C([42])
         y = copy.deepcopy(x)
         self.assertEqual(y, x)
@@ -332,8 +332,8 @@
                 self.foo = foo
             def __deepcopy__(self, memo):
                 return C(copy.deepcopy(self.foo, memo))
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C([42])
         y = copy.deepcopy(x)
         self.assertEqual(y, x)
@@ -346,8 +346,8 @@
                 self.foo = foo
             def __getinitargs__(self):
                 return (self.foo,)
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C([42])
         y = copy.deepcopy(x)
         self.assertEqual(y, x)
@@ -360,8 +360,8 @@
                 self.foo = foo
             def __getstate__(self):
                 return {"foo": self.foo}
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C([42])
         y = copy.deepcopy(x)
         self.assertEqual(y, x)
@@ -374,8 +374,8 @@
                 self.foo = foo
             def __setstate__(self, state):
                 self.foo = state["foo"]
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C([42])
         y = copy.deepcopy(x)
         self.assertEqual(y, x)
@@ -390,8 +390,8 @@
                 return self.foo
             def __setstate__(self, state):
                 self.foo = state
-            def __cmp__(self, other):
-                return cmp(self.foo, other.foo)
+            def __eq__(self, other):
+                return self.foo == other.foo
         x = C([42])
         y = copy.deepcopy(x)
         self.assertEqual(y, x)
@@ -434,8 +434,8 @@
         class C(object):
             def __reduce__(self):
                 return (C, (), self.__dict__)
-            def __cmp__(self, other):
-                return cmp(self.__dict__, other.__dict__)
+            def __eq__(self, other):
+                return self.__dict__ == other.__dict__
         x = C()
         x.foo = [42]
         y = copy.copy(x)
@@ -450,8 +450,8 @@
                 return (C, (), self.__dict__)
             def __setstate__(self, state):
                 self.__dict__.update(state)
-            def __cmp__(self, other):
-                return cmp(self.__dict__, other.__dict__)
+            def __eq__(self, other):
+                return self.__dict__ == other.__dict__
         x = C()
         x.foo = [42]
         y = copy.copy(x)
@@ -475,9 +475,9 @@
         class C(list):
             def __reduce__(self):
                 return (C, (), self.__dict__, iter(self))
-            def __cmp__(self, other):
-                return (cmp(list(self), list(other)) or
-                        cmp(self.__dict__, other.__dict__))
+            def __eq__(self, other):
+                return (list(self) == list(other) and
+                        self.__dict__ == other.__dict__)
         x = C([[1, 2], 3])
         y = copy.copy(x)
         self.assertEqual(x, y)
@@ -492,9 +492,9 @@
         class C(dict):
             def __reduce__(self):
                 return (C, (), self.__dict__, None, self.iteritems())
-            def __cmp__(self, other):
-                return (cmp(dict(self), list(dict)) or
-                        cmp(self.__dict__, other.__dict__))
+            def __eq__(self, other):
+                return (dict(self) == dict(other) and
+                        self.__dict__ == other.__dict__)
         x = C([("foo", [1, 2]), ("bar", 3)])
         y = copy.copy(x)
         self.assertEqual(x, y)

Modified: python/branches/p3yk-noslice/Lib/test/test_datetime.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_datetime.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_datetime.py	Fri Dec 15 05:21:50 2006
@@ -852,6 +852,7 @@
         t = self.theclass(2005, 3, 2)
         self.assertEqual(t.strftime("m:%m d:%d y:%y"), "m:03 d:02 y:05")
         self.assertEqual(t.strftime(""), "") # SF bug #761337
+        self.assertEqual(t.strftime('x'*1000), 'x'*1000) # SF bug #1556784
 
         self.assertRaises(TypeError, t.strftime) # needs an arg
         self.assertRaises(TypeError, t.strftime, "one", "two") # too many args
@@ -954,41 +955,60 @@
 
     def test_mixed_compare(self):
         our = self.theclass(2000, 4, 5)
+
+        # Our class can be compared for equality to other classes
+        self.assertEqual(our == 1, False)
+        self.assertEqual(1 == our, False)
+        self.assertEqual(our != 1, True)
+        self.assertEqual(1 != our, True)
+
+        # But the ordering is undefined
+        self.assertRaises(TypeError, lambda: our < 1)
+        self.assertRaises(TypeError, lambda: 1 < our)
         self.assertRaises(TypeError, cmp, our, 1)
         self.assertRaises(TypeError, cmp, 1, our)
 
-        class AnotherDateTimeClass(object):
-            def __cmp__(self, other):
-                # Return "equal" so calling this can't be confused with
-                # compare-by-address (which never says "equal" for distinct
-                # objects).
-                return 0
-
-        # This still errors, because date and datetime comparison raise
-        # TypeError instead of NotImplemented when they don't know what to
-        # do, in order to stop comparison from falling back to the default
-        # compare-by-address.
-        their = AnotherDateTimeClass()
+        # Repeat those tests with a different class
+
+        class SomeClass:
+            pass
+
+        their = SomeClass()
+        self.assertEqual(our == their, False)
+        self.assertEqual(their == our, False)
+        self.assertEqual(our != their, True)
+        self.assertEqual(their != our, True)
+        self.assertRaises(TypeError, lambda: our < their)
+        self.assertRaises(TypeError, lambda: their < our)
         self.assertRaises(TypeError, cmp, our, their)
-        # Oops:  The next stab raises TypeError in the C implementation,
-        # but not in the Python implementation of datetime.  The difference
-        # is due to that the Python implementation defines __cmp__ but
-        # the C implementation defines tp_richcompare.  This is more pain
-        # to fix than it's worth, so commenting out the test.
-        # self.assertEqual(cmp(their, our), 0)
-
-        # But date and datetime comparison return NotImplemented instead if the
-        # other object has a timetuple attr.  This gives the other object a
-        # chance to do the comparison.
-        class Comparable(AnotherDateTimeClass):
-            def timetuple(self):
-                return ()
-
-        their = Comparable()
-        self.assertEqual(cmp(our, their), 0)
-        self.assertEqual(cmp(their, our), 0)
-        self.failUnless(our == their)
-        self.failUnless(their == our)
+        self.assertRaises(TypeError, cmp, their, our)
+
+        # However, if the other class explicitly defines ordering
+        # relative to our class, it is allowed to do so
+
+        class LargerThanAnything:
+            def __lt__(self, other):
+                return False
+            def __le__(self, other):
+                return isinstance(other, LargerThanAnything)
+            def __eq__(self, other):
+                return isinstance(other, LargerThanAnything)
+            def __ne__(self, other):
+                return not isinstance(other, LargerThanAnything)
+            def __gt__(self, other):
+                return not isinstance(other, LargerThanAnything)
+            def __ge__(self, other):
+                return True
+
+        their = LargerThanAnything()
+        self.assertEqual(our == their, False)
+        self.assertEqual(their == our, False)
+        self.assertEqual(our != their, True)
+        self.assertEqual(their != our, True)
+        self.assertEqual(our < their, True)
+        self.assertEqual(their < our, False)
+        self.assertEqual(cmp(our, their), -1)
+        self.assertEqual(cmp(their, our), 1)
 
     def test_bool(self):
         # All dates are considered true.
@@ -3217,10 +3237,10 @@
 
         # Neverthelss, comparison should work with the base-class (date)
         # projection if use of a date method is forced.
-        self.assert_(as_date.__eq__(as_datetime))
+        self.assertEqual(as_date.__eq__(as_datetime), True)
         different_day = (as_date.day + 1) % 20 + 1
-        self.assert_(not as_date.__eq__(as_datetime.replace(day=
-                                                     different_day)))
+        as_different = as_datetime.replace(day= different_day)
+        self.assertEqual(as_date.__eq__(as_different), False)
 
         # And date should compare with other subclasses of date.  If a
         # subclass wants to stop this, it's up to the subclass to do so.

Modified: python/branches/p3yk-noslice/Lib/test/test_dbm.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_dbm.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_dbm.py	Fri Dec 15 05:21:50 2006
@@ -6,11 +6,11 @@
 import random
 import dbm
 from dbm import error
-from test.test_support import verbose, verify, TestSkipped
+from test.test_support import verbose, verify, TestSkipped, TESTFN
 
 # make filename unique to allow multiple concurrent tests
 # and to minimize the likelihood of a problem from an old file
-filename = '/tmp/delete_me_' + str(random.random())[-6:]
+filename = TESTFN
 
 def cleanup():
     for suffix in ['', '.pag', '.dir', '.db']:

Modified: python/branches/p3yk-noslice/Lib/test/test_decimal.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_decimal.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_decimal.py	Fri Dec 15 05:21:50 2006
@@ -23,6 +23,7 @@
 you're working through IDLE, you can import this test module and call test_main()
 with the corresponding argument.
 """
+from __future__ import with_statement
 
 import unittest
 import glob
@@ -276,8 +277,8 @@
         myexceptions = self.getexceptions()
         self.context.clear_flags()
 
-        myexceptions.sort()
-        theirexceptions.sort()
+        myexceptions.sort(key=repr)
+        theirexceptions.sort(key=repr)
 
         self.assertEqual(result, ans,
                          'Incorrect answer for ' + s + ' -- got ' + result)
@@ -990,7 +991,7 @@
         checkSameDec("__mod__", True)
         checkSameDec("__mul__", True)
         checkSameDec("__neg__")
-        checkSameDec("__nonzero__")
+        checkSameDec("__bool__")
         checkSameDec("__pos__")
         checkSameDec("__pow__", True)
         checkSameDec("__radd__", True)
@@ -1057,6 +1058,32 @@
         self.assertNotEqual(id(c.flags), id(d.flags))
         self.assertNotEqual(id(c.traps), id(d.traps))
 
+class WithStatementTest(unittest.TestCase):
+    # Can't do these as docstrings until Python 2.6
+    # as doctest can't handle __future__ statements
+
+    def test_localcontext(self):
+        # Use a copy of the current context in the block
+        orig_ctx = getcontext()
+        with localcontext() as enter_ctx:
+            set_ctx = getcontext()
+        final_ctx = getcontext()
+        self.assert_(orig_ctx is final_ctx, 'did not restore context correctly')
+        self.assert_(orig_ctx is not set_ctx, 'did not copy the context')
+        self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
+
+    def test_localcontextarg(self):
+        # Use a copy of the supplied context in the block
+        orig_ctx = getcontext()
+        new_ctx = Context(prec=42)
+        with localcontext(new_ctx) as enter_ctx:
+            set_ctx = getcontext()
+        final_ctx = getcontext()
+        self.assert_(orig_ctx is final_ctx, 'did not restore context correctly')
+        self.assert_(set_ctx.prec == new_ctx.prec, 'did not set correct context')
+        self.assert_(new_ctx is not set_ctx, 'did not copy the context')
+        self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
+
 def test_main(arith=False, verbose=None):
     """ Execute the tests.
 
@@ -1077,6 +1104,7 @@
         DecimalPythonAPItests,
         ContextAPItests,
         DecimalTest,
+        WithStatementTest,
     ]
 
     try:

Modified: python/branches/p3yk-noslice/Lib/test/test_descr.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_descr.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_descr.py	Fri Dec 15 05:21:50 2006
@@ -55,7 +55,7 @@
 def testsetop(a, b, res, stmt="a+=b", meth="__iadd__"):
     if verbose: print "checking", stmt
     dict = {'a': deepcopy(a), 'b': b}
-    exec stmt in dict
+    exec(stmt, dict)
     vereq(dict['a'], res)
     t = type(a)
     m = getattr(t, meth)
@@ -73,7 +73,7 @@
 def testset2op(a, b, c, res, stmt="a[b]=c", meth="__setitem__"):
     if verbose: print "checking", stmt
     dict = {'a': deepcopy(a), 'b': b, 'c': c}
-    exec stmt in dict
+    exec(stmt, dict)
     vereq(dict['a'], res)
     t = type(a)
     m = getattr(t, meth)
@@ -91,7 +91,7 @@
 def testset3op(a, b, c, d, res, stmt="a[b:c]=d", meth="__setitem__"):
     if verbose: print "checking", stmt
     dict = {'a': deepcopy(a), 'b': b, 'c': c, 'd': d}
-    exec stmt in dict
+    exec(stmt, dict)
     vereq(dict['a'], res)
     t = type(a)
     while meth not in t.__dict__:
@@ -151,7 +151,7 @@
 
 def dicts():
     if verbose: print "Testing dict operations..."
-    testbinop({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__")
+    ##testbinop({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__")
     testbinop({1:2,3:4}, 1, 1, "b in a", "__contains__")
     testbinop({1:2,3:4}, 2, 0, "b in a", "__contains__")
     testbinop({1:2,3:4}, 1, 2, "a[b]", "__getitem__")
@@ -417,8 +417,8 @@
     if verbose: print "Testing int operations..."
     numops(100, 3)
     # The following crashes in Python 2.2
-    vereq((1).__nonzero__(), 1)
-    vereq((0).__nonzero__(), 0)
+    vereq((1).__bool__(), True)
+    vereq((0).__bool__(), False)
     # This returns 'NotImplemented' in Python 2.2
     class C(int):
         def __add__(self, other):
@@ -523,7 +523,7 @@
     # This is an ugly hack:
     copy._deepcopy_dispatch[spam.spamdict] = spamdict
 
-    testbinop(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", "__cmp__")
+    ##testbinop(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", "__cmp__")
     testbinop(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__")
     testbinop(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__")
     testbinop(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__")
@@ -1634,7 +1634,7 @@
     verify(id(c1) != id(c2))
     hash(c1)
     hash(c2)
-    vereq(cmp(c1, c2), cmp(id(c1), id(c2)))
+    ##vereq(cmp(c1, c2), cmp(id(c1), id(c2)))
     vereq(c1, c1)
     verify(c1 != c2)
     verify(not c1 != c1)
@@ -1658,7 +1658,7 @@
     verify(id(d1) != id(d2))
     hash(d1)
     hash(d2)
-    vereq(cmp(d1, d2), cmp(id(d1), id(d2)))
+    ##vereq(cmp(d1, d2), cmp(id(d1), id(d2)))
     vereq(d1, d1)
     verify(d1 != d2)
     verify(not d1 != d1)
@@ -1675,7 +1675,7 @@
     class Proxy(object):
         def __init__(self, x):
             self.x = x
-        def __nonzero__(self):
+        def __bool__(self):
             return not not self.x
         def __hash__(self):
             return hash(self.x)
@@ -1715,7 +1715,7 @@
     class DProxy(object):
         def __init__(self, x):
             self.x = x
-        def __nonzero__(self):
+        def __bool__(self):
             return not not self.x
         def __hash__(self):
             return hash(self.x)
@@ -1751,21 +1751,21 @@
     for i in range(10):
         verify(i in p10)
     verify(10 not in p10)
-    # Safety test for __cmp__
-    def unsafecmp(a, b):
-        try:
-            a.__class__.__cmp__(a, b)
-        except TypeError:
-            pass
-        else:
-            raise TestFailed, "shouldn't allow %s.__cmp__(%r, %r)" % (
-                a.__class__, a, b)
-    unsafecmp(u"123", "123")
-    unsafecmp("123", u"123")
-    unsafecmp(1, 1.0)
-    unsafecmp(1.0, 1)
-    unsafecmp(1, 1L)
-    unsafecmp(1L, 1)
+##     # Safety test for __cmp__
+##     def unsafecmp(a, b):
+##         try:
+##             a.__class__.__cmp__(a, b)
+##         except TypeError:
+##             pass
+##         else:
+##             raise TestFailed, "shouldn't allow %s.__cmp__(%r, %r)" % (
+##                 a.__class__, a, b)
+##     unsafecmp(u"123", "123")
+##     unsafecmp("123", u"123")
+##     unsafecmp(1, 1.0)
+##     unsafecmp(1.0, 1)
+##     unsafecmp(1, 1L)
+##     unsafecmp(1L, 1)
 
     class Letter(str):
         def __new__(cls, letter):
@@ -2010,6 +2010,13 @@
 
     veris(Sub.test(), Base.aProp)
 
+    # Verify that super() doesn't allow keyword args
+    try:
+        super(Base, kw=1)
+    except TypeError:
+        pass
+    else:
+        raise TestFailed, "super shouldn't accept keyword args"
 
 def inherits():
     if verbose: print "Testing inheritance from basic types..."
@@ -2331,7 +2338,7 @@
                 self.ateof = 1
             return s
 
-    f = file(name=TESTFN, mode='w')
+    f = open(name=TESTFN, mode='w')
     lines = ['a\n', 'b\n', 'c\n']
     try:
         f.writelines(lines)
@@ -2387,7 +2394,7 @@
     sandbox = rexec.RExec()
 
     code1 = """f = open(%r, 'w')""" % TESTFN
-    code2 = """f = file(%r, 'w')""" % TESTFN
+    code2 = """f = open(%r, 'w')""" % TESTFN
     code3 = """\
 f = open(%r)
 t = type(f)  # a sneaky way to get the file() constructor
@@ -2462,12 +2469,43 @@
         class C(base):
             def __init__(self, value):
                 self.value = int(value)
-            def __cmp__(self, other):
+            def __eq__(self, other):
                 if isinstance(other, C):
-                    return cmp(self.value, other.value)
+                    return self.value == other.value
                 if isinstance(other, int) or isinstance(other, long):
-                    return cmp(self.value, other)
+                    return self.value == other
                 return NotImplemented
+            def __ne__(self, other):
+                if isinstance(other, C):
+                    return self.value != other.value
+                if isinstance(other, int) or isinstance(other, long):
+                    return self.value != other
+                return NotImplemented
+            def __lt__(self, other):
+                if isinstance(other, C):
+                    return self.value < other.value
+                if isinstance(other, int) or isinstance(other, long):
+                    return self.value < other
+                return NotImplemented
+            def __le__(self, other):
+                if isinstance(other, C):
+                    return self.value <= other.value
+                if isinstance(other, int) or isinstance(other, long):
+                    return self.value <= other
+                return NotImplemented
+            def __gt__(self, other):
+                if isinstance(other, C):
+                    return self.value > other.value
+                if isinstance(other, int) or isinstance(other, long):
+                    return self.value > other
+                return NotImplemented
+            def __ge__(self, other):
+                if isinstance(other, C):
+                    return self.value >= other.value
+                if isinstance(other, int) or isinstance(other, long):
+                    return self.value >= other
+                return NotImplemented
+
         c1 = C(1)
         c2 = C(2)
         c3 = C(3)
@@ -2475,12 +2513,12 @@
         c = {1: c1, 2: c2, 3: c3}
         for x in 1, 2, 3:
             for y in 1, 2, 3:
-                verify(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
+                ##verify(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
                 for op in "<", "<=", "==", "!=", ">", ">=":
                     verify(eval("c[x] %s c[y]" % op) == eval("x %s y" % op),
                            "x=%d, y=%d" % (x, y))
-                verify(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y))
-                verify(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
+                ##verify(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y))
+                ##verify(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
 
 def rich_comparisons():
     if verbose:
@@ -3463,6 +3501,13 @@
         raise TestFailed, "shouldn't be able to assign to list.__bases__"
 
     try:
+        D.__bases__ = (C2, list)
+    except TypeError:
+        pass
+    else:
+        assert 0, "best_base calculation found wanting"
+
+    try:
         del D.__bases__
     except TypeError:
         pass
@@ -3868,6 +3913,8 @@
     if verbose:
         print "Testing method-wrapper objects..."
 
+    return # XXX should methods really support __eq__?
+
     l = []
     vereq(l.__add__, l.__add__)
     vereq(l.__add__, [].__add__)
@@ -3903,7 +3950,7 @@
 
     def check(expr, x, y):
         try:
-            exec expr in {'x': x, 'y': y, 'operator': operator}
+            exec(expr, {'x': x, 'y': y, 'operator': operator})
         except TypeError:
             pass
         else:

Modified: python/branches/p3yk-noslice/Lib/test/test_descrtut.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_descrtut.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_descrtut.py	Fri Dec 15 05:21:50 2006
@@ -65,14 +65,11 @@
 dictionaries, such as the locals/globals dictionaries for the exec
 statement or the built-in function eval():
 
-    >>> def sorted(seq):
-    ...     seq.sort()
-    ...     return seq
     >>> print sorted(a.keys())
     [1, 2]
-    >>> exec "x = 3; print x" in a
+    >>> exec("x = 3; print x", a)
     3
-    >>> print sorted(a.keys())
+    >>> print sorted(a.keys(), key=lambda x: (str(type(x)), x))
     [1, 2, '__builtins__', 'x']
     >>> print a['x']
     3

Modified: python/branches/p3yk-noslice/Lib/test/test_dict.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_dict.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_dict.py	Fri Dec 15 05:21:50 2006
@@ -5,6 +5,7 @@
 
 
 class DictTest(unittest.TestCase):
+
     def test_constructor(self):
         # calling built-in types without argument must return empty
         self.assertEqual(dict(), {})
@@ -368,9 +369,9 @@
         d = {1: BadRepr()}
         self.assertRaises(Exc, repr, d)
 
-    def test_le(self):
-        self.assert_(not ({} < {}))
-        self.assert_(not ({1: 2} < {1L: 2L}))
+    def test_eq(self):
+        self.assertEqual({}, {})
+        self.assertEqual({1: 2}, {1L: 2L})
 
         class Exc(Exception): pass
 
@@ -378,12 +379,12 @@
             def __eq__(self, other):
                 raise Exc()
             def __hash__(self):
-                return 42
+                return 1
 
         d1 = {BadCmp(): 1}
         d2 = {1: 1}
         try:
-            d1 < d2
+            d1 == d2
         except Exc:
             pass
         else:
@@ -438,6 +439,16 @@
         else:
             self.fail_("g[42] didn't raise KeyError")
 
+    def test_tuple_keyerror(self):
+        # SF #1576657
+        d = {}
+        try:
+            d[(1,)]
+        except KeyError, e:
+            self.assertEqual(e.args, ((1,),))
+        else:
+            self.fail("missing KeyError")
+
 
 from test import mapping_tests
 

Modified: python/branches/p3yk-noslice/Lib/test/test_dis.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_dis.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_dis.py	Fri Dec 15 05:21:50 2006
@@ -135,7 +135,7 @@
         def func(count):
             namespace = {}
             func = "def foo():\n " + "".join(["\n "] * count + ["spam\n"])
-            exec func in namespace
+            exec(func, namespace)
             return namespace['foo']
 
         # Test all small ranges

Modified: python/branches/p3yk-noslice/Lib/test/test_doctest.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_doctest.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_doctest.py	Fri Dec 15 05:21:50 2006
@@ -605,7 +605,7 @@
     ...     if isinstance(piece, doctest.Example):
     ...         print 'Example:', (piece.source, piece.want, piece.lineno)
     ...     else:
-    ...         print '   Text:', `piece`
+    ...         print '   Text:', repr(piece)
        Text: '\n'
     Example: ('x, y = 2, 3  # no output expected\n', '', 1)
        Text: ''
@@ -2234,7 +2234,7 @@
     >>> doctest.testfile('test_doctest.txt', raise_on_error=True)
     ... # doctest: +ELLIPSIS
     Traceback (most recent call last):
-    UnexpectedException: ...
+    doctest.UnexpectedException: ...
     >>> doctest.master = None  # Reset master.
 
 If the tests contain non-ASCII characters, the tests might fail, since
@@ -2366,8 +2366,8 @@
         ...        '''>>> assert 1 < 2
         ...        '''
         ... \"""
-        >>> exec test_data in m1.__dict__
-        >>> exec test_data in m2.__dict__
+        >>> exec(test_data, m1.__dict__)
+        >>> exec(test_data, m2.__dict__)
         >>> m1.__dict__.update({"f2": m2._f, "g2": m2.g, "h2": m2.H})
 
         Tests that objects outside m1 are excluded:

Modified: python/branches/p3yk-noslice/Lib/test/test_enumerate.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_enumerate.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_enumerate.py	Fri Dec 15 05:21:50 2006
@@ -122,7 +122,7 @@
 class TestBig(EnumerateTestCase):
 
     seq = range(10,20000,2)
-    res = zip(range(20000), seq)
+    res = list(zip(range(20000), seq))
 
 class TestReversed(unittest.TestCase):
 

Modified: python/branches/p3yk-noslice/Lib/test/test_exceptions.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_exceptions.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_exceptions.py	Fri Dec 15 05:21:50 2006
@@ -87,7 +87,7 @@
         self.raise_catch(RuntimeError, "RuntimeError")
 
         self.raise_catch(SyntaxError, "SyntaxError")
-        try: exec '/\n'
+        try: exec('/\n')
         except SyntaxError: pass
 
         self.raise_catch(IndentationError, "IndentationError")
@@ -196,17 +196,21 @@
             test_capi2()
             test_capi3()
 
-    def testAttributes(self):
-        # test that exception attributes are happy
+    def test_WindowsError(self):
         try:
-            str(u'Hello \u00E1')
-        except Exception, e:
-            sampleUnicodeEncodeError = e
+            WindowsError
+        except NameError:
+            pass
+        else:
+            self.failUnlessEqual(str(WindowsError(1001)),
+                                 "1001")
+            self.failUnlessEqual(str(WindowsError(1001, "message")),
+                                 "[Error 1001] message")
+            self.failUnlessEqual(WindowsError(1001, "message").errno, 22)
+            self.failUnlessEqual(WindowsError(1001, "message").winerror, 1001)
 
-        try:
-            unicode('\xff')
-        except Exception, e:
-            sampleUnicodeDecodeError = e
+    def testAttributes(self):
+        # test that exception attributes are happy
 
         exceptionList = [
             (BaseException, (), {'message' : '', 'args' : ()}),
@@ -218,11 +222,16 @@
             (SystemExit, ('foo',),
                 {'message' : 'foo', 'args' : ('foo',), 'code' : 'foo'}),
             (IOError, ('foo',),
-                {'message' : 'foo', 'args' : ('foo',)}),
+                {'message' : 'foo', 'args' : ('foo',), 'filename' : None,
+                 'errno' : None, 'strerror' : None}),
             (IOError, ('foo', 'bar'),
-                {'message' : '', 'args' : ('foo', 'bar')}),
+                {'message' : '', 'args' : ('foo', 'bar'), 'filename' : None,
+                 'errno' : 'foo', 'strerror' : 'bar'}),
             (IOError, ('foo', 'bar', 'baz'),
-                {'message' : '', 'args' : ('foo', 'bar')}),
+                {'message' : '', 'args' : ('foo', 'bar'), 'filename' : 'baz',
+                 'errno' : 'foo', 'strerror' : 'bar'}),
+            (IOError, ('foo', 'bar', 'baz', 'quux'),
+                {'message' : '', 'args' : ('foo', 'bar', 'baz', 'quux')}),
             (EnvironmentError, ('errnoStr', 'strErrorStr', 'filenameStr'),
                 {'message' : '', 'args' : ('errnoStr', 'strErrorStr'),
                  'strerror' : 'strErrorStr', 'errno' : 'errnoStr',
@@ -249,16 +258,16 @@
                  'print_file_and_line' : None, 'msg' : 'msgStr',
                  'filename' : None, 'lineno' : None, 'offset' : None}),
             (UnicodeError, (), {'message' : '', 'args' : (),}),
-            (sampleUnicodeEncodeError,
-                {'message' : '', 'args' : ('ascii', u'Hello \xe1', 6, 7,
-                                           'ordinal not in range(128)'),
-                 'encoding' : 'ascii', 'object' : u'Hello \xe1',
-                 'start' : 6, 'reason' : 'ordinal not in range(128)'}),
-            (sampleUnicodeDecodeError,
+            (UnicodeEncodeError, ('ascii', u'a', 0, 1, 'ordinal not in range'),
+                {'message' : '', 'args' : ('ascii', u'a', 0, 1,
+                                           'ordinal not in range'),
+                 'encoding' : 'ascii', 'object' : u'a',
+                 'start' : 0, 'reason' : 'ordinal not in range'}),
+            (UnicodeDecodeError, ('ascii', '\xff', 0, 1, 'ordinal not in range'),
                 {'message' : '', 'args' : ('ascii', '\xff', 0, 1,
-                                           'ordinal not in range(128)'),
+                                           'ordinal not in range'),
                  'encoding' : 'ascii', 'object' : '\xff',
-                 'start' : 0, 'reason' : 'ordinal not in range(128)'}),
+                 'start' : 0, 'reason' : 'ordinal not in range'}),
             (UnicodeTranslateError, (u"\u3042", 0, 1, "ouch"),
                 {'message' : '', 'args' : (u'\u3042', 0, 1, 'ouch'),
                  'object' : u'\u3042', 'reason' : 'ouch',
@@ -274,18 +283,14 @@
         except NameError:
             pass
 
-        for args in exceptionList:
-            expected = args[-1]
+        for exc, args, expected in exceptionList:
             try:
-                exc = args[0]
-                if len(args) == 2:
-                    raise exc
-                else:
-                    raise exc(*args[1])
+                raise exc(*args)
             except BaseException, e:
-                if (e is not exc and     # needed for sampleUnicode errors
-                        type(e) is not exc):
+                if type(e) is not exc:
                     raise
+                # Verify module name
+                self.assertEquals(type(e).__module__, 'exceptions')
                 # Verify no ref leaks in Exc_str()
                 s = str(e)
                 for checkArgName in expected:
@@ -332,6 +337,15 @@
                 return -1
         self.assertRaises(RuntimeError, g)
 
+    def testUnicodeStrUsage(self):
+        # Make sure both instances and classes have a str and unicode
+        # representation.
+        self.failUnless(str(Exception))
+        self.failUnless(unicode(Exception))
+        self.failUnless(str(Exception('a')))
+        self.failUnless(unicode(Exception(u'a')))
+
+
 def test_main():
     run_unittest(ExceptionTests)
 

Modified: python/branches/p3yk-noslice/Lib/test/test_fcntl.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_fcntl.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_fcntl.py	Fri Dec 15 05:21:50 2006
@@ -25,7 +25,7 @@
                     'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
                     'freebsd6', 'freebsd7',
                     'bsdos2', 'bsdos3', 'bsdos4',
-                    'openbsd', 'openbsd2', 'openbsd3'):
+                    'openbsd', 'openbsd2', 'openbsd3', 'openbsd4'):
     if struct.calcsize('l') == 8:
         off_t = 'l'
         pid_t = 'i'

Modified: python/branches/p3yk-noslice/Lib/test/test_format.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_format.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_format.py	Fri Dec 15 05:21:50 2006
@@ -219,8 +219,8 @@
     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")
-test_exc('%g', '1', TypeError, "float argument required")
+test_exc('%d', '1', TypeError, "int argument 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")
 test_exc('no format', u'1', TypeError,

Modified: python/branches/p3yk-noslice/Lib/test/test_frozen.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_frozen.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_frozen.py	Fri Dec 15 05:21:50 2006
@@ -1,4 +1,11 @@
 # Test the frozen module defined in frozen.c.
+# Currently test_frozen fails:
+#   Implementing pep3102(keyword only argument) needs changes in
+#   code object, which needs modification to marshal.
+#   However, to regenerate hard-coded marshal data in frozen.c,
+#   we need to run Tools/freeze/freeze.py, which currently doesn't work
+#   because Lib/modulefinder.py cannot handle relative module import
+#   This test will keep failing until Lib/modulefinder.py is fixed
 
 from test.test_support import TestFailed
 import sys, os

Modified: python/branches/p3yk-noslice/Lib/test/test_funcattrs.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_funcattrs.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_funcattrs.py	Fri Dec 15 05:21:50 2006
@@ -19,16 +19,16 @@
 except AttributeError: pass
 else: raise TestFailed, 'expected AttributeError'
 
-if b.__dict__ <> {}:
+if b.__dict__ != {}:
     raise TestFailed, 'expected unassigned func.__dict__ to be {}'
 
 b.publish = 1
-if b.publish <> 1:
+if b.publish != 1:
     raise TestFailed, 'function attribute not set to expected value'
 
 docstring = 'its docstring'
 b.__doc__ = docstring
-if b.__doc__ <> docstring:
+if b.__doc__ != docstring:
     raise TestFailed, 'problem with setting __doc__ attribute'
 
 if 'publish' not in dir(b):
@@ -49,7 +49,7 @@
 b.__dict__ = d
 if b.func_dict is not d:
     raise TestFailed, 'func.__dict__ assignment to dictionary failed'
-if b.hello <> 'world':
+if b.hello != 'world':
     raise TestFailed, 'attribute after func.__dict__ assignment failed'
 
 f1 = F()
@@ -75,13 +75,13 @@
 # But setting it explicitly on the underlying function object is okay.
 F.a.im_func.publish = 1
 
-if F.a.publish <> 1:
+if F.a.publish != 1:
     raise TestFailed, 'unbound method attribute not set to expected value'
 
-if f1.a.publish <> 1:
+if f1.a.publish != 1:
     raise TestFailed, 'bound method attribute access did not work'
 
-if f2.a.publish <> 1:
+if f2.a.publish != 1:
     raise TestFailed, 'bound method attribute access did not work'
 
 if 'publish' not in dir(F.a):
@@ -117,7 +117,7 @@
 
 F.a.im_func.__dict__ = {'one': 11, 'two': 22, 'three': 33}
 
-if f1.a.two <> 22:
+if f1.a.two != 22:
     raise TestFailed, 'setting __dict__'
 
 from UserDict import UserDict
@@ -128,7 +128,7 @@
 except (AttributeError, TypeError): pass
 else: raise TestFailed
 
-if f2.a.one <> f1.a.one <> F.a.one <> 11:
+if f2.a.one != f1.a.one != F.a.one != 11:
     raise TestFailed
 
 # im_func may not be a Python method!
@@ -136,7 +136,7 @@
 F.id = new.instancemethod(id, None, F)
 
 eff = F()
-if eff.id() <> id(eff):
+if eff.id() != id(eff):
     raise TestFailed
 
 try:
@@ -278,7 +278,7 @@
     cantset(f, "__name__", 1)
     # test that you can access func.__name__ in restricted mode
     s = """def f(): pass\nf.__name__"""
-    exec s in {'__builtins__':{}}
+    exec(s, {'__builtins__':{}})
 
 
 def test_func_code():

Modified: python/branches/p3yk-noslice/Lib/test/test_functools.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_functools.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_functools.py	Fri Dec 15 05:21:50 2006
@@ -210,6 +210,13 @@
         self.assertEqual(wrapper.attr, 'This is a different test')
         self.assertEqual(wrapper.dict_attr, f.dict_attr)
 
+    def test_builtin_update(self):
+        # Test for bug #1576241
+        def wrapper():
+            pass
+        functools.update_wrapper(wrapper, max)
+        self.assertEqual(wrapper.__name__, 'max')
+        self.assert_(wrapper.__doc__.startswith('max('))
 
 class TestWraps(TestUpdateWrapper):
 
@@ -259,6 +266,74 @@
         self.assertEqual(wrapper.attr, 'This is a different test')
         self.assertEqual(wrapper.dict_attr, f.dict_attr)
 
+class TestReduce(unittest.TestCase):
+    func = functools.reduce
+
+    def test_reduce(self):
+        class Squares:
+            def __init__(self, max):
+                self.max = max
+                self.sofar = []
+
+            def __len__(self):
+                return len(self.sofar)
+
+            def __getitem__(self, i):
+                if not 0 <= i < self.max: raise IndexError
+                n = len(self.sofar)
+                while n <= i:
+                    self.sofar.append(n*n)
+                    n += 1
+                return self.sofar[i]
+    
+        self.assertEqual(self.func(lambda x, y: x+y, ['a', 'b', 'c'], ''), 'abc')
+        self.assertEqual(
+            self.func(lambda x, y: x+y, [['a', 'c'], [], ['d', 'w']], []),
+            ['a','c','d','w']
+        )
+        self.assertEqual(self.func(lambda x, y: x*y, range(2,8), 1), 5040)
+        self.assertEqual(
+            self.func(lambda x, y: x*y, range(2,21), 1L),
+            2432902008176640000L
+        )
+        self.assertEqual(self.func(lambda x, y: x+y, Squares(10)), 285)
+        self.assertEqual(self.func(lambda x, y: x+y, Squares(10), 0), 285)
+        self.assertEqual(self.func(lambda x, y: x+y, Squares(0), 0), 0)
+        self.assertRaises(TypeError, self.func)
+        self.assertRaises(TypeError, self.func, 42, 42)
+        self.assertRaises(TypeError, self.func, 42, 42, 42)
+        self.assertEqual(self.func(42, "1"), "1") # func is never called with one item
+        self.assertEqual(self.func(42, "", "1"), "1") # func is never called with one item
+        self.assertRaises(TypeError, self.func, 42, (42, 42))
+
+        class BadSeq:
+            def __getitem__(self, index):
+                raise ValueError
+        self.assertRaises(ValueError, self.func, 42, BadSeq())
+
+    # Test reduce()'s use of iterators.
+    def test_iterator_usage(self):
+        class SequenceClass:
+            def __init__(self, n):
+                self.n = n
+            def __getitem__(self, i):
+                if 0 <= i < self.n:
+                    return i
+                else:
+                    raise IndexError
+    
+        from operator import add
+        self.assertEqual(self.func(add, SequenceClass(5)), 10)
+        self.assertEqual(self.func(add, SequenceClass(5), 42), 52)
+        self.assertRaises(TypeError, self.func, add, SequenceClass(0))
+        self.assertEqual(self.func(add, SequenceClass(0), 42), 42)
+        self.assertEqual(self.func(add, SequenceClass(1)), 0)
+        self.assertEqual(self.func(add, SequenceClass(1), 42), 42)
+
+        d = {"one": 1, "two": 2, "three": 3}
+        self.assertEqual(self.func(add, d), "".join(d.keys()))
+
+    
 
 
 def test_main(verbose=None):
@@ -268,7 +343,8 @@
         TestPartialSubclass,
         TestPythonPartial,
         TestUpdateWrapper,
-        TestWraps
+        TestWraps,
+        TestReduce
     )
     test_support.run_unittest(*test_classes)
 

Modified: python/branches/p3yk-noslice/Lib/test/test_future.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_future.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_future.py	Fri Dec 15 05:21:50 2006
@@ -82,6 +82,27 @@
         else:
             self.fail("expected exception didn't occur")
 
+    def test_parserhack(self):
+        # test that the parser.c::future_hack function works as expected
+        # Note: although this test must pass, it's not testing the original
+        #       bug as of 2.6 since the with statement is not optional and
+        #       the parser hack disabled. If a new keyword is introduced in
+        #       2.6, change this to refer to the new future import.
+        try:
+            exec("from __future__ import division, with_statement; with = 0")
+        except SyntaxError:
+            pass
+        else:
+            self.fail("syntax error didn't occur")
+
+        try:
+            exec("from __future__ import (with_statement, division); with = 0")
+        except SyntaxError:
+            pass
+        else:
+            self.fail("syntax error didn't occur")
+
+
 def test_main():
     test_support.run_unittest(FutureTest)
 

Modified: python/branches/p3yk-noslice/Lib/test/test_gc.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_gc.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_gc.py	Fri Dec 15 05:21:50 2006
@@ -153,7 +153,7 @@
     # Tricky: f -> d -> f, code should call d.clear() after the exec to
     # break the cycle.
     d = {}
-    exec("def f(): pass\n") in d
+    exec("def f(): pass\n", d)
     gc.collect()
     del d
     expect(gc.collect(), 2, "function")

Modified: python/branches/p3yk-noslice/Lib/test/test_gdbm.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_gdbm.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_gdbm.py	Fri Dec 15 05:21:50 2006
@@ -5,9 +5,9 @@
 
 import gdbm
 from gdbm import error
-from test.test_support import verbose, verify, TestFailed
+from test.test_support import verbose, verify, TestFailed, TESTFN
 
-filename= '/tmp/delete_me'
+filename = TESTFN
 
 g = gdbm.open(filename, 'c')
 verify(g.keys() == [])

Modified: python/branches/p3yk-noslice/Lib/test/test_getopt.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_getopt.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_getopt.py	Fri Dec 15 05:21:50 2006
@@ -10,7 +10,7 @@
     """Executes a statement passed in teststr, and raises an exception
        (failure) if the expected exception is *not* raised."""
     try:
-        exec teststr
+        exec(teststr)
     except expected:
         pass
     else:

Modified: python/branches/p3yk-noslice/Lib/test/test_global.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_global.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_global.py	Fri Dec 15 05:21:50 2006
@@ -1,51 +1,51 @@
 """Verify that warnings are issued for global statements following use."""
 
-from test.test_support import check_syntax
+from test.test_support import run_unittest, check_syntax_error
+import unittest
 
 import warnings
+warnings.filterwarnings("error", module="<test string>")
 
-warnings.filterwarnings("error", module="<test code>")
+class GlobalTests(unittest.TestCase):
 
-def compile_and_check(text, should_fail=1):
-    try:
-        compile(text, "<test code>", "exec")
-    except SyntaxError, msg:
-        if should_fail:
-            print "got SyntaxError as expected"
-        else:
-            print "raised unexpected SyntaxError:", text
-    else:
-        if should_fail:
-            print "should have raised SyntaxError:", text
-        else:
-            print "as expected, no SyntaxError"
-
-prog_text_1 = """
+    def test1(self):
+        prog_text_1 = """\
 def wrong1():
     a = 1
     b = 2
     global a
     global b
 """
-compile_and_check(prog_text_1)
+        check_syntax_error(self, prog_text_1)
 
-prog_text_2 = """
+    def test2(self):
+        prog_text_2 = """\
 def wrong2():
     print x
     global x
 """
-compile_and_check(prog_text_2)
+        check_syntax_error(self, prog_text_2)
 
-prog_text_3 = """
+    def test3(self):
+        prog_text_3 = """\
 def wrong3():
     print x
     x = 2
     global x
 """
-compile_and_check(prog_text_3)
+        check_syntax_error(self, prog_text_3)
 
-prog_text_4 = """
+    def test4(self):
+        prog_text_4 = """\
 global x
 x = 2
 """
-compile_and_check(prog_text_4, 0)
+        # this should work
+        compile(prog_text_4, "<test string>", "exec")
+
+
+def test_main():
+    run_unittest(GlobalTests)
+
+if __name__ == "__main__":
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_grammar.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_grammar.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_grammar.py	Fri Dec 15 05:21:50 2006
@@ -8,844 +8,897 @@
 # regression test, the filterwarnings() call has been added to
 # regrtest.py.
 
-from test.test_support import TestFailed, verify, vereq, check_syntax
+from test.test_support import run_unittest, check_syntax_error
+import unittest
 import sys
+# testing import *
+from sys import *
 
-print '1. Parser'
-
-print '1.1 Tokens'
-
-print '1.1.1 Backslashes'
+class TokenTests(unittest.TestCase):
 
-# Backslash means line continuation:
-x = 1 \
-+ 1
-if x != 2: raise TestFailed, 'backslash for line continuation'
-
-# Backslash does not means continuation in comments :\
-x = 0
-if x != 0: raise TestFailed, 'backslash ending comment'
-
-print '1.1.2 Numeric literals'
-
-print '1.1.2.1 Plain integers'
-if 0xff != 255: raise TestFailed, 'hex int'
-if 0377 != 255: raise TestFailed, 'octal int'
-if  2147483647   != 017777777777: raise TestFailed, 'large positive int'
-try:
-    from sys import maxint
-except ImportError:
-    maxint = 2147483647
-if maxint == 2147483647:
-    # The following test will start to fail in Python 2.4;
-    # change the 020000000000 to -020000000000
-    if -2147483647-1 != -020000000000: raise TestFailed, 'max negative int'
-    # XXX -2147483648
-    if 037777777777 < 0: raise TestFailed, 'large oct'
-    if 0xffffffff < 0: raise TestFailed, 'large hex'
-    for s in '2147483648', '040000000000', '0x100000000':
-        try:
-            x = eval(s)
-        except OverflowError:
-            print "OverflowError on huge integer literal " + repr(s)
-elif eval('maxint == 9223372036854775807'):
-    if eval('-9223372036854775807-1 != -01000000000000000000000'):
-        raise TestFailed, 'max negative int'
-    if eval('01777777777777777777777') < 0: raise TestFailed, 'large oct'
-    if eval('0xffffffffffffffff') < 0: raise TestFailed, 'large hex'
-    for s in '9223372036854775808', '02000000000000000000000', \
-             '0x10000000000000000':
-        try:
-            x = eval(s)
-        except OverflowError:
-            print "OverflowError on huge integer literal " + repr(s)
-else:
-    print 'Weird maxint value', maxint
-
-print '1.1.2.2 Long integers'
-x = 0L
-x = 0l
-x = 0xffffffffffffffffL
-x = 0xffffffffffffffffl
-x = 077777777777777777L
-x = 077777777777777777l
-x = 123456789012345678901234567890L
-x = 123456789012345678901234567890l
-
-print '1.1.2.3 Floating point'
-x = 3.14
-x = 314.
-x = 0.314
-# XXX x = 000.314
-x = .314
-x = 3e14
-x = 3E14
-x = 3e-14
-x = 3e+14
-x = 3.e14
-x = .3e14
-x = 3.1e4
-
-print '1.1.3 String literals'
-
-x = ''; y = ""; verify(len(x) == 0 and x == y)
-x = '\''; y = "'"; verify(len(x) == 1 and x == y and ord(x) == 39)
-x = '"'; y = "\""; verify(len(x) == 1 and x == y and ord(x) == 34)
-x = "doesn't \"shrink\" does it"
-y = 'doesn\'t "shrink" does it'
-verify(len(x) == 24 and x == y)
-x = "does \"shrink\" doesn't it"
-y = 'does "shrink" doesn\'t it'
-verify(len(x) == 24 and x == y)
-x = """
+    def testBackslash(self):
+        # Backslash means line continuation:
+        x = 1 \
+        + 1
+        self.assertEquals(x, 2, 'backslash for line continuation')
+
+        # Backslash does not means continuation in comments :\
+        x = 0
+        self.assertEquals(x, 0, 'backslash ending comment')
+
+    def testPlainIntegers(self):
+        self.assertEquals(0xff, 255)
+        self.assertEquals(0377, 255)
+        self.assertEquals(2147483647, 017777777777)
+        from sys import maxint
+        if maxint == 2147483647:
+            self.assertEquals(-2147483647-1, -020000000000)
+            # XXX -2147483648
+            self.assert_(037777777777 > 0)
+            self.assert_(0xffffffff > 0)
+            for s in '2147483648', '040000000000', '0x100000000':
+                try:
+                    x = eval(s)
+                except OverflowError:
+                    self.fail("OverflowError on huge integer literal %r" % s)
+        elif maxint == 9223372036854775807:
+            self.assertEquals(-9223372036854775807-1, -01000000000000000000000)
+            self.assert_(01777777777777777777777 > 0)
+            self.assert_(0xffffffffffffffff > 0)
+            for s in '9223372036854775808', '02000000000000000000000', \
+                     '0x10000000000000000':
+                try:
+                    x = eval(s)
+                except OverflowError:
+                    self.fail("OverflowError on huge integer literal %r" % s)
+        else:
+            self.fail('Weird maxint value %r' % maxint)
+
+    def testLongIntegers(self):
+        x = 0L
+        x = 0l
+        x = 0xffffffffffffffffL
+        x = 0xffffffffffffffffl
+        x = 077777777777777777L
+        x = 077777777777777777l
+        x = 123456789012345678901234567890L
+        x = 123456789012345678901234567890l
+
+    def testFloats(self):
+        x = 3.14
+        x = 314.
+        x = 0.314
+        # XXX x = 000.314
+        x = .314
+        x = 3e14
+        x = 3E14
+        x = 3e-14
+        x = 3e+14
+        x = 3.e14
+        x = .3e14
+        x = 3.1e4
+
+    def testStringLiterals(self):
+        x = ''; y = ""; self.assert_(len(x) == 0 and x == y)
+        x = '\''; y = "'"; self.assert_(len(x) == 1 and x == y and ord(x) == 39)
+        x = '"'; y = "\""; self.assert_(len(x) == 1 and x == y and ord(x) == 34)
+        x = "doesn't \"shrink\" does it"
+        y = 'doesn\'t "shrink" does it'
+        self.assert_(len(x) == 24 and x == y)
+        x = "does \"shrink\" doesn't it"
+        y = 'does "shrink" doesn\'t it'
+        self.assert_(len(x) == 24 and x == y)
+        x = """
 The "quick"
 brown fox
 jumps over
 the 'lazy' dog.
 """
-y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
-verify(x == y)
-y = '''
+        y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
+        self.assertEquals(x, y)
+        y = '''
 The "quick"
 brown fox
 jumps over
 the 'lazy' dog.
-'''; verify(x == y)
-y = "\n\
+'''
+        self.assertEquals(x, y)
+        y = "\n\
 The \"quick\"\n\
 brown fox\n\
 jumps over\n\
 the 'lazy' dog.\n\
-"; verify(x == y)
-y = '\n\
+"
+        self.assertEquals(x, y)
+        y = '\n\
 The \"quick\"\n\
 brown fox\n\
 jumps over\n\
 the \'lazy\' dog.\n\
-'; verify(x == y)
-
+'
+        self.assertEquals(x, y)
 
-print '1.2 Grammar'
+    def testEllipsis(self):
+        x = ...
+        self.assert_(x is Ellipsis)
+
+class GrammarTests(unittest.TestCase):
+
+    # single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
+    # XXX can't test in a script -- this rule is only used when interactive
+
+    # file_input: (NEWLINE | stmt)* ENDMARKER
+    # Being tested as this very moment this very module
+
+    # expr_input: testlist NEWLINE
+    # XXX Hard to test -- used only in calls to input()
+
+    def testEvalInput(self):
+        # testlist ENDMARKER
+        x = eval('1, 0 or 1')
+
+    def testFuncdef(self):
+        ### 'def' NAME parameters ':' suite
+        ### parameters: '(' [varargslist] ')'
+        ### varargslist: (fpdef ['=' test] ',')*
+        ###           ('*' (NAME|',' fpdef ['=' test]) [',' ('**'|'*' '*') NAME]
+        ###            | ('**'|'*' '*') NAME)
+        ###            | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+        ### fpdef: NAME | '(' fplist ')'
+        ### fplist: fpdef (',' fpdef)* [',']
+        ### arglist: (argument ',')* (argument | *' test [',' '**' test] | '**' test)
+        ### argument: [test '='] test   # Really [keyword '='] test
+        def f1(): pass
+        f1()
+        f1(*())
+        f1(*(), **{})
+        def f2(one_argument): pass
+        def f3(two, arguments): pass
+        def f4(two, (compound, (argument, list))): pass
+        def f5((compound, first), two): pass
+        self.assertEquals(f2.func_code.co_varnames, ('one_argument',))
+        self.assertEquals(f3.func_code.co_varnames, ('two', 'arguments'))
+        if sys.platform.startswith('java'):
+            self.assertEquals(f4.func_code.co_varnames,
+                   ('two', '(compound, (argument, list))', 'compound', 'argument',
+                                'list',))
+            self.assertEquals(f5.func_code.co_varnames,
+                   ('(compound, first)', 'two', 'compound', 'first'))
+        else:
+            self.assertEquals(f4.func_code.co_varnames,
+                  ('two', '.1', 'compound', 'argument',  'list'))
+            self.assertEquals(f5.func_code.co_varnames,
+                  ('.0', 'two', 'compound', 'first'))
+        def a1(one_arg,): pass
+        def a2(two, args,): pass
+        def v0(*rest): pass
+        def v1(a, *rest): pass
+        def v2(a, b, *rest): pass
+        def v3(a, (b, c), *rest): return a, b, c, rest
+
+        f1()
+        f2(1)
+        f2(1,)
+        f3(1, 2)
+        f3(1, 2,)
+        f4(1, (2, (3, 4)))
+        v0()
+        v0(1)
+        v0(1,)
+        v0(1,2)
+        v0(1,2,3,4,5,6,7,8,9,0)
+        v1(1)
+        v1(1,)
+        v1(1,2)
+        v1(1,2,3)
+        v1(1,2,3,4,5,6,7,8,9,0)
+        v2(1,2)
+        v2(1,2,3)
+        v2(1,2,3,4)
+        v2(1,2,3,4,5,6,7,8,9,0)
+        v3(1,(2,3))
+        v3(1,(2,3),4)
+        v3(1,(2,3),4,5,6,7,8,9,0)
+
+        # ceval unpacks the formal arguments into the first argcount names;
+        # thus, the names nested inside tuples must appear after these names.
+        if sys.platform.startswith('java'):
+            self.assertEquals(v3.func_code.co_varnames, ('a', '(b, c)', 'rest', 'b', 'c'))
+        else:
+            self.assertEquals(v3.func_code.co_varnames, ('a', '.1', 'rest', 'b', 'c'))
+        self.assertEquals(v3(1, (2, 3), 4), (1, 2, 3, (4,)))
+        def d01(a=1): pass
+        d01()
+        d01(1)
+        d01(*(1,))
+        d01(**{'a':2})
+        def d11(a, b=1): pass
+        d11(1)
+        d11(1, 2)
+        d11(1, **{'b':2})
+        def d21(a, b, c=1): pass
+        d21(1, 2)
+        d21(1, 2, 3)
+        d21(*(1, 2, 3))
+        d21(1, *(2, 3))
+        d21(1, 2, *(3,))
+        d21(1, 2, **{'c':3})
+        def d02(a=1, b=2): pass
+        d02()
+        d02(1)
+        d02(1, 2)
+        d02(*(1, 2))
+        d02(1, *(2,))
+        d02(1, **{'b':2})
+        d02(**{'a': 1, 'b': 2})
+        def d12(a, b=1, c=2): pass
+        d12(1)
+        d12(1, 2)
+        d12(1, 2, 3)
+        def d22(a, b, c=1, d=2): pass
+        d22(1, 2)
+        d22(1, 2, 3)
+        d22(1, 2, 3, 4)
+        def d01v(a=1, *rest): pass
+        d01v()
+        d01v(1)
+        d01v(1, 2)
+        d01v(*(1, 2, 3, 4))
+        d01v(*(1,))
+        d01v(**{'a':2})
+        def d11v(a, b=1, *rest): pass
+        d11v(1)
+        d11v(1, 2)
+        d11v(1, 2, 3)
+        def d21v(a, b, c=1, *rest): pass
+        d21v(1, 2)
+        d21v(1, 2, 3)
+        d21v(1, 2, 3, 4)
+        d21v(*(1, 2, 3, 4))
+        d21v(1, 2, **{'c': 3})
+        def d02v(a=1, b=2, *rest): pass
+        d02v()
+        d02v(1)
+        d02v(1, 2)
+        d02v(1, 2, 3)
+        d02v(1, *(2, 3, 4))
+        d02v(**{'a': 1, 'b': 2})
+        def d12v(a, b=1, c=2, *rest): pass
+        d12v(1)
+        d12v(1, 2)
+        d12v(1, 2, 3)
+        d12v(1, 2, 3, 4)
+        d12v(*(1, 2, 3, 4))
+        d12v(1, 2, *(3, 4, 5))
+        d12v(1, *(2,), **{'c': 3})
+        def d22v(a, b, c=1, d=2, *rest): pass
+        d22v(1, 2)
+        d22v(1, 2, 3)
+        d22v(1, 2, 3, 4)
+        d22v(1, 2, 3, 4, 5)
+        d22v(*(1, 2, 3, 4))
+        d22v(1, 2, *(3, 4, 5))
+        d22v(1, *(2, 3), **{'d': 4})
+        def d31v((x)): pass
+        d31v(1)
+        def d32v((x,)): pass
+        d32v((1,))
+        # keyword only argument tests
+        def pos0key1(*, key): return key
+        pos0key1(key=100)
+        def pos2key2(p1, p2, *, k1, k2=100): return p1,p2,k1,k2
+        pos2key2(1, 2, k1=100)
+        pos2key2(1, 2, k1=100, k2=200)
+        pos2key2(1, 2, k2=100, k1=200)
+        def pos2key2dict(p1, p2, *, k1=100, k2, **kwarg): return p1,p2,k1,k2,kwarg
+        pos2key2dict(1,2,k2=100,tokwarg1=100,tokwarg2=200)
+        pos2key2dict(1,2,tokwarg1=100,tokwarg2=200, k2=100)
+
+    def testLambdef(self):
+        ### lambdef: 'lambda' [varargslist] ':' test
+        l1 = lambda : 0
+        self.assertEquals(l1(), 0)
+        l2 = lambda : a[d] # XXX just testing the expression
+        l3 = lambda : [2 < x for x in [-1, 3, 0L]]
+        self.assertEquals(l3(), [0, 1, 0])
+        l4 = lambda x = lambda y = lambda z=1 : z : y() : x()
+        self.assertEquals(l4(), 1)
+        l5 = lambda x, y, z=2: x + y + z
+        self.assertEquals(l5(1, 2), 5)
+        self.assertEquals(l5(1, 2, 3), 6)
+        check_syntax_error(self, "lambda x: x = 2")
+        l6 = lambda x, y, *, k=20: x+y+k
+        self.assertEquals(l6(1,2), 1+2+20)
+        self.assertEquals(l6(1,2,k=10), 1+2+10)
+
+
+    ### stmt: simple_stmt | compound_stmt
+    # Tested below
+
+    def testSimpleStmt(self):
+        ### simple_stmt: small_stmt (';' small_stmt)* [';']
+        x = 1; pass; del x
+        def foo():
+            # verify statments that end with semi-colons
+            x = 1; pass; del x;
+        foo()
+
+    ### small_stmt: expr_stmt | print_stmt  | pass_stmt | del_stmt | flow_stmt | import_stmt | global_stmt | access_stmt 
+    # Tested below
+
+    def testExprStmt(self):
+        # (exprlist '=')* exprlist
+        1
+        1, 2, 3
+        x = 1
+        x = 1, 2, 3
+        x = y = z = 1, 2, 3
+        x, y, z = 1, 2, 3
+        abc = a, b, c = x, y, z = xyz = 1, 2, (3, 4)
+
+        check_syntax_error(self, "x + 1 = 1")
+        check_syntax_error(self, "a + 1 = b + 2")
+
+    def testPrintStmt(self):
+        # 'print' (test ',')* [test]
+        import StringIO
+
+        # Can't test printing to real stdout without comparing output
+        # which is not available in unittest.
+        save_stdout = sys.stdout
+        sys.stdout = StringIO.StringIO()
+
+        print 1, 2, 3
+        print 1, 2, 3,
+        print
+        print 0 or 1, 0 or 1,
+        print 0 or 1
+
+        # 'print' '>>' test ','
+        print >> sys.stdout, 1, 2, 3
+        print >> sys.stdout, 1, 2, 3,
+        print >> sys.stdout
+        print >> sys.stdout, 0 or 1, 0 or 1,
+        print >> sys.stdout, 0 or 1
+
+        # test printing to an instance
+        class Gulp:
+            def write(self, msg): pass
+
+        gulp = Gulp()
+        print >> gulp, 1, 2, 3
+        print >> gulp, 1, 2, 3,
+        print >> gulp
+        print >> gulp, 0 or 1, 0 or 1,
+        print >> gulp, 0 or 1
+
+        # test print >> None
+        def driver():
+            oldstdout = sys.stdout
+            sys.stdout = Gulp()
+            try:
+                tellme(Gulp())
+                tellme()
+            finally:
+                sys.stdout = oldstdout
+
+        # we should see this once
+        def tellme(file=sys.stdout):
+            print >> file, 'hello world'
+
+        driver()
+
+        # we should not see this at all
+        def tellme(file=None):
+            print >> file, 'goodbye universe'
+
+        driver()
+
+        self.assertEqual(sys.stdout.getvalue(), '''\
+1 2 3
+1 2 3
+1 1 1
+1 2 3
+1 2 3
+1 1 1
+hello world
+''')
+        sys.stdout = save_stdout
+
+        # syntax errors
+        check_syntax_error(self, 'print ,')
+        check_syntax_error(self, 'print >> x,')
+
+    def testDelStmt(self):
+        # 'del' exprlist
+        abc = [1,2,3]
+        x, y, z = abc
+        xyz = x, y, z
+
+        del abc
+        del x, y, (z, xyz)
+
+    def testPassStmt(self):
+        # 'pass'
+        pass
+
+    # flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt
+    # Tested below
+
+    def testBreakStmt(self):
+        # 'break'
+        while 1: break
+
+    def testContinueStmt(self):
+        # 'continue'
+        i = 1
+        while i: i = 0; continue
+
+        msg = ""
+        while not msg:
+            msg = "ok"
+            try:
+                continue
+                msg = "continue failed to continue inside try"
+            except:
+                msg = "continue inside try called except block"
+        if msg != "ok":
+            self.fail(msg)
+
+        msg = ""
+        while not msg:
+            msg = "finally block not called"
+            try:
+                continue
+            finally:
+                msg = "ok"
+        if msg != "ok":
+            self.fail(msg)
+
+    def test_break_continue_loop(self):
+        # This test warrants an explanation. It is a test specifically for SF bugs
+        # #463359 and #462937. The bug is that a 'break' statement executed or
+        # exception raised inside a try/except inside a loop, *after* a continue
+        # statement has been executed in that loop, will cause the wrong number of
+        # arguments to be popped off the stack and the instruction pointer reset to
+        # a very small number (usually 0.) Because of this, the following test
+        # *must* written as a function, and the tracking vars *must* be function
+        # arguments with default values. Otherwise, the test will loop and loop.
+
+        def test_inner(extra_burning_oil = 1, count=0):
+            big_hippo = 2
+            while big_hippo:
+                count += 1
+                try:
+                    if extra_burning_oil and big_hippo == 1:
+                        extra_burning_oil -= 1
+                        break
+                    big_hippo -= 1
+                    continue
+                except:
+                    raise
+            if count > 2 or big_hippo != 1:
+                self.fail("continue then break in try/except in loop broken!")
+        test_inner()
+
+    def testReturn(self):
+        # 'return' [testlist]
+        def g1(): return
+        def g2(): return 1
+        g1()
+        x = g2()
+        check_syntax_error(self, "class foo:return 1")
+
+    def testYield(self):
+        check_syntax_error(self, "class foo:yield 1")
+
+    def testRaise(self):
+        # 'raise' test [',' test]
+        try: raise RuntimeError, 'just testing'
+        except RuntimeError: pass
+        try: raise KeyboardInterrupt
+        except KeyboardInterrupt: pass
+
+    def testImport(self):
+        # 'import' dotted_as_names
+        import sys
+        import time, sys
+        # 'from' dotted_name 'import' ('*' | '(' import_as_names ')' | import_as_names)
+        from time import time
+        from time import (time)
+        # not testable inside a function, but already done at top of the module
+        # from sys import *
+        from sys import path, argv
+        from sys import (path, argv)
+        from sys import (path, argv,)
+
+    def testGlobal(self):
+        # 'global' NAME (',' NAME)*
+        global a
+        global a, b
+        global one, two, three, four, five, six, seven, eight, nine, ten
+
+    def testAssert(self):
+        # assert_stmt: 'assert' test [',' test]
+        assert 1
+        assert 1, 1
+        assert lambda x:x
+        assert 1, lambda x:x+1
+        try:
+            assert 0, "msg"
+        except AssertionError, e:
+            self.assertEquals(e.args[0], "msg")
+        else:
+            if __debug__:
+                self.fail("AssertionError not raised by assert 0")
+
+    ### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
+    # Tested below
+
+    def testIf(self):
+        # 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
+        if 1: pass
+        if 1: pass
+        else: pass
+        if 0: pass
+        elif 0: pass
+        if 0: pass
+        elif 0: pass
+        elif 0: pass
+        elif 0: pass
+        else: pass
+
+    def testWhile(self):
+        # 'while' test ':' suite ['else' ':' suite]
+        while 0: pass
+        while 0: pass
+        else: pass
+
+    def testFor(self):
+        # 'for' exprlist 'in' exprlist ':' suite ['else' ':' suite]
+        for i in 1, 2, 3: pass
+        for i, j, k in (): pass
+        else: pass
+        class Squares:
+            def __init__(self, max):
+                self.max = max
+                self.sofar = []
+            def __len__(self): return len(self.sofar)
+            def __getitem__(self, i):
+                if not 0 <= i < self.max: raise IndexError
+                n = len(self.sofar)
+                while n <= i:
+                    self.sofar.append(n*n)
+                    n = n+1
+                return self.sofar[i]
+        n = 0
+        for x in Squares(10): n = n+x
+        if n != 285:
+            self.fail('for over growing sequence')
+
+        result = []
+        for x, in [(1,), (2,), (3,)]:
+            result.append(x)
+        self.assertEqual(result, [1, 2, 3])
+
+    def testTry(self):
+        ### try_stmt: 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite]
+        ###         | 'try' ':' suite 'finally' ':' suite
+        ### except_clause: 'except' [expr [',' expr]]
+        try:
+            1/0
+        except ZeroDivisionError:
+            pass
+        else:
+            pass
+        try: 1/0
+        except EOFError: pass
+        except TypeError, msg: pass
+        except RuntimeError, msg: pass
+        except: pass
+        else: pass
+        try: 1/0
+        except (EOFError, TypeError, ZeroDivisionError): pass
+        try: 1/0
+        except (EOFError, TypeError, ZeroDivisionError), msg: pass
+        try: pass
+        finally: pass
+
+    def testSuite(self):
+        # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT
+        if 1: pass
+        if 1:
+            pass
+        if 1:
+            #
+            #
+            #
+            pass
+            pass
+            #
+            pass
+            #
+
+    def testTest(self):
+        ### and_test ('or' and_test)*
+        ### and_test: not_test ('and' not_test)*
+        ### not_test: 'not' not_test | comparison
+        if not 1: pass
+        if 1 and 1: pass
+        if 1 or 1: pass
+        if not not not 1: pass
+        if not 1 and 1 and 1: pass
+        if 1 and 1 or 1 and 1 and 1 or not 1 and 1: pass
+
+    def testComparison(self):
+        ### comparison: expr (comp_op expr)*
+        ### comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'|'is' 'not'
+        if 1: pass
+        x = (1 == 1)
+        if 1 == 1: pass
+        if 1 != 1: pass
+        if 1 < 1: pass
+        if 1 > 1: pass
+        if 1 <= 1: pass
+        if 1 >= 1: pass
+        if 1 is 1: pass
+        if 1 is not 1: pass
+        if 1 in (): pass
+        if 1 not in (): pass
+        if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
+
+    def testBinaryMaskOps(self):
+        x = 1 & 1
+        x = 1 ^ 1
+        x = 1 | 1
+
+    def testShiftOps(self):
+        x = 1 << 1
+        x = 1 >> 1
+        x = 1 << 1 >> 1
+
+    def testAdditiveOps(self):
+        x = 1
+        x = 1 + 1
+        x = 1 - 1 - 1
+        x = 1 - 1 + 1 - 1 + 1
+
+    def testMultiplicativeOps(self):
+        x = 1 * 1
+        x = 1 / 1
+        x = 1 % 1
+        x = 1 / 1 * 1 % 1
+
+    def testUnaryOps(self):
+        x = +1
+        x = -1
+        x = ~1
+        x = ~1 ^ 1 & 1 | 1 & 1 ^ -1
+        x = -1*1/1 + 1*1 - ---1*1
+
+    def testSelectors(self):
+        ### trailer: '(' [testlist] ')' | '[' subscript ']' | '.' NAME
+        ### subscript: expr | [expr] ':' [expr]
+
+        import sys, time
+        c = sys.path[0]
+        x = time.time()
+        x = sys.modules['time'].time()
+        a = '01234'
+        c = a[0]
+        c = a[-1]
+        s = a[0:5]
+        s = a[:5]
+        s = a[0:]
+        s = a[:]
+        s = a[-5:]
+        s = a[:-1]
+        s = a[-4:-3]
+        # A rough test of SF bug 1333982.  http://python.org/sf/1333982
+        # The testing here is fairly incomplete.
+        # Test cases should include: commas with 1 and 2 colons
+        d = {}
+        d[1] = 1
+        d[1,] = 2
+        d[1,2] = 3
+        d[1,2,3] = 4
+        L = list(d)
+        L.sort(key=lambda x: x if isinstance(x, tuple) else ())
+        self.assertEquals(str(L), '[1, (1,), (1, 2), (1, 2, 3)]')
+
+    def testAtoms(self):
+        ### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictsetmaker] '}' | NAME | NUMBER | STRING
+        ### dictsetmaker: (test ':' test (',' test ':' test)* [',']) | (test (',' test)* [','])
+
+        x = (1)
+        x = (1 or 2 or 3)
+        x = (1 or 2 or 3, 2, 3)
+
+        x = []
+        x = [1]
+        x = [1 or 2 or 3]
+        x = [1 or 2 or 3, 2, 3]
+        x = []
+
+        x = {}
+        x = {'one': 1}
+        x = {'one': 1,}
+        x = {'one' or 'two': 1 or 2}
+        x = {'one': 1, 'two': 2}
+        x = {'one': 1, 'two': 2,}
+        x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6}
+
+        x = {'one'}
+        x = {'one', 1,}
+        x = {'one', 'two', 'three'}
+        x = {2, 3, 4,}
+
+        x = x
+        x = 'x'
+        x = 123
+
+    ### exprlist: expr (',' expr)* [',']
+    ### testlist: test (',' test)* [',']
+    # These have been exercised enough above
+
+    def testClassdef(self):
+        # 'class' NAME ['(' [testlist] ')'] ':' suite
+        class B: pass
+        class B2(): pass
+        class C1(B): pass
+        class C2(B): pass
+        class D(C1, C2, B): pass
+        class C:
+            def meth1(self): pass
+            def meth2(self, arg): pass
+            def meth3(self, a1, a2): pass
+
+    def testListcomps(self):
+        # list comprehension tests
+        nums = [1, 2, 3, 4, 5]
+        strs = ["Apple", "Banana", "Coconut"]
+        spcs = ["  Apple", " Banana ", "Coco  nut  "]
+
+        self.assertEqual([s.strip() for s in spcs], ['Apple', 'Banana', 'Coco  nut'])
+        self.assertEqual([3 * x for x in nums], [3, 6, 9, 12, 15])
+        self.assertEqual([x for x in nums if x > 2], [3, 4, 5])
+        self.assertEqual([(i, s) for i in nums for s in strs],
+                         [(1, 'Apple'), (1, 'Banana'), (1, 'Coconut'),
+                          (2, 'Apple'), (2, 'Banana'), (2, 'Coconut'),
+                          (3, 'Apple'), (3, 'Banana'), (3, 'Coconut'),
+                          (4, 'Apple'), (4, 'Banana'), (4, 'Coconut'),
+                          (5, 'Apple'), (5, 'Banana'), (5, 'Coconut')])
+        self.assertEqual([(i, s) for i in nums for s in [f for f in strs if "n" in f]],
+                         [(1, 'Banana'), (1, 'Coconut'), (2, 'Banana'), (2, 'Coconut'),
+                          (3, 'Banana'), (3, 'Coconut'), (4, 'Banana'), (4, 'Coconut'),
+                          (5, 'Banana'), (5, 'Coconut')])
+        self.assertEqual([(lambda a:[a**i for i in range(a+1)])(j) for j in range(5)],
+                         [[1], [1, 1], [1, 2, 4], [1, 3, 9, 27], [1, 4, 16, 64, 256]])
+
+        def test_in_func(l):
+            return [0 < x < 3 for x in l if x > 2]
+
+        self.assertEqual(test_in_func(nums), [False, False, False])
+
+        def test_nested_front():
+            self.assertEqual([[y for y in [x, x + 1]] for x in [1,3,5]],
+                             [[1, 2], [3, 4], [5, 6]])
+
+        test_nested_front()
+
+        check_syntax_error(self, "[i, s for i in nums for s in strs]")
+        check_syntax_error(self, "[x if y]")
+
+        suppliers = [
+          (1, "Boeing"),
+          (2, "Ford"),
+          (3, "Macdonalds")
+        ]
+
+        parts = [
+          (10, "Airliner"),
+          (20, "Engine"),
+          (30, "Cheeseburger")
+        ]
+
+        suppart = [
+          (1, 10), (1, 20), (2, 20), (3, 30)
+        ]
+
+        x = [
+          (sname, pname)
+            for (sno, sname) in suppliers
+              for (pno, pname) in parts
+                for (sp_sno, sp_pno) in suppart
+                  if sno == sp_sno and pno == sp_pno
+        ]
+
+        self.assertEqual(x, [('Boeing', 'Airliner'), ('Boeing', 'Engine'), ('Ford', 'Engine'),
+                             ('Macdonalds', 'Cheeseburger')])
+
+    def testGenexps(self):
+        # generator expression tests
+        g = ([x for x in range(10)] for x in range(1))
+        self.assertEqual(g.next(), [x for x in range(10)])
+        try:
+            g.next()
+            self.fail('should produce StopIteration exception')
+        except StopIteration:
+            pass
 
-print 'single_input' # NEWLINE | simple_stmt | compound_stmt NEWLINE
-# XXX can't test in a script -- this rule is only used when interactive
+        a = 1
+        try:
+            g = (a for d in a)
+            g.next()
+            self.fail('should produce TypeError')
+        except TypeError:
+            pass
+
+        self.assertEqual(list((x, y) for x in 'abcd' for y in 'abcd'), [(x, y) for x in 'abcd' for y in 'abcd'])
+        self.assertEqual(list((x, y) for x in 'ab' for y in 'xy'), [(x, y) for x in 'ab' for y in 'xy'])
+
+        a = [x for x in range(10)]
+        b = (x for x in (y for y in a))
+        self.assertEqual(sum(b), sum([x for x in range(10)]))
+
+        self.assertEqual(sum(x**2 for x in range(10)), sum([x**2 for x in range(10)]))
+        self.assertEqual(sum(x*x for x in range(10) if x%2), sum([x*x for x in range(10) if x%2]))
+        self.assertEqual(sum(x for x in (y for y in range(10))), sum([x for x in range(10)]))
+        self.assertEqual(sum(x for x in (y for y in (z for z in range(10)))), sum([x for x in range(10)]))
+        self.assertEqual(sum(x for x in [y for y in (z for z in range(10))]), sum([x for x in range(10)]))
+        self.assertEqual(sum(x for x in (y for y in (z for z in range(10) if True)) if True), sum([x for x in range(10)]))
+        self.assertEqual(sum(x for x in (y for y in (z for z in range(10) if True) if False) if True), 0)
+        check_syntax_error(self, "foo(x for x in range(10), 100)")
+        check_syntax_error(self, "foo(100, x for x in range(10))")
+
+    def testComprehensionSpecials(self):
+        # test for outmost iterable precomputation
+        x = 10; g = (i for i in range(x)); x = 5
+        self.assertEqual(len(list(g)), 10)
+
+        # This should hold, since we're only precomputing outmost iterable.
+        x = 10; t = False; g = ((i,j) for i in range(x) if t for j in range(x))
+        x = 5; t = True;
+        self.assertEqual([(i,j) for i in range(10) for j in range(5)], list(g))
+
+        # Grammar allows multiple adjacent 'if's in listcomps and genexps,
+        # even though it's silly. Make sure it works (ifelse broke this.)
+        self.assertEqual([ x for x in range(10) if x % 2 if x % 3 ], [1, 5, 7])
+        self.assertEqual(list(x for x in range(10) if x % 2 if x % 3), [1, 5, 7])
+
+        # verify unpacking single element tuples in listcomp/genexp.
+        self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6])
+        self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9])
+
+    def testIfElseExpr(self):
+        # Test ifelse expressions in various cases
+        def _checkeval(msg, ret):
+            "helper to check that evaluation of expressions is done correctly"
+            print x
+            return ret
+
+        self.assertEqual([ x() for x in lambda: True, lambda: False if x() ], [True])
+        self.assertEqual([ x() for x in (lambda: True, lambda: False) if x() ], [True])
+        self.assertEqual([ x(False) for x in (lambda x: False if x else True, lambda x: True if x else False) if x(False) ], [True])
+        self.assertEqual((5 if 1 else _checkeval("check 1", 0)), 5)
+        self.assertEqual((_checkeval("check 2", 0) if 0 else 5), 5)
+        self.assertEqual((5 and 6 if 0 else 1), 1)
+        self.assertEqual(((5 and 6) if 0 else 1), 1)
+        self.assertEqual((5 and (6 if 1 else 1)), 6)
+        self.assertEqual((0 or _checkeval("check 3", 2) if 0 else 3), 3)
+        self.assertEqual((1 or _checkeval("check 4", 2) if 1 else _checkeval("check 5", 3)), 1)
+        self.assertEqual((0 or 5 if 1 else _checkeval("check 6", 3)), 5)
+        self.assertEqual((not 5 if 1 else 1), False)
+        self.assertEqual((not 5 if 0 else 1), 1)
+        self.assertEqual((6 + 1 if 1 else 2), 7)
+        self.assertEqual((6 - 1 if 1 else 2), 5)
+        self.assertEqual((6 * 2 if 1 else 4), 12)
+        self.assertEqual((6 / 2 if 1 else 3), 3)
+        self.assertEqual((6 < 4 if 0 else 2), 2)
 
-print 'file_input' # (NEWLINE | stmt)* ENDMARKER
-# Being tested as this very moment this very module
-
-print 'expr_input' # testlist NEWLINE
-# XXX Hard to test -- used only in calls to input()
-
-print 'eval_input' # testlist ENDMARKER
-x = eval('1, 0 or 1')
-
-print 'funcdef'
-### 'def' NAME parameters ':' suite
-### parameters: '(' [varargslist] ')'
-### varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' ('**'|'*' '*') NAME]
-###            | ('**'|'*' '*') NAME)
-###            | fpdef ['=' test] (',' fpdef ['=' test])* [',']
-### fpdef: NAME | '(' fplist ')'
-### fplist: fpdef (',' fpdef)* [',']
-### arglist: (argument ',')* (argument | *' test [',' '**' test] | '**' test)
-### argument: [test '='] test   # Really [keyword '='] test
-def f1(): pass
-f1()
-f1(*())
-f1(*(), **{})
-def f2(one_argument): pass
-def f3(two, arguments): pass
-def f4(two, (compound, (argument, list))): pass
-def f5((compound, first), two): pass
-vereq(f2.func_code.co_varnames, ('one_argument',))
-vereq(f3.func_code.co_varnames, ('two', 'arguments'))
-if sys.platform.startswith('java'):
-    vereq(f4.func_code.co_varnames,
-           ('two', '(compound, (argument, list))', 'compound', 'argument',
-                        'list',))
-    vereq(f5.func_code.co_varnames,
-           ('(compound, first)', 'two', 'compound', 'first'))
-else:
-    vereq(f4.func_code.co_varnames,
-          ('two', '.1', 'compound', 'argument',  'list'))
-    vereq(f5.func_code.co_varnames,
-          ('.0', 'two', 'compound', 'first'))
-def a1(one_arg,): pass
-def a2(two, args,): pass
-def v0(*rest): pass
-def v1(a, *rest): pass
-def v2(a, b, *rest): pass
-def v3(a, (b, c), *rest): return a, b, c, rest
-# ceval unpacks the formal arguments into the first argcount names;
-# thus, the names nested inside tuples must appear after these names.
-if sys.platform.startswith('java'):
-    verify(v3.func_code.co_varnames == ('a', '(b, c)', 'rest', 'b', 'c'))
-else:
-    vereq(v3.func_code.co_varnames, ('a', '.1', 'rest', 'b', 'c'))
-verify(v3(1, (2, 3), 4) == (1, 2, 3, (4,)))
-def d01(a=1): pass
-d01()
-d01(1)
-d01(*(1,))
-d01(**{'a':2})
-def d11(a, b=1): pass
-d11(1)
-d11(1, 2)
-d11(1, **{'b':2})
-def d21(a, b, c=1): pass
-d21(1, 2)
-d21(1, 2, 3)
-d21(*(1, 2, 3))
-d21(1, *(2, 3))
-d21(1, 2, *(3,))
-d21(1, 2, **{'c':3})
-def d02(a=1, b=2): pass
-d02()
-d02(1)
-d02(1, 2)
-d02(*(1, 2))
-d02(1, *(2,))
-d02(1, **{'b':2})
-d02(**{'a': 1, 'b': 2})
-def d12(a, b=1, c=2): pass
-d12(1)
-d12(1, 2)
-d12(1, 2, 3)
-def d22(a, b, c=1, d=2): pass
-d22(1, 2)
-d22(1, 2, 3)
-d22(1, 2, 3, 4)
-def d01v(a=1, *rest): pass
-d01v()
-d01v(1)
-d01v(1, 2)
-d01v(*(1, 2, 3, 4))
-d01v(*(1,))
-d01v(**{'a':2})
-def d11v(a, b=1, *rest): pass
-d11v(1)
-d11v(1, 2)
-d11v(1, 2, 3)
-def d21v(a, b, c=1, *rest): pass
-d21v(1, 2)
-d21v(1, 2, 3)
-d21v(1, 2, 3, 4)
-d21v(*(1, 2, 3, 4))
-d21v(1, 2, **{'c': 3})
-def d02v(a=1, b=2, *rest): pass
-d02v()
-d02v(1)
-d02v(1, 2)
-d02v(1, 2, 3)
-d02v(1, *(2, 3, 4))
-d02v(**{'a': 1, 'b': 2})
-def d12v(a, b=1, c=2, *rest): pass
-d12v(1)
-d12v(1, 2)
-d12v(1, 2, 3)
-d12v(1, 2, 3, 4)
-d12v(*(1, 2, 3, 4))
-d12v(1, 2, *(3, 4, 5))
-d12v(1, *(2,), **{'c': 3})
-def d22v(a, b, c=1, d=2, *rest): pass
-d22v(1, 2)
-d22v(1, 2, 3)
-d22v(1, 2, 3, 4)
-d22v(1, 2, 3, 4, 5)
-d22v(*(1, 2, 3, 4))
-d22v(1, 2, *(3, 4, 5))
-d22v(1, *(2, 3), **{'d': 4})
-def d31v((x)): pass
-d31v(1)
-def d32v((x,)): pass
-d32v((1,))
-
-### lambdef: 'lambda' [varargslist] ':' test
-print 'lambdef'
-l1 = lambda : 0
-verify(l1() == 0)
-l2 = lambda : a[d] # XXX just testing the expression
-l3 = lambda : [2 < x for x in [-1, 3, 0L]]
-verify(l3() == [0, 1, 0])
-l4 = lambda x = lambda y = lambda z=1 : z : y() : x()
-verify(l4() == 1)
-l5 = lambda x, y, z=2: x + y + z
-verify(l5(1, 2) == 5)
-verify(l5(1, 2, 3) == 6)
-check_syntax("lambda x: x = 2")
-
-### stmt: simple_stmt | compound_stmt
-# Tested below
-
-### simple_stmt: small_stmt (';' small_stmt)* [';']
-print 'simple_stmt'
-x = 1; pass; del x
-def foo():
-    # verify statments that end with semi-colons
-    x = 1; pass; del x;
-foo()
-
-### small_stmt: expr_stmt | print_stmt  | pass_stmt | del_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
-# Tested below
-
-print 'expr_stmt' # (exprlist '=')* exprlist
-1
-1, 2, 3
-x = 1
-x = 1, 2, 3
-x = y = z = 1, 2, 3
-x, y, z = 1, 2, 3
-abc = a, b, c = x, y, z = xyz = 1, 2, (3, 4)
-# NB these variables are deleted below
-
-check_syntax("x + 1 = 1")
-check_syntax("a + 1 = b + 2")
-
-print 'print_stmt' # 'print' (test ',')* [test]
-print 1, 2, 3
-print 1, 2, 3,
-print
-print 0 or 1, 0 or 1,
-print 0 or 1
 
-print 'extended print_stmt' # 'print' '>>' test ','
-import sys
-print >> sys.stdout, 1, 2, 3
-print >> sys.stdout, 1, 2, 3,
-print >> sys.stdout
-print >> sys.stdout, 0 or 1, 0 or 1,
-print >> sys.stdout, 0 or 1
-
-# test printing to an instance
-class Gulp:
-    def write(self, msg): pass
-
-gulp = Gulp()
-print >> gulp, 1, 2, 3
-print >> gulp, 1, 2, 3,
-print >> gulp
-print >> gulp, 0 or 1, 0 or 1,
-print >> gulp, 0 or 1
-
-# test print >> None
-def driver():
-    oldstdout = sys.stdout
-    sys.stdout = Gulp()
-    try:
-        tellme(Gulp())
-        tellme()
-    finally:
-        sys.stdout = oldstdout
-
-# we should see this once
-def tellme(file=sys.stdout):
-    print >> file, 'hello world'
-
-driver()
-
-# we should not see this at all
-def tellme(file=None):
-    print >> file, 'goodbye universe'
-
-driver()
-
-# syntax errors
-check_syntax('print ,')
-check_syntax('print >> x,')
-
-print 'del_stmt' # 'del' exprlist
-del abc
-del x, y, (z, xyz)
-
-print 'pass_stmt' # 'pass'
-pass
-
-print 'flow_stmt' # break_stmt | continue_stmt | return_stmt | raise_stmt
-# Tested below
-
-print 'break_stmt' # 'break'
-while 1: break
-
-print 'continue_stmt' # 'continue'
-i = 1
-while i: i = 0; continue
-
-msg = ""
-while not msg:
-    msg = "continue + try/except ok"
-    try:
-        continue
-        msg = "continue failed to continue inside try"
-    except:
-        msg = "continue inside try called except block"
-print msg
-
-msg = ""
-while not msg:
-    msg = "finally block not called"
-    try:
-        continue
-    finally:
-        msg = "continue + try/finally ok"
-print msg
-
-
-# This test warrants an explanation. It is a test specifically for SF bugs
-# #463359 and #462937. The bug is that a 'break' statement executed or
-# exception raised inside a try/except inside a loop, *after* a continue
-# statement has been executed in that loop, will cause the wrong number of
-# arguments to be popped off the stack and the instruction pointer reset to
-# a very small number (usually 0.) Because of this, the following test
-# *must* written as a function, and the tracking vars *must* be function
-# arguments with default values. Otherwise, the test will loop and loop.
-
-print "testing continue and break in try/except in loop"
-def test_break_continue_loop(extra_burning_oil = 1, count=0):
-    big_hippo = 2
-    while big_hippo:
-        count += 1
-        try:
-            if extra_burning_oil and big_hippo == 1:
-                extra_burning_oil -= 1
-                break
-            big_hippo -= 1
-            continue
-        except:
-            raise
-    if count > 2 or big_hippo <> 1:
-        print "continue then break in try/except in loop broken!"
-test_break_continue_loop()
-
-print 'return_stmt' # 'return' [testlist]
-def g1(): return
-def g2(): return 1
-g1()
-x = g2()
-check_syntax("class foo:return 1")
-
-print 'yield_stmt'
-check_syntax("class foo:yield 1")
-
-print 'raise_stmt' # 'raise' test [',' test]
-try: raise RuntimeError, 'just testing'
-except RuntimeError: pass
-try: raise KeyboardInterrupt
-except KeyboardInterrupt: pass
+def test_main():
+    run_unittest(TokenTests, GrammarTests)
 
-print 'import_name' # 'import' dotted_as_names
-import sys
-import time, sys
-print 'import_from' # 'from' dotted_name 'import' ('*' | '(' import_as_names ')' | import_as_names)
-from time import time
-from time import (time)
-from sys import *
-from sys import path, argv
-from sys import (path, argv)
-from sys import (path, argv,)
-
-print 'global_stmt' # 'global' NAME (',' NAME)*
-def f():
-    global a
-    global a, b
-    global one, two, three, four, five, six, seven, eight, nine, ten
-
-print 'exec_stmt' # 'exec' expr ['in' expr [',' expr]]
-def f():
-    z = None
-    del z
-    exec 'z=1+1\n'
-    if z != 2: raise TestFailed, 'exec \'z=1+1\'\\n'
-    del z
-    exec 'z=1+1'
-    if z != 2: raise TestFailed, 'exec \'z=1+1\''
-    z = None
-    del z
-    import types
-    if hasattr(types, "UnicodeType"):
-        exec r"""if 1:
-    exec u'z=1+1\n'
-    if z != 2: raise TestFailed, 'exec u\'z=1+1\'\\n'
-    del z
-    exec u'z=1+1'
-    if z != 2: raise TestFailed, 'exec u\'z=1+1\''
-"""
-f()
-g = {}
-exec 'z = 1' in g
-if '__builtins__' in g: del g['__builtins__']
-if g != {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
-g = {}
-l = {}
-
-import warnings
-warnings.filterwarnings("ignore", "global statement", module="<string>")
-exec 'global a; a = 1; b = 2' in g, l
-if '__builtins__' in g: del g['__builtins__']
-if '__builtins__' in l: del l['__builtins__']
-if (g, l) != ({'a':1}, {'b':2}): raise TestFailed, 'exec ... in g (%s), l (%s)' %(g,l)
-
-
-print "assert_stmt" # assert_stmt: 'assert' test [',' test]
-assert 1
-assert 1, 1
-assert lambda x:x
-assert 1, lambda x:x+1
-
-### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
-# Tested below
-
-print 'if_stmt' # 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
-if 1: pass
-if 1: pass
-else: pass
-if 0: pass
-elif 0: pass
-if 0: pass
-elif 0: pass
-elif 0: pass
-elif 0: pass
-else: pass
-
-print 'while_stmt' # 'while' test ':' suite ['else' ':' suite]
-while 0: pass
-while 0: pass
-else: pass
-
-print 'for_stmt' # 'for' exprlist 'in' exprlist ':' suite ['else' ':' suite]
-for i in 1, 2, 3: pass
-for i, j, k in (): pass
-else: pass
-class Squares:
-    def __init__(self, max):
-        self.max = max
-        self.sofar = []
-    def __len__(self): return len(self.sofar)
-    def __getitem__(self, i):
-        if not 0 <= i < self.max: raise IndexError
-        n = len(self.sofar)
-        while n <= i:
-            self.sofar.append(n*n)
-            n = n+1
-        return self.sofar[i]
-n = 0
-for x in Squares(10): n = n+x
-if n != 285: raise TestFailed, 'for over growing sequence'
-
-result = []
-for x, in [(1,), (2,), (3,)]:
-    result.append(x)
-vereq(result, [1, 2, 3])
-
-print 'try_stmt'
-### try_stmt: 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite]
-###         | 'try' ':' suite 'finally' ':' suite
-### except_clause: 'except' [expr [',' expr]]
-try:
-    1/0
-except ZeroDivisionError:
-    pass
-else:
-    pass
-try: 1/0
-except EOFError: pass
-except TypeError, msg: pass
-except RuntimeError, msg: pass
-except: pass
-else: pass
-try: 1/0
-except (EOFError, TypeError, ZeroDivisionError): pass
-try: 1/0
-except (EOFError, TypeError, ZeroDivisionError), msg: pass
-try: pass
-finally: pass
-
-print 'suite' # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT
-if 1: pass
-if 1:
-    pass
-if 1:
-    #
-    #
-    #
-    pass
-    pass
-    #
-    pass
-    #
-
-print 'test'
-### and_test ('or' and_test)*
-### and_test: not_test ('and' not_test)*
-### not_test: 'not' not_test | comparison
-if not 1: pass
-if 1 and 1: pass
-if 1 or 1: pass
-if not not not 1: pass
-if not 1 and 1 and 1: pass
-if 1 and 1 or 1 and 1 and 1 or not 1 and 1: pass
-
-print 'comparison'
-### comparison: expr (comp_op expr)*
-### comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
-if 1: pass
-x = (1 == 1)
-if 1 == 1: pass
-if 1 != 1: pass
-if 1 <> 1: pass
-if 1 < 1: pass
-if 1 > 1: pass
-if 1 <= 1: pass
-if 1 >= 1: pass
-if 1 is 1: pass
-if 1 is not 1: pass
-if 1 in (): pass
-if 1 not in (): pass
-if 1 < 1 > 1 == 1 >= 1 <= 1 <> 1 != 1 in 1 not in 1 is 1 is not 1: pass
-
-print 'binary mask ops'
-x = 1 & 1
-x = 1 ^ 1
-x = 1 | 1
-
-print 'shift ops'
-x = 1 << 1
-x = 1 >> 1
-x = 1 << 1 >> 1
-
-print 'additive ops'
-x = 1
-x = 1 + 1
-x = 1 - 1 - 1
-x = 1 - 1 + 1 - 1 + 1
-
-print 'multiplicative ops'
-x = 1 * 1
-x = 1 / 1
-x = 1 % 1
-x = 1 / 1 * 1 % 1
-
-print 'unary ops'
-x = +1
-x = -1
-x = ~1
-x = ~1 ^ 1 & 1 | 1 & 1 ^ -1
-x = -1*1/1 + 1*1 - ---1*1
-
-print 'selectors'
-### trailer: '(' [testlist] ')' | '[' subscript ']' | '.' NAME
-### subscript: expr | [expr] ':' [expr]
-f1()
-f2(1)
-f2(1,)
-f3(1, 2)
-f3(1, 2,)
-f4(1, (2, (3, 4)))
-v0()
-v0(1)
-v0(1,)
-v0(1,2)
-v0(1,2,3,4,5,6,7,8,9,0)
-v1(1)
-v1(1,)
-v1(1,2)
-v1(1,2,3)
-v1(1,2,3,4,5,6,7,8,9,0)
-v2(1,2)
-v2(1,2,3)
-v2(1,2,3,4)
-v2(1,2,3,4,5,6,7,8,9,0)
-v3(1,(2,3))
-v3(1,(2,3),4)
-v3(1,(2,3),4,5,6,7,8,9,0)
-print
-import sys, time
-c = sys.path[0]
-x = time.time()
-x = sys.modules['time'].time()
-a = '01234'
-c = a[0]
-c = a[-1]
-s = a[0:5]
-s = a[:5]
-s = a[0:]
-s = a[:]
-s = a[-5:]
-s = a[:-1]
-s = a[-4:-3]
-# A rough test of SF bug 1333982.  http://python.org/sf/1333982
-# The testing here is fairly incomplete.
-# Test cases should include: commas with 1 and 2 colons
-d = {}
-d[1] = 1
-d[1,] = 2
-d[1,2] = 3
-d[1,2,3] = 4
-L = list(d)
-L.sort()
-print L
-
-
-print 'atoms'
-### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING
-### dictmaker: test ':' test (',' test ':' test)* [',']
-
-x = (1)
-x = (1 or 2 or 3)
-x = (1 or 2 or 3, 2, 3)
-
-x = []
-x = [1]
-x = [1 or 2 or 3]
-x = [1 or 2 or 3, 2, 3]
-x = []
-
-x = {}
-x = {'one': 1}
-x = {'one': 1,}
-x = {'one' or 'two': 1 or 2}
-x = {'one': 1, 'two': 2}
-x = {'one': 1, 'two': 2,}
-x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6}
-
-x = `x`
-x = `1 or 2 or 3`
-x = x
-x = 'x'
-x = 123
-
-### exprlist: expr (',' expr)* [',']
-### testlist: test (',' test)* [',']
-# These have been exercised enough above
-
-print 'classdef' # 'class' NAME ['(' [testlist] ')'] ':' suite
-class B: pass
-class B2(): pass
-class C1(B): pass
-class C2(B): pass
-class D(C1, C2, B): pass
-class C:
-    def meth1(self): pass
-    def meth2(self, arg): pass
-    def meth3(self, a1, a2): pass
-
-# list comprehension tests
-nums = [1, 2, 3, 4, 5]
-strs = ["Apple", "Banana", "Coconut"]
-spcs = ["  Apple", " Banana ", "Coco  nut  "]
-
-print [s.strip() for s in spcs]
-print [3 * x for x in nums]
-print [x for x in nums if x > 2]
-print [(i, s) for i in nums for s in strs]
-print [(i, s) for i in nums for s in [f for f in strs if "n" in f]]
-print [(lambda a:[a**i for i in range(a+1)])(j) for j in range(5)]
-
-def test_in_func(l):
-    return [None < x < 3 for x in l if x > 2]
-
-print test_in_func(nums)
-
-def test_nested_front():
-    print [[y for y in [x, x + 1]] for x in [1,3,5]]
-
-test_nested_front()
-
-check_syntax("[i, s for i in nums for s in strs]")
-check_syntax("[x if y]")
-
-suppliers = [
-  (1, "Boeing"),
-  (2, "Ford"),
-  (3, "Macdonalds")
-]
-
-parts = [
-  (10, "Airliner"),
-  (20, "Engine"),
-  (30, "Cheeseburger")
-]
-
-suppart = [
-  (1, 10), (1, 20), (2, 20), (3, 30)
-]
-
-print [
-  (sname, pname)
-    for (sno, sname) in suppliers
-      for (pno, pname) in parts
-        for (sp_sno, sp_pno) in suppart
-          if sno == sp_sno and pno == sp_pno
-]
-
-# generator expression tests
-g = ([x for x in range(10)] for x in range(1))
-verify(g.next() == [x for x in range(10)])
-try:
-    g.next()
-    raise TestFailed, 'should produce StopIteration exception'
-except StopIteration:
-    pass
-
-a = 1
-try:
-    g = (a for d in a)
-    g.next()
-    raise TestFailed, 'should produce TypeError'
-except TypeError:
-    pass
-
-verify(list((x, y) for x in 'abcd' for y in 'abcd') == [(x, y) for x in 'abcd' for y in 'abcd'])
-verify(list((x, y) for x in 'ab' for y in 'xy') == [(x, y) for x in 'ab' for y in 'xy'])
-
-a = [x for x in range(10)]
-b = (x for x in (y for y in a))
-verify(sum(b) == sum([x for x in range(10)]))
-
-verify(sum(x**2 for x in range(10)) == sum([x**2 for x in range(10)]))
-verify(sum(x*x for x in range(10) if x%2) == sum([x*x for x in range(10) if x%2]))
-verify(sum(x for x in (y for y in range(10))) == sum([x for x in range(10)]))
-verify(sum(x for x in (y for y in (z for z in range(10)))) == sum([x for x in range(10)]))
-verify(sum(x for x in [y for y in (z for z in range(10))]) == sum([x for x in range(10)]))
-verify(sum(x for x in (y for y in (z for z in range(10) if True)) if True) == sum([x for x in range(10)]))
-verify(sum(x for x in (y for y in (z for z in range(10) if True) if False) if True) == 0)
-check_syntax("foo(x for x in range(10), 100)")
-check_syntax("foo(100, x for x in range(10))")
-
-# test for outmost iterable precomputation
-x = 10; g = (i for i in range(x)); x = 5
-verify(len(list(g)) == 10)
-
-# This should hold, since we're only precomputing outmost iterable.
-x = 10; t = False; g = ((i,j) for i in range(x) if t for j in range(x))
-x = 5; t = True;
-verify([(i,j) for i in range(10) for j in range(5)] == list(g))
-
-# Grammar allows multiple adjacent 'if's in listcomps and genexps,
-# even though it's silly. Make sure it works (ifelse broke this.)
-verify([ x for x in range(10) if x % 2 if x % 3 ], [1, 5, 7])
-verify((x for x in range(10) if x % 2 if x % 3), [1, 5, 7])
-
-# Test ifelse expressions in various cases
-def _checkeval(msg, ret):
-    "helper to check that evaluation of expressions is done correctly"
-    print x
-    return ret
-
-verify([ x() for x in lambda: True, lambda: False if x() ] == [True])
-verify([ x() for x in (lambda: True, lambda: False) if x() ] == [True])
-verify([ x(False) for x in (lambda x: False if x else True, lambda x: True if x else False) if x(False) ] == [True])
-verify((5 if 1 else _checkeval("check 1", 0)) == 5)
-verify((_checkeval("check 2", 0) if 0 else 5) == 5)
-verify((5 and 6 if 0 else 1) == 1)
-verify(((5 and 6) if 0 else 1) == 1)
-verify((5 and (6 if 1 else 1)) == 6)
-verify((0 or _checkeval("check 3", 2) if 0 else 3) == 3)
-verify((1 or _checkeval("check 4", 2) if 1 else _checkeval("check 5", 3)) == 1)
-verify((0 or 5 if 1 else _checkeval("check 6", 3)) == 5)
-verify((not 5 if 1 else 1) == False)
-verify((not 5 if 0 else 1) == 1)
-verify((6 + 1 if 1 else 2) == 7)
-verify((6 - 1 if 1 else 2) == 5)
-verify((6 * 2 if 1 else 4) == 12)
-verify((6 / 2 if 1 else 3) == 3)
-verify((6 < 4 if 0 else 2) == 2)
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_gzip.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_gzip.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_gzip.py	Fri Dec 15 05:21:50 2006
@@ -128,6 +128,17 @@
             f.seek(newpos)  # positive seek
         f.close()
 
+    def test_seek_whence(self):
+        self.test_write()
+        # Try seek(whence=1), read test
+
+        f = gzip.GzipFile(self.filename)
+        f.read(10)
+        f.seek(10, whence=1)
+        y = f.read(10)
+        f.close()
+        self.assertEquals(y, data1[20:30])
+        
     def test_seek_write(self):
         # Try seek, write test
         f = gzip.GzipFile(self.filename, 'w')

Modified: python/branches/p3yk-noslice/Lib/test/test_heapq.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_heapq.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_heapq.py	Fri Dec 15 05:21:50 2006
@@ -136,6 +136,7 @@
     "Dummy element that always raises an error during comparison"
     def __cmp__(self, other):
         raise ZeroDivisionError
+    __eq__ = __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __cmp__
 
 def R(seqn):
     'Regular generator'
@@ -253,7 +254,7 @@
 
     def test_iterable_args(self):
         for f in  (nlargest, nsmallest):
-            for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
+            for s in ("123", "", range(1000), (1, 1.2), xrange(2000,2200,5)):
                 for g in (G, I, Ig, L, R):
                     self.assertEqual(f(2, g(s)), f(2,s))
                 self.assertEqual(f(2, S(s)), [])

Modified: python/branches/p3yk-noslice/Lib/test/test_httplib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_httplib.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_httplib.py	Fri Dec 15 05:21:50 2006
@@ -10,9 +10,10 @@
     def __init__(self, text, fileclass=StringIO.StringIO):
         self.text = text
         self.fileclass = fileclass
+        self.data = ''
 
     def sendall(self, data):
-        self.data = data
+        self.data += data
 
     def makefile(self, mode, bufsize=None):
         if mode != 'r' and mode != 'rb':
@@ -70,103 +71,86 @@
                 conn.request('POST', '/', body, headers)
                 self.assertEqual(conn._buffer.count[header.lower()], 1)
 
-# Collect output to a buffer so that we don't have to cope with line-ending
-# issues across platforms.  Specifically, the headers will have \r\n pairs
-# and some platforms will strip them from the output file.
-
-def test():
-    buf = StringIO.StringIO()
-    _stdout = sys.stdout
-    try:
-        sys.stdout = buf
-        _test()
-    finally:
-        sys.stdout = _stdout
-
-    # print individual lines with endings stripped
-    s = buf.getvalue()
-    for line in s.split("\n"):
-        print line.strip()
-
-def _test():
-    # Test HTTP status lines
-
-    body = "HTTP/1.1 200 Ok\r\n\r\nText"
-    sock = FakeSocket(body)
-    resp = httplib.HTTPResponse(sock, 1)
-    resp.begin()
-    print resp.read()
-    resp.close()
-
-    body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText"
-    sock = FakeSocket(body)
-    resp = httplib.HTTPResponse(sock, 1)
-    try:
+class BasicTest(TestCase):
+    def test_status_lines(self):
+        # Test HTTP status lines
+
+        body = "HTTP/1.1 200 Ok\r\n\r\nText"
+        sock = FakeSocket(body)
+        resp = httplib.HTTPResponse(sock)
         resp.begin()
-    except httplib.BadStatusLine:
-        print "BadStatusLine raised as expected"
-    else:
-        print "Expect BadStatusLine"
-
-    # Check invalid host_port
-
-    for hp in ("www.python.org:abc", "www.python.org:"):
-        try:
-            h = httplib.HTTP(hp)
-        except httplib.InvalidURL:
-            print "InvalidURL raised as expected"
-        else:
-            print "Expect InvalidURL"
-
-    for hp,h,p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b", 8000),
-                   ("www.python.org:80", "www.python.org", 80),
-                   ("www.python.org", "www.python.org", 80),
-                   ("[fe80::207:e9ff:fe9b]", "fe80::207:e9ff:fe9b", 80)):
-        try:
-            http = httplib.HTTP(hp)
-        except httplib.InvalidURL:
-            print "InvalidURL raised erroneously"
-        c = http._conn
-        if h != c.host: raise AssertionError, ("Host incorrectly parsed", h, c.host)
-        if p != c.port: raise AssertionError, ("Port incorrectly parsed", p, c.host)
-
-    # test response with multiple message headers with the same field name.
-    text = ('HTTP/1.1 200 OK\r\n'
-            'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n'
-            'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";'
-            ' Path="/acme"\r\n'
-            '\r\n'
-            'No body\r\n')
-    hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"'
-           ', '
-           'Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"')
-    s = FakeSocket(text)
-    r = httplib.HTTPResponse(s, 1)
-    r.begin()
-    cookies = r.getheader("Set-Cookie")
-    if cookies != hdr:
-        raise AssertionError, "multiple headers not combined properly"
-
-    # Test that the library doesn't attempt to read any data
-    # from a HEAD request.  (Tickles SF bug #622042.)
-    sock = FakeSocket(
-        'HTTP/1.1 200 OK\r\n'
-        'Content-Length: 14432\r\n'
-        '\r\n',
-        NoEOFStringIO)
-    resp = httplib.HTTPResponse(sock, 1, method="HEAD")
-    resp.begin()
-    if resp.read() != "":
-        raise AssertionError, "Did not expect response from HEAD request"
-    resp.close()
+        self.assertEqual(resp.read(), 'Text')
+        resp.close()
 
+        body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText"
+        sock = FakeSocket(body)
+        resp = httplib.HTTPResponse(sock)
+        self.assertRaises(httplib.BadStatusLine, resp.begin)
+
+    def test_host_port(self):
+        # Check invalid host_port
+
+        for hp in ("www.python.org:abc", "www.python.org:"):
+            self.assertRaises(httplib.InvalidURL, httplib.HTTP, hp)
+
+        for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b", 8000),
+                         ("www.python.org:80", "www.python.org", 80),
+                         ("www.python.org", "www.python.org", 80),
+                         ("[fe80::207:e9ff:fe9b]", "fe80::207:e9ff:fe9b", 80)):
+            http = httplib.HTTP(hp)
+            c = http._conn
+            if h != c.host: self.fail("Host incorrectly parsed: %s != %s" % (h, c.host))
+            if p != c.port: self.fail("Port incorrectly parsed: %s != %s" % (p, c.host))
+
+    def test_response_headers(self):
+        # test response with multiple message headers with the same field name.
+        text = ('HTTP/1.1 200 OK\r\n'
+                'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n'
+                'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";'
+                ' Path="/acme"\r\n'
+                '\r\n'
+                'No body\r\n')
+        hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"'
+               ', '
+               'Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"')
+        s = FakeSocket(text)
+        r = httplib.HTTPResponse(s)
+        r.begin()
+        cookies = r.getheader("Set-Cookie")
+        if cookies != hdr:
+            self.fail("multiple headers not combined properly")
+
+    def test_read_head(self):
+        # Test that the library doesn't attempt to read any data
+        # from a HEAD request.  (Tickles SF bug #622042.)
+        sock = FakeSocket(
+            'HTTP/1.1 200 OK\r\n'
+            'Content-Length: 14432\r\n'
+            '\r\n',
+            NoEOFStringIO)
+        resp = httplib.HTTPResponse(sock, method="HEAD")
+        resp.begin()
+        if resp.read() != "":
+            self.fail("Did not expect response from HEAD request")
+        resp.close()
+
+    def test_send_file(self):
+        expected = 'GET /foo HTTP/1.1\r\nHost: example.com\r\n' \
+                   'Accept-Encoding: identity\r\nContent-Length:'
+
+        body = open(__file__, 'rb')
+        conn = httplib.HTTPConnection('example.com')
+        sock = FakeSocket(body)
+        conn.sock = sock
+        conn.request('GET', '/foo', body)
+        self.assertTrue(sock.data.startswith(expected))
 
 class OfflineTest(TestCase):
     def test_responses(self):
         self.assertEquals(httplib.responses[httplib.NOT_FOUND], "Not Found")
 
 def test_main(verbose=None):
-    tests = [HeaderTests,OfflineTest]
-    test_support.run_unittest(*tests)
+    test_support.run_unittest(HeaderTests, OfflineTest, BasicTest)
 
-test()
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_imp.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_imp.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_imp.py	Fri Dec 15 05:21:50 2006
@@ -1,43 +1,47 @@
 import imp
-from test.test_support import TestFailed, TestSkipped
-try:
-    import thread
-except ImportError:
-    raise TestSkipped("test only valid when thread support is available")
-
-def verify_lock_state(expected):
-    if imp.lock_held() != expected:
-        raise TestFailed("expected imp.lock_held() to be %r" % expected)
-
-def testLock():
-    LOOPS = 50
-
-    # The import lock may already be held, e.g. if the test suite is run
-    # via "import test.autotest".
-    lock_held_at_start = imp.lock_held()
-    verify_lock_state(lock_held_at_start)
-
-    for i in range(LOOPS):
-        imp.acquire_lock()
-        verify_lock_state(True)
+import thread
+import unittest
+from test import test_support
 
-    for i in range(LOOPS):
-        imp.release_lock()
 
-    # The original state should be restored now.
-    verify_lock_state(lock_held_at_start)
+class LockTests(unittest.TestCase):
 
-    if not lock_held_at_start:
-        try:
+    """Very basic test of import lock functions."""
+
+    def verify_lock_state(self, expected):
+        self.failUnlessEqual(imp.lock_held(), expected,
+                             "expected imp.lock_held() to be %r" % expected)
+    def testLock(self):
+        LOOPS = 50
+
+        # The import lock may already be held, e.g. if the test suite is run
+        # via "import test.autotest".
+        lock_held_at_start = imp.lock_held()
+        self.verify_lock_state(lock_held_at_start)
+
+        for i in range(LOOPS):
+            imp.acquire_lock()
+            self.verify_lock_state(True)
+
+        for i in range(LOOPS):
             imp.release_lock()
-        except RuntimeError:
-            pass
-        else:
-            raise TestFailed("release_lock() without lock should raise "
-                             "RuntimeError")
+
+        # The original state should be restored now.
+        self.verify_lock_state(lock_held_at_start)
+
+        if not lock_held_at_start:
+            try:
+                imp.release_lock()
+            except RuntimeError:
+                pass
+            else:
+                self.fail("release_lock() without lock should raise "
+                            "RuntimeError")
 
 def test_main():
-    testLock()
+    test_support.run_unittest(
+                LockTests,
+            )
 
 if __name__ == "__main__":
     test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_import.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_import.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_import.py	Fri Dec 15 05:21:50 2006
@@ -1,21 +1,11 @@
-from test.test_support import TESTFN, TestFailed
+from test.test_support import TESTFN, run_unittest
 
+import unittest
 import os
 import random
 import sys
 import py_compile
 
-# Brief digression to test that import is case-sensitive:  if we got this
-# far, we know for sure that "random" exists.
-try:
-    import RAnDoM
-except ImportError:
-    pass
-else:
-    raise TestFailed("import of RAnDoM should have failed (case mismatch)")
-
-# Another brief digression to test the accuracy of manifest float constants.
-from test import double_const  # don't blink -- that *was* the test
 
 def remove_files(name):
     for f in (name + os.extsep + "py",
@@ -26,199 +16,206 @@
         if os.path.exists(f):
             os.remove(f)
 
-def test_with_extension(ext): # ext normally ".py"; perhaps ".pyw"
-    source = TESTFN + ext
-    pyo = TESTFN + os.extsep + "pyo"
-    if sys.platform.startswith('java'):
-        pyc = TESTFN + "$py.class"
-    else:
-        pyc = TESTFN + os.extsep + "pyc"
-
-    f = open(source, "w")
-    print >> f, "# This tests Python's ability to import a", ext, "file."
-    a = random.randrange(1000)
-    b = random.randrange(1000)
-    print >> f, "a =", a
-    print >> f, "b =", b
-    f.close()
-
-    try:
-        try:
-            mod = __import__(TESTFN)
-        except ImportError, err:
-            raise ValueError("import from %s failed: %s" % (ext, err))
 
-        if mod.a != a or mod.b != b:
-            print a, "!=", mod.a
-            print b, "!=", mod.b
-            raise ValueError("module loaded (%s) but contents invalid" % mod)
-    finally:
-        os.unlink(source)
+class ImportTest(unittest.TestCase):
 
-    try:
+    def testCaseSensitivity(self):
+        # Brief digression to test that import is case-sensitive:  if we got this
+        # far, we know for sure that "random" exists.
         try:
-            reload(mod)
-        except ImportError, err:
-            raise ValueError("import from .pyc/.pyo failed: %s" % err)
-    finally:
-        try:
-            os.unlink(pyc)
-        except os.error:
-            pass
-        try:
-            os.unlink(pyo)
-        except os.error:
+            import RAnDoM
+        except ImportError:
             pass
-        del sys.modules[TESTFN]
+        else:
+            self.fail("import of RAnDoM should have failed (case mismatch)")
 
-sys.path.insert(0, os.curdir)
-try:
-    test_with_extension(os.extsep + "py")
-    if sys.platform.startswith("win"):
-        for ext in ".PY", ".Py", ".pY", ".pyw", ".PYW", ".pYw":
-            test_with_extension(ext)
-finally:
-    del sys.path[0]
-
-# Verify that the imp module can correctly load and find .py files
-import imp
-x = imp.find_module("os")
-os = imp.load_module("os", *x)
-
-def test_module_with_large_stack(module):
-    # create module w/list of 65000 elements to test bug #561858
-    filename = module + os.extsep + 'py'
-
-    # create a file with a list of 65000 elements
-    f = open(filename, 'w+')
-    f.write('d = [\n')
-    for i in range(65000):
-        f.write('"",\n')
-    f.write(']')
-    f.close()
-
-    # compile & remove .py file, we only need .pyc (or .pyo)
-    f = open(filename, 'r')
-    py_compile.compile(filename)
-    f.close()
-    os.unlink(filename)
-
-    # need to be able to load from current dir
-    sys.path.append('')
-
-    # this used to crash
-    exec 'import ' + module
-
-    # cleanup
-    del sys.path[-1]
-    for ext in 'pyc', 'pyo':
-        fname = module + os.extsep + ext
-        if os.path.exists(fname):
-            os.unlink(fname)
-
-test_module_with_large_stack('longlist')
-
-def test_failing_import_sticks():
-    source = TESTFN + os.extsep + "py"
-    f = open(source, "w")
-    print >> f, "a = 1/0"
-    f.close()
-
-    # New in 2.4, we shouldn't be able to import that no matter how often
-    # we try.
-    sys.path.insert(0, os.curdir)
-    try:
-        for i in 1, 2, 3:
-            try:
-                mod = __import__(TESTFN)
-            except ZeroDivisionError:
-                if TESTFN in sys.modules:
-                    raise TestFailed("damaged module in sys.modules", i)
+    def testDoubleConst(self):
+        # Another brief digression to test the accuracy of manifest float constants.
+        from test import double_const  # don't blink -- that *was* the test
+
+    def testImport(self):
+        def test_with_extension(ext):
+            # ext normally ".py"; perhaps ".pyw"
+            source = TESTFN + ext
+            pyo = TESTFN + os.extsep + "pyo"
+            if sys.platform.startswith('java'):
+                pyc = TESTFN + "$py.class"
             else:
-                raise TestFailed("was able to import a damaged module", i)
-    finally:
-        sys.path.pop(0)
-        remove_files(TESTFN)
-
-test_failing_import_sticks()
-
-def test_failing_reload():
-    # A failing reload should leave the module object in sys.modules.
-    source = TESTFN + os.extsep + "py"
-    f = open(source, "w")
-    print >> f, "a = 1"
-    print >> f, "b = 2"
-    f.close()
-
-    sys.path.insert(0, os.curdir)
-    try:
-        mod = __import__(TESTFN)
-        if TESTFN not in sys.modules:
-            raise TestFailed("expected module in sys.modules")
-        if mod.a != 1 or mod.b != 2:
-            raise TestFailed("module has wrong attribute values")
-
-        # On WinXP, just replacing the .py file wasn't enough to
-        # convince reload() to reparse it.  Maybe the timestamp didn't
-        # move enough.  We force it to get reparsed by removing the
-        # compiled file too.
-        remove_files(TESTFN)
+                pyc = TESTFN + os.extsep + "pyc"
+
+            f = open(source, "w")
+            print >> f, "# This tests Python's ability to import a", ext, "file."
+            a = random.randrange(1000)
+            b = random.randrange(1000)
+            print >> f, "a =", a
+            print >> f, "b =", b
+            f.close()
+
+            try:
+                try:
+                    mod = __import__(TESTFN)
+                except ImportError, err:
+                    self.fail("import from %s failed: %s" % (ext, err))
+
+                self.assertEquals(mod.a, a,
+                    "module loaded (%s) but contents invalid" % mod)
+                self.assertEquals(mod.b, b,
+                    "module loaded (%s) but contents invalid" % mod)
+            finally:
+                os.unlink(source)
 
-        # Now damage the module.
+            try:
+                try:
+                    reload(mod)
+                except ImportError, err:
+                    self.fail("import from .pyc/.pyo failed: %s" % err)
+            finally:
+                try:
+                    os.unlink(pyc)
+                except OSError:
+                    pass
+                try:
+                    os.unlink(pyo)
+                except OSError:
+                    pass
+                del sys.modules[TESTFN]
+
+        sys.path.insert(0, os.curdir)
+        try:
+            test_with_extension(os.extsep + "py")
+            if sys.platform.startswith("win"):
+                for ext in ".PY", ".Py", ".pY", ".pyw", ".PYW", ".pYw":
+                    test_with_extension(ext)
+        finally:
+            del sys.path[0]
+
+    def testImpModule(self):
+        # Verify that the imp module can correctly load and find .py files
+        import imp
+        x = imp.find_module("os")
+        os = imp.load_module("os", *x)
+
+    def test_module_with_large_stack(self, module='longlist'):
+        # create module w/list of 65000 elements to test bug #561858
+        filename = module + os.extsep + 'py'
+
+        # create a file with a list of 65000 elements
+        f = open(filename, 'w+')
+        f.write('d = [\n')
+        for i in range(65000):
+            f.write('"",\n')
+        f.write(']')
+        f.close()
+
+        # compile & remove .py file, we only need .pyc (or .pyo)
+        f = open(filename, 'r')
+        py_compile.compile(filename)
+        f.close()
+        os.unlink(filename)
+
+        # need to be able to load from current dir
+        sys.path.append('')
+
+        # this used to crash
+        exec('import ' + module)
+
+        # cleanup
+        del sys.path[-1]
+        for ext in 'pyc', 'pyo':
+            fname = module + os.extsep + ext
+            if os.path.exists(fname):
+                os.unlink(fname)
+
+    def test_failing_import_sticks(self):
+        source = TESTFN + os.extsep + "py"
         f = open(source, "w")
-        print >> f, "a = 10"
-        print >> f, "b = 20//0"
+        print >> f, "a = 1/0"
         f.close()
+
+        # New in 2.4, we shouldn't be able to import that no matter how often
+        # we try.
+        sys.path.insert(0, os.curdir)
         try:
-            reload(mod)
-        except ZeroDivisionError:
-            pass
-        else:
-            raise TestFailed("was able to reload a damaged module")
+            for i in 1, 2, 3:
+                try:
+                    mod = __import__(TESTFN)
+                except ZeroDivisionError:
+                    if TESTFN in sys.modules:
+                        self.fail("damaged module in sys.modules on %i. try" % i)
+                else:
+                    self.fail("was able to import a damaged module on %i. try" % i)
+        finally:
+            sys.path.pop(0)
+            remove_files(TESTFN)
+
+    def test_failing_reload(self):
+        # A failing reload should leave the module object in sys.modules.
+        source = TESTFN + os.extsep + "py"
+        f = open(source, "w")
+        print >> f, "a = 1"
+        print >> f, "b = 2"
+        f.close()
+
+        sys.path.insert(0, os.curdir)
+        try:
+            mod = __import__(TESTFN)
+            self.assert_(TESTFN in sys.modules, "expected module in sys.modules")
+            self.assertEquals(mod.a, 1, "module has wrong attribute values")
+            self.assertEquals(mod.b, 2, "module has wrong attribute values")
+
+            # On WinXP, just replacing the .py file wasn't enough to
+            # convince reload() to reparse it.  Maybe the timestamp didn't
+            # move enough.  We force it to get reparsed by removing the
+            # compiled file too.
+            remove_files(TESTFN)
+
+            # Now damage the module.
+            f = open(source, "w")
+            print >> f, "a = 10"
+            print >> f, "b = 20//0"
+            f.close()
+
+            self.assertRaises(ZeroDivisionError, reload, mod)
+
+            # But we still expect the module to be in sys.modules.
+            mod = sys.modules.get(TESTFN)
+            self.failIf(mod is None, "expected module to still be in sys.modules")
+
+            # We should have replaced a w/ 10, but the old b value should
+            # stick.
+            self.assertEquals(mod.a, 10, "module has wrong attribute values")
+            self.assertEquals(mod.b, 2, "module has wrong attribute values")
+
+        finally:
+            sys.path.pop(0)
+            remove_files(TESTFN)
+            if TESTFN in sys.modules:
+                del sys.modules[TESTFN]
+
+    def test_import_name_binding(self):
+        # import x.y.z binds x in the current namespace
+        import test as x
+        import test.test_support
+        self.assert_(x is test, x.__name__)
+        self.assert_(hasattr(test.test_support, "__file__"))
+
+        # import x.y.z as w binds z as w
+        import test.test_support as y
+        self.assert_(y is test.test_support, y.__name__)
+
+    def test_import_initless_directory_warning(self):
+        import warnings
+        oldfilters = warnings.filters[:]
+        warnings.simplefilter('error', ImportWarning);
+        try:
+            # Just a random non-package directory we always expect to be
+            # somewhere in sys.path...
+            self.assertRaises(ImportWarning, __import__, "site-packages")
+        finally:
+            warnings.filters = oldfilters
 
-        # But we still expect the module to be in sys.modules.
-        mod = sys.modules.get(TESTFN)
-        if mod is None:
-            raise TestFailed("expected module to still be in sys.modules")
-        # We should have replaced a w/ 10, but the old b value should
-        # stick.
-        if mod.a != 10 or mod.b != 2:
-            raise TestFailed("module has wrong attribute values")
-
-    finally:
-        sys.path.pop(0)
-        remove_files(TESTFN)
-        if TESTFN in sys.modules:
-            del sys.modules[TESTFN]
-
-test_failing_reload()
-
-def test_import_name_binding():
-    # import x.y.z binds x in the current namespace
-    import test as x
-    import test.test_support
-    assert x is test, x.__name__
-    assert hasattr(test.test_support, "__file__")
-
-    # import x.y.z as w binds z as w
-    import test.test_support as y
-    assert y is test.test_support, y.__name__
-
-test_import_name_binding()
-
-def test_import_initless_directory_warning():
-    import warnings
-    oldfilters = warnings.filters[:]
-    warnings.simplefilter('error', ImportWarning);
-    try:
-        # Just a random non-package directory we always expect to be
-        # somewhere in sys.path...
-        __import__("site-packages")
-    except ImportWarning:
-        pass
-    else:
-        raise AssertionError
-    finally:
-        warnings.filters = oldfilters
+def test_main(verbose=None):
+    run_unittest(ImportTest)
 
-test_import_initless_directory_warning()
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_importhooks.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_importhooks.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_importhooks.py	Fri Dec 15 05:21:50 2006
@@ -81,7 +81,7 @@
         mod.__loader__ = self
         if ispkg:
             mod.__path__ = self._get__path__()
-        exec code in mod.__dict__
+        exec(code, mod.__dict__)
         return mod
 
 

Modified: python/branches/p3yk-noslice/Lib/test/test_inspect.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_inspect.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_inspect.py	Fri Dec 15 05:21:50 2006
@@ -130,7 +130,7 @@
     def __init__(self, *args, **kwargs):
         unittest.TestCase.__init__(self, *args, **kwargs)
 
-        self.source = file(inspect.getsourcefile(self.fodderFile)).read()
+        self.source = open(inspect.getsourcefile(self.fodderFile)).read()
 
     def sourcerange(self, top, bottom):
         lines = self.source.split("\n")
@@ -180,7 +180,18 @@
         self.assertEqual(inspect.getcomments(mod.StupidGit), '# line 20\n')
 
     def test_getmodule(self):
+        # Check actual module
+        self.assertEqual(inspect.getmodule(mod), mod)
+        # Check class (uses __module__ attribute)
         self.assertEqual(inspect.getmodule(mod.StupidGit), mod)
+        # Check a method (no __module__ attribute, falls back to filename)
+        self.assertEqual(inspect.getmodule(mod.StupidGit.abuse), mod)
+        # Do it again (check the caching isn't broken)
+        self.assertEqual(inspect.getmodule(mod.StupidGit.abuse), mod)
+        # Check a builtin
+        self.assertEqual(inspect.getmodule(str), sys.modules["__builtin__"])
+        # Check filename override
+        self.assertEqual(inspect.getmodule(None, modfile), mod)
 
     def test_getsource(self):
         self.assertSourceEqual(git.abuse, 29, 39)
@@ -199,7 +210,7 @@
         m = sys.modules[name] = module(name)
         m.__file__ = "<string>" # hopefully not a real filename...
         m.__loader__ = "dummy"  # pretend the filename is understood by a loader
-        exec "def x(): pass" in m.__dict__
+        exec("def x(): pass", m.__dict__)
         self.assertEqual(inspect.getsourcefile(m.x.func_code), '<string>')
         del sys.modules[name]
         inspect.getmodule(compile('a=10','','single'))

Modified: python/branches/p3yk-noslice/Lib/test/test_iter.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_iter.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_iter.py	Fri Dec 15 05:21:50 2006
@@ -327,10 +327,10 @@
         class Boolean:
             def __init__(self, truth):
                 self.truth = truth
-            def __nonzero__(self):
+            def __bool__(self):
                 return self.truth
-        bTrue = Boolean(1)
-        bFalse = Boolean(0)
+        bTrue = Boolean(True)
+        bFalse = Boolean(False)
 
         class Seq:
             def __init__(self, *args):
@@ -423,21 +423,21 @@
 
     # Test zip()'s use of iterators.
     def test_builtin_zip(self):
-        self.assertEqual(zip(), [])
-        self.assertEqual(zip(*[]), [])
-        self.assertEqual(zip(*[(1, 2), 'ab']), [(1, 'a'), (2, 'b')])
+        self.assertEqual(list(zip()), [])
+        self.assertEqual(list(zip(*[])), [])
+        self.assertEqual(list(zip(*[(1, 2), 'ab'])), [(1, 'a'), (2, 'b')])
 
         self.assertRaises(TypeError, zip, None)
         self.assertRaises(TypeError, zip, range(10), 42)
         self.assertRaises(TypeError, zip, range(10), zip)
 
-        self.assertEqual(zip(IteratingSequenceClass(3)),
+        self.assertEqual(list(zip(IteratingSequenceClass(3))),
                          [(0,), (1,), (2,)])
-        self.assertEqual(zip(SequenceClass(3)),
+        self.assertEqual(list(zip(SequenceClass(3))),
                          [(0,), (1,), (2,)])
 
         d = {"one": 1, "two": 2, "three": 3}
-        self.assertEqual(d.items(), zip(d, d.itervalues()))
+        self.assertEqual(d.items(), list(zip(d, d.itervalues())))
 
         # Generate all ints starting at constructor arg.
         class IntsFrom:
@@ -459,7 +459,7 @@
             f.close()
         f = open(TESTFN, "r")
         try:
-            self.assertEqual(zip(IntsFrom(0), f, IntsFrom(-100)),
+            self.assertEqual(list(zip(IntsFrom(0), f, IntsFrom(-100))),
                              [(0, "a\n", -100),
                               (1, "bbb\n", -99),
                               (2, "cc\n", -98)])
@@ -470,7 +470,7 @@
             except OSError:
                 pass
 
-        self.assertEqual(zip(xrange(5)), [(i,) for i in range(5)])
+        self.assertEqual(list(zip(xrange(5))), [(i,) for i in range(5)])
 
         # Classes that lie about their lengths.
         class NoGuessLen5:
@@ -487,16 +487,19 @@
             def __len__(self):
                 return 30
 
+        def lzip(*args):
+            return list(zip(*args))
+
         self.assertEqual(len(Guess3Len5()), 3)
         self.assertEqual(len(Guess30Len5()), 30)
-        self.assertEqual(zip(NoGuessLen5()), zip(range(5)))
-        self.assertEqual(zip(Guess3Len5()), zip(range(5)))
-        self.assertEqual(zip(Guess30Len5()), zip(range(5)))
+        self.assertEqual(lzip(NoGuessLen5()), lzip(range(5)))
+        self.assertEqual(lzip(Guess3Len5()), lzip(range(5)))
+        self.assertEqual(lzip(Guess30Len5()), lzip(range(5)))
 
         expected = [(i, i) for i in range(5)]
         for x in NoGuessLen5(), Guess3Len5(), Guess30Len5():
             for y in NoGuessLen5(), Guess3Len5(), Guess30Len5():
-                self.assertEqual(zip(x, y), expected)
+                self.assertEqual(lzip(x, y), expected)
 
     # This test case will be removed if we don't have Unicode
     def test_unicode_join_endcase(self):
@@ -661,7 +664,7 @@
 
     # Test iterators with file.writelines().
     def test_writelines(self):
-        f = file(TESTFN, "w")
+        f = open(TESTFN, "w")
 
         try:
             self.assertRaises(TypeError, f.writelines, None)
@@ -700,7 +703,7 @@
             f.writelines(Whatever(6, 6+2000))
             f.close()
 
-            f = file(TESTFN)
+            f = open(TESTFN)
             expected = [str(i) + "\n" for i in range(1, 2006)]
             self.assertEqual(list(f), expected)
 
@@ -861,7 +864,7 @@
         a = range(5)
         e = enumerate(a)
         b = iter(e)
-        self.assertEqual(list(b), zip(range(5), range(5)))
+        self.assertEqual(list(b), list(zip(range(5), range(5))))
         self.assertEqual(list(b), [])
 
 

Modified: python/branches/p3yk-noslice/Lib/test/test_itertools.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_itertools.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_itertools.py	Fri Dec 15 05:21:50 2006
@@ -6,6 +6,9 @@
 import operator
 import random
 
+def lzip(*args):
+    return list(zip(*args))
+
 def onearg(x):
     'Test function of one argument'
     return 2*x
@@ -47,9 +50,9 @@
         self.assertRaises(TypeError, chain, 2, 3)
 
     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)])
-        self.assertEqual(take(2, zip('abc',count(3))), [('a', 3), ('b', 4)])
+        self.assertEqual(lzip('abc',count()), [('a', 0), ('b', 1), ('c', 2)])
+        self.assertEqual(lzip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)])
+        self.assertEqual(take(2, lzip('abc',count(3))), [('a', 3), ('b', 4)])
         self.assertRaises(TypeError, count, 2, 3)
         self.assertRaises(TypeError, count, 'a')
         c = count(sys.maxint-2)   # verify that rollover doesn't crash
@@ -58,6 +61,10 @@
         self.assertEqual(repr(c), 'count(3)')
         c.next()
         self.assertEqual(repr(c), 'count(4)')
+        c = count(-9)
+        self.assertEqual(repr(c), 'count(-9)')
+        c.next()
+        self.assertEqual(c.next(), -8)
 
     def test_cycle(self):
         self.assertEqual(take(10, cycle('abc')), list('abcabcabca'))
@@ -132,13 +139,13 @@
 
         # __cmp__ failure
         class DummyCmp:
-            def __cmp__(self, dst):
+            def __eq__(self, dst):
                 raise ExpectedError
         s = [DummyCmp(), DummyCmp(), None]
 
-        # __cmp__ failure on outer object
+        # __eq__ failure on outer object
         self.assertRaises(ExpectedError, gulp, s, func=id)
-        # __cmp__ failure on inner object
+        # __eq__ failure on inner object
         self.assertRaises(ExpectedError, gulp, s)
 
         # keyfunc failure
@@ -176,27 +183,28 @@
         self.assertRaises(TypeError, ifilterfalse(range(6), range(6)).next)
 
     def test_izip(self):
+        # XXX This is rather silly now that builtin zip() calls izip()...
         ans = [(x,y) for x, y in izip('abc',count())]
         self.assertEqual(ans, [('a', 0), ('b', 1), ('c', 2)])
-        self.assertEqual(list(izip('abc', range(6))), zip('abc', range(6)))
-        self.assertEqual(list(izip('abcdef', range(3))), zip('abcdef', range(3)))
-        self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3)))
-        self.assertEqual(list(izip('abcdef')), zip('abcdef'))
-        self.assertEqual(list(izip()), zip())
+        self.assertEqual(list(izip('abc', range(6))), lzip('abc', range(6)))
+        self.assertEqual(list(izip('abcdef', range(3))), lzip('abcdef', range(3)))
+        self.assertEqual(take(3,izip('abcdef', count())), lzip('abcdef', range(3)))
+        self.assertEqual(list(izip('abcdef')), lzip('abcdef'))
+        self.assertEqual(list(izip()), lzip())
         self.assertRaises(TypeError, izip, 3)
         self.assertRaises(TypeError, izip, range(3), 3)
         # Check tuple re-use (implementation detail)
         self.assertEqual([tuple(list(pair)) for pair in izip('abc', 'def')],
-                         zip('abc', 'def'))
+                         lzip('abc', 'def'))
         self.assertEqual([pair for pair in izip('abc', 'def')],
-                         zip('abc', 'def'))
+                         lzip('abc', 'def'))
         ids = map(id, izip('abc', 'def'))
         self.assertEqual(min(ids), max(ids))
         ids = map(id, list(izip('abc', 'def')))
         self.assertEqual(len(dict.fromkeys(ids)), len(ids))
 
     def test_repeat(self):
-        self.assertEqual(zip(xrange(3),repeat('a')),
+        self.assertEqual(lzip(xrange(3),repeat('a')),
                          [(0, 'a'), (1, 'a'), (2, 'a')])
         self.assertEqual(list(repeat('a', 3)), ['a', 'a', 'a'])
         self.assertEqual(take(3, repeat('a')), ['a', 'a', 'a'])
@@ -320,7 +328,7 @@
         self.assertEqual(list(b), [])
 
         a, b = tee(irange(n)) # test 100% interleaved
-        self.assertEqual(zip(a,b), zip(range(n),range(n)))
+        self.assertEqual(lzip(a,b), lzip(range(n), range(n)))
 
         a, b = tee(irange(n)) # test 0% interleaved
         self.assertEqual(list(a), range(n))
@@ -371,6 +379,7 @@
 
         # test values of n
         self.assertRaises(TypeError, tee, 'abc', 'invalid')
+        self.assertRaises(ValueError, tee, [], -1)
         for n in xrange(5):
             result = tee('abc', n)
             self.assertEqual(type(result), tuple)
@@ -601,8 +610,8 @@
     def test_izip(self):
         for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
             for g in (G, I, Ig, S, L, R):
-                self.assertEqual(list(izip(g(s))), zip(g(s)))
-                self.assertEqual(list(izip(g(s), g(s))), zip(g(s), g(s)))
+                self.assertEqual(list(izip(g(s))), lzip(g(s)))
+                self.assertEqual(list(izip(g(s), g(s))), lzip(g(s), g(s)))
             self.assertRaises(TypeError, izip, X(s))
             self.assertRaises(TypeError, izip, N(s))
             self.assertRaises(ZeroDivisionError, list, izip(E(s)))
@@ -627,7 +636,7 @@
     def test_starmap(self):
         for s in (range(10), range(0), range(100), (7,11), xrange(20,50,5)):
             for g in (G, I, Ig, S, L, R):
-                ss = zip(s, s)
+                ss = lzip(s, s)
                 self.assertEqual(list(starmap(operator.pow, g(ss))), map(operator.pow, g(s), g(s)))
             self.assertRaises(TypeError, starmap, operator.pow, X(ss))
             self.assertRaises(TypeError, starmap, operator.pow, N(ss))

Modified: python/branches/p3yk-noslice/Lib/test/test_long.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_long.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_long.py	Fri Dec 15 05:21:50 2006
@@ -247,17 +247,23 @@
             "long(-sys.maxint-1) != -sys.maxint-1")
 
         # long -> int should not fail for hugepos_aslong or hugeneg_aslong
+        x = int(hugepos_aslong)
         try:
-            self.assertEqual(int(hugepos_aslong), hugepos,
+            self.assertEqual(x, hugepos,
                   "converting sys.maxint to long and back to int fails")
         except OverflowError:
             self.fail("int(long(sys.maxint)) overflowed!")
+        if not isinstance(x, int):
+            raise TestFailed("int(long(sys.maxint)) should have returned int")
+        x = int(hugeneg_aslong)
         try:
-            self.assertEqual(int(hugeneg_aslong), hugeneg,
+            self.assertEqual(x, hugeneg,
                   "converting -sys.maxint-1 to long and back to int fails")
         except OverflowError:
             self.fail("int(long(-sys.maxint-1)) overflowed!")
-
+        if not isinstance(x, int):
+            raise TestFailed("int(long(-sys.maxint-1)) should have "
+                             "returned int")
         # but long -> int should overflow for hugepos+1 and hugeneg-1
         x = hugepos_aslong + 1
         try:
@@ -282,6 +288,7 @@
         self.assert_(type(y) is long,
             "overflowing int conversion must return long not long subtype")
 
+
 # ----------------------------------- tests of auto int->long conversion
 
     def test_auto_overflow(self):

Modified: python/branches/p3yk-noslice/Lib/test/test_mailbox.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_mailbox.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_mailbox.py	Fri Dec 15 05:21:50 2006
@@ -666,6 +666,19 @@
         self._box.lock()
         self._box.unlock()
 
+    def test_folder (self):
+        # Test for bug #1569790: verify that folders returned by .get_folder()
+        # use the same factory function.
+        def dummy_factory (s):
+            return None
+        box = self._factory(self._path, factory=dummy_factory)
+        folder = box.add_folder('folder1')
+        self.assert_(folder._factory is dummy_factory)
+        
+        folder1_alias = box.get_folder('folder1')
+        self.assert_(folder1_alias._factory is dummy_factory)
+
+        
 
 class _TestMboxMMDF(TestMailbox):
 
@@ -740,6 +753,22 @@
         self._box.lock()
         self._box.unlock()
 
+    def test_relock(self):
+        # Test case for bug #1575506: the mailbox class was locking the
+        # wrong file object in its flush() method.
+        msg = "Subject: sub\n\nbody\n"
+        key1 = self._box.add(msg)
+        self._box.flush()
+        self._box.close()
+
+        self._box = self._factory(self._path)
+        self._box.lock()
+        key2 = self._box.add(msg)
+        self._box.flush()
+        self.assert_(self._box._locked)
+        self._box.close()
+
+
 
 class TestMbox(_TestMboxMMDF):
 
@@ -766,7 +795,11 @@
 
     def test_get_folder(self):
         # Open folders
-        self._box.add_folder('foo.bar')
+        def dummy_factory (s):
+            return None
+        self._box = self._factory(self._path, dummy_factory)
+        
+        new_folder = self._box.add_folder('foo.bar')
         folder0 = self._box.get_folder('foo.bar')
         folder0.add(self._template % 'bar')
         self.assert_(os.path.isdir(os.path.join(self._path, 'foo.bar')))
@@ -774,6 +807,11 @@
         self.assert_(folder1.get_string(folder1.keys()[0]) == \
                      self._template % 'bar')
 
+        # Test for bug #1569790: verify that folders returned by .get_folder()
+        # use the same factory function.
+        self.assert_(new_folder._factory is self._box._factory)
+        self.assert_(folder0._factory is self._box._factory)
+
     def test_add_and_remove_folders(self):
         # Delete folders
         self._box.add_folder('one')
@@ -842,6 +880,21 @@
         self.assert_(self._box.get_sequences() ==
                      {'foo':[1, 2, 3], 'unseen':[1], 'bar':[3], 'replied':[3]})
 
+        # Test case for packing while holding the mailbox locked.
+        key0 = self._box.add(msg1)
+        key1 = self._box.add(msg1)
+        key2 = self._box.add(msg1)
+        key3 = self._box.add(msg1)
+
+        self._box.remove(key0)
+        self._box.remove(key2)
+        self._box.lock()
+        self._box.pack()
+        self._box.unlock()
+        self.assert_(self._box.get_sequences() ==
+                     {'foo':[1, 2, 3, 4, 5],
+                      'unseen':[1], 'bar':[3], 'replied':[3]})
+        
     def _get_lock_path(self):
         return os.path.join(self._path, '.mh_sequences.lock')
 

Modified: python/branches/p3yk-noslice/Lib/test/test_marshal.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_marshal.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_marshal.py	Fri Dec 15 05:21:50 2006
@@ -16,8 +16,8 @@
                 s = marshal.dumps(expected)
                 got = marshal.loads(s)
                 self.assertEqual(expected, got)
-                marshal.dump(expected, file(test_support.TESTFN, "wb"))
-                got = marshal.load(file(test_support.TESTFN, "rb"))
+                marshal.dump(expected, open(test_support.TESTFN, "wb"))
+                got = marshal.load( open(test_support.TESTFN, "rb"))
                 self.assertEqual(expected, got)
             n = n >> 1
         os.unlink(test_support.TESTFN)
@@ -51,8 +51,8 @@
             new = marshal.loads(marshal.dumps(b))
             self.assertEqual(b, new)
             self.assertEqual(type(b), type(new))
-            marshal.dump(b, file(test_support.TESTFN, "wb"))
-            new = marshal.load(file(test_support.TESTFN, "rb"))
+            marshal.dump(b, open(test_support.TESTFN, "wb"))
+            new = marshal.load(open(test_support.TESTFN, "rb"))
             self.assertEqual(b, new)
             self.assertEqual(type(b), type(new))
 
@@ -67,8 +67,8 @@
                 s = marshal.dumps(f)
                 got = marshal.loads(s)
                 self.assertEqual(f, got)
-                marshal.dump(f, file(test_support.TESTFN, "wb"))
-                got = marshal.load(file(test_support.TESTFN, "rb"))
+                marshal.dump(f, open(test_support.TESTFN, "wb"))
+                got = marshal.load(open(test_support.TESTFN, "rb"))
                 self.assertEqual(f, got)
             n /= 123.4567
 
@@ -94,12 +94,12 @@
                 got = marshal.loads(s)
                 self.assertEqual(f, got)
 
-                marshal.dump(f, file(test_support.TESTFN, "wb"))
-                got = marshal.load(file(test_support.TESTFN, "rb"))
+                marshal.dump(f, open(test_support.TESTFN, "wb"))
+                got = marshal.load(open(test_support.TESTFN, "rb"))
                 self.assertEqual(f, got)
 
-                marshal.dump(f, file(test_support.TESTFN, "wb"), 1)
-                got = marshal.load(file(test_support.TESTFN, "rb"))
+                marshal.dump(f, open(test_support.TESTFN, "wb"), 1)
+                got = marshal.load(open(test_support.TESTFN, "rb"))
                 self.assertEqual(f, got)
             n *= 123.4567
         os.unlink(test_support.TESTFN)
@@ -110,8 +110,8 @@
             new = marshal.loads(marshal.dumps(s))
             self.assertEqual(s, new)
             self.assertEqual(type(s), type(new))
-            marshal.dump(s, file(test_support.TESTFN, "wb"))
-            new = marshal.load(file(test_support.TESTFN, "rb"))
+            marshal.dump(s, open(test_support.TESTFN, "wb"))
+            new = marshal.load(open(test_support.TESTFN, "rb"))
             self.assertEqual(s, new)
             self.assertEqual(type(s), type(new))
         os.unlink(test_support.TESTFN)
@@ -121,8 +121,8 @@
             new = marshal.loads(marshal.dumps(s))
             self.assertEqual(s, new)
             self.assertEqual(type(s), type(new))
-            marshal.dump(s, file(test_support.TESTFN, "wb"))
-            new = marshal.load(file(test_support.TESTFN, "rb"))
+            marshal.dump(s, open(test_support.TESTFN, "wb"))
+            new = marshal.load(open(test_support.TESTFN, "rb"))
             self.assertEqual(s, new)
             self.assertEqual(type(s), type(new))
         os.unlink(test_support.TESTFN)
@@ -132,8 +132,8 @@
             b = buffer(s)
             new = marshal.loads(marshal.dumps(b))
             self.assertEqual(s, new)
-            marshal.dump(b, file(test_support.TESTFN, "wb"))
-            new = marshal.load(file(test_support.TESTFN, "rb"))
+            marshal.dump(b, open(test_support.TESTFN, "wb"))
+            new = marshal.load(open(test_support.TESTFN, "rb"))
             self.assertEqual(s, new)
         os.unlink(test_support.TESTFN)
 
@@ -161,8 +161,8 @@
     def test_dict(self):
         new = marshal.loads(marshal.dumps(self.d))
         self.assertEqual(self.d, new)
-        marshal.dump(self.d, file(test_support.TESTFN, "wb"))
-        new = marshal.load(file(test_support.TESTFN, "rb"))
+        marshal.dump(self.d, open(test_support.TESTFN, "wb"))
+        new = marshal.load(open(test_support.TESTFN, "rb"))
         self.assertEqual(self.d, new)
         os.unlink(test_support.TESTFN)
 
@@ -170,8 +170,8 @@
         lst = self.d.items()
         new = marshal.loads(marshal.dumps(lst))
         self.assertEqual(lst, new)
-        marshal.dump(lst, file(test_support.TESTFN, "wb"))
-        new = marshal.load(file(test_support.TESTFN, "rb"))
+        marshal.dump(lst, open(test_support.TESTFN, "wb"))
+        new = marshal.load(open(test_support.TESTFN, "rb"))
         self.assertEqual(lst, new)
         os.unlink(test_support.TESTFN)
 
@@ -179,8 +179,8 @@
         t = tuple(self.d.keys())
         new = marshal.loads(marshal.dumps(t))
         self.assertEqual(t, new)
-        marshal.dump(t, file(test_support.TESTFN, "wb"))
-        new = marshal.load(file(test_support.TESTFN, "rb"))
+        marshal.dump(t, open(test_support.TESTFN, "wb"))
+        new = marshal.load(open(test_support.TESTFN, "rb"))
         self.assertEqual(t, new)
         os.unlink(test_support.TESTFN)
 
@@ -191,8 +191,8 @@
             self.assertEqual(t, new)
             self.assert_(isinstance(new, constructor))
             self.assertNotEqual(id(t), id(new))
-            marshal.dump(t, file(test_support.TESTFN, "wb"))
-            new = marshal.load(file(test_support.TESTFN, "rb"))
+            marshal.dump(t, open(test_support.TESTFN, "wb"))
+            new = marshal.load(open(test_support.TESTFN, "rb"))
             self.assertEqual(t, new)
             os.unlink(test_support.TESTFN)
 

Modified: python/branches/p3yk-noslice/Lib/test/test_math.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_math.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_math.py	Fri Dec 15 05:21:50 2006
@@ -1,208 +1,241 @@
 # Python test set -- math module
 # XXXX Should not do tests around zero only
 
-from test.test_support import TestFailed, verbose
+from test.test_support import run_unittest, verbose
+import unittest
+import math
 
 seps='1e-05'
 eps = eval(seps)
-print 'math module, testing with eps', seps
-import math
 
-def testit(name, value, expected):
-    if abs(value-expected) > eps:
-        raise TestFailed, '%s returned %f, expected %f'%\
-              (name, value, expected)
-
-print 'constants'
-testit('pi', math.pi, 3.1415926)
-testit('e', math.e, 2.7182818)
-
-print 'acos'
-testit('acos(-1)', math.acos(-1), math.pi)
-testit('acos(0)', math.acos(0), math.pi/2)
-testit('acos(1)', math.acos(1), 0)
-
-print 'asin'
-testit('asin(-1)', math.asin(-1), -math.pi/2)
-testit('asin(0)', math.asin(0), 0)
-testit('asin(1)', math.asin(1), math.pi/2)
-
-print 'atan'
-testit('atan(-1)', math.atan(-1), -math.pi/4)
-testit('atan(0)', math.atan(0), 0)
-testit('atan(1)', math.atan(1), math.pi/4)
-
-print 'atan2'
-testit('atan2(-1, 0)', math.atan2(-1, 0), -math.pi/2)
-testit('atan2(-1, 1)', math.atan2(-1, 1), -math.pi/4)
-testit('atan2(0, 1)', math.atan2(0, 1), 0)
-testit('atan2(1, 1)', math.atan2(1, 1), math.pi/4)
-testit('atan2(1, 0)', math.atan2(1, 0), math.pi/2)
-
-print 'ceil'
-testit('ceil(0.5)', math.ceil(0.5), 1)
-testit('ceil(1.0)', math.ceil(1.0), 1)
-testit('ceil(1.5)', math.ceil(1.5), 2)
-testit('ceil(-0.5)', math.ceil(-0.5), 0)
-testit('ceil(-1.0)', math.ceil(-1.0), -1)
-testit('ceil(-1.5)', math.ceil(-1.5), -1)
-
-print 'cos'
-testit('cos(-pi/2)', math.cos(-math.pi/2), 0)
-testit('cos(0)', math.cos(0), 1)
-testit('cos(pi/2)', math.cos(math.pi/2), 0)
-testit('cos(pi)', math.cos(math.pi), -1)
-
-print 'cosh'
-testit('cosh(0)', math.cosh(0), 1)
-testit('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
-
-print 'degrees'
-testit('degrees(pi)', math.degrees(math.pi), 180.0)
-testit('degrees(pi/2)', math.degrees(math.pi/2), 90.0)
-testit('degrees(-pi/4)', math.degrees(-math.pi/4), -45.0)
-
-print 'exp'
-testit('exp(-1)', math.exp(-1), 1/math.e)
-testit('exp(0)', math.exp(0), 1)
-testit('exp(1)', math.exp(1), math.e)
-
-print 'fabs'
-testit('fabs(-1)', math.fabs(-1), 1)
-testit('fabs(0)', math.fabs(0), 0)
-testit('fabs(1)', math.fabs(1), 1)
-
-print 'floor'
-testit('floor(0.5)', math.floor(0.5), 0)
-testit('floor(1.0)', math.floor(1.0), 1)
-testit('floor(1.5)', math.floor(1.5), 1)
-testit('floor(-0.5)', math.floor(-0.5), -1)
-testit('floor(-1.0)', math.floor(-1.0), -1)
-testit('floor(-1.5)', math.floor(-1.5), -2)
-
-print 'fmod'
-testit('fmod(10,1)', math.fmod(10,1), 0)
-testit('fmod(10,0.5)', math.fmod(10,0.5), 0)
-testit('fmod(10,1.5)', math.fmod(10,1.5), 1)
-testit('fmod(-10,1)', math.fmod(-10,1), 0)
-testit('fmod(-10,0.5)', math.fmod(-10,0.5), 0)
-testit('fmod(-10,1.5)', math.fmod(-10,1.5), -1)
-
-print 'frexp'
-def testfrexp(name, (mant, exp), (emant, eexp)):
-    if abs(mant-emant) > eps or exp != eexp:
-        raise TestFailed, '%s returned %r, expected %r'%\
-              (name, (mant, exp), (emant,eexp))
-
-testfrexp('frexp(-1)', math.frexp(-1), (-0.5, 1))
-testfrexp('frexp(0)', math.frexp(0), (0, 0))
-testfrexp('frexp(1)', math.frexp(1), (0.5, 1))
-testfrexp('frexp(2)', math.frexp(2), (0.5, 2))
-
-print 'hypot'
-testit('hypot(0,0)', math.hypot(0,0), 0)
-testit('hypot(3,4)', math.hypot(3,4), 5)
-
-print 'ldexp'
-testit('ldexp(0,1)', math.ldexp(0,1), 0)
-testit('ldexp(1,1)', math.ldexp(1,1), 2)
-testit('ldexp(1,-1)', math.ldexp(1,-1), 0.5)
-testit('ldexp(-1,1)', math.ldexp(-1,1), -2)
-
-print 'log'
-testit('log(1/e)', math.log(1/math.e), -1)
-testit('log(1)', math.log(1), 0)
-testit('log(e)', math.log(math.e), 1)
-testit('log(32,2)', math.log(32,2), 5)
-testit('log(10**40, 10)', math.log(10**40, 10), 40)
-testit('log(10**40, 10**20)', math.log(10**40, 10**20), 2)
-
-print 'log10'
-testit('log10(0.1)', math.log10(0.1), -1)
-testit('log10(1)', math.log10(1), 0)
-testit('log10(10)', math.log10(10), 1)
-
-print 'modf'
-def testmodf(name, (v1, v2), (e1, e2)):
-    if abs(v1-e1) > eps or abs(v2-e2):
-        raise TestFailed, '%s returned %r, expected %r'%\
-              (name, (v1,v2), (e1,e2))
-
-testmodf('modf(1.5)', math.modf(1.5), (0.5, 1.0))
-testmodf('modf(-1.5)', math.modf(-1.5), (-0.5, -1.0))
-
-print 'pow'
-testit('pow(0,1)', math.pow(0,1), 0)
-testit('pow(1,0)', math.pow(1,0), 1)
-testit('pow(2,1)', math.pow(2,1), 2)
-testit('pow(2,-1)', math.pow(2,-1), 0.5)
-
-print 'radians'
-testit('radians(180)', math.radians(180), math.pi)
-testit('radians(90)', math.radians(90), math.pi/2)
-testit('radians(-45)', math.radians(-45), -math.pi/4)
-
-print 'sin'
-testit('sin(0)', math.sin(0), 0)
-testit('sin(pi/2)', math.sin(math.pi/2), 1)
-testit('sin(-pi/2)', math.sin(-math.pi/2), -1)
-
-print 'sinh'
-testit('sinh(0)', math.sinh(0), 0)
-testit('sinh(1)**2-cosh(1)**2', math.sinh(1)**2-math.cosh(1)**2, -1)
-testit('sinh(1)+sinh(-1)', math.sinh(1)+math.sinh(-1), 0)
-
-print 'sqrt'
-testit('sqrt(0)', math.sqrt(0), 0)
-testit('sqrt(1)', math.sqrt(1), 1)
-testit('sqrt(4)', math.sqrt(4), 2)
-
-print 'tan'
-testit('tan(0)', math.tan(0), 0)
-testit('tan(pi/4)', math.tan(math.pi/4), 1)
-testit('tan(-pi/4)', math.tan(-math.pi/4), -1)
-
-print 'tanh'
-testit('tanh(0)', math.tanh(0), 0)
-testit('tanh(1)+tanh(-1)', math.tanh(1)+math.tanh(-1), 0)
-
-# RED_FLAG 16-Oct-2000 Tim
-# While 2.0 is more consistent about exceptions than previous releases, it
-# still fails this part of the test on some platforms.  For now, we only
-# *run* test_exceptions() in verbose mode, so that this isn't normally
-# tested.
-
-def test_exceptions():
-    print 'exceptions'
-    try:
-        x = math.exp(-1000000000)
-    except:
-        # mathmodule.c is failing to weed out underflows from libm, or
-        # we've got an fp format with huge dynamic range
-        raise TestFailed("underflowing exp() should not have raised "
-                         "an exception")
-    if x != 0:
-        raise TestFailed("underflowing exp() should have returned 0")
-
-    # If this fails, probably using a strict IEEE-754 conforming libm, and x
-    # is +Inf afterwards.  But Python wants overflows detected by default.
-    try:
-        x = math.exp(1000000000)
-    except OverflowError:
-        pass
-    else:
-        raise TestFailed("overflowing exp() didn't trigger OverflowError")
-
-    # If this fails, it could be a puzzle.  One odd possibility is that
-    # mathmodule.c's macros are getting confused while comparing
-    # Inf (HUGE_VAL) to a NaN, and artificially setting errno to ERANGE
-    # as a result (and so raising OverflowError instead).
-    try:
-        x = math.sqrt(-1.0)
-    except ValueError:
-        pass
-    else:
-        raise TestFailed("sqrt(-1) didn't raise ValueError")
+class MathTests(unittest.TestCase):
+
+    def ftest(self, name, value, expected):
+        if abs(value-expected) > eps:
+            self.fail('%s returned %f, expected %f'%\
+                      (name, value, expected))
+
+    def testConstants(self):
+        self.ftest('pi', math.pi, 3.1415926)
+        self.ftest('e', math.e, 2.7182818)
+
+    def testAcos(self):
+        self.assertRaises(TypeError, math.acos)
+        self.ftest('acos(-1)', math.acos(-1), math.pi)
+        self.ftest('acos(0)', math.acos(0), math.pi/2)
+        self.ftest('acos(1)', math.acos(1), 0)
+
+    def testAsin(self):
+        self.assertRaises(TypeError, math.asin)
+        self.ftest('asin(-1)', math.asin(-1), -math.pi/2)
+        self.ftest('asin(0)', math.asin(0), 0)
+        self.ftest('asin(1)', math.asin(1), math.pi/2)
+
+    def testAtan(self):
+        self.assertRaises(TypeError, math.atan)
+        self.ftest('atan(-1)', math.atan(-1), -math.pi/4)
+        self.ftest('atan(0)', math.atan(0), 0)
+        self.ftest('atan(1)', math.atan(1), math.pi/4)
+
+    def testAtan2(self):
+        self.assertRaises(TypeError, math.atan2)
+        self.ftest('atan2(-1, 0)', math.atan2(-1, 0), -math.pi/2)
+        self.ftest('atan2(-1, 1)', math.atan2(-1, 1), -math.pi/4)
+        self.ftest('atan2(0, 1)', math.atan2(0, 1), 0)
+        self.ftest('atan2(1, 1)', math.atan2(1, 1), math.pi/4)
+        self.ftest('atan2(1, 0)', math.atan2(1, 0), math.pi/2)
+
+    def testCeil(self):
+        self.assertRaises(TypeError, math.ceil)
+        self.ftest('ceil(0.5)', math.ceil(0.5), 1)
+        self.ftest('ceil(1.0)', math.ceil(1.0), 1)
+        self.ftest('ceil(1.5)', math.ceil(1.5), 2)
+        self.ftest('ceil(-0.5)', math.ceil(-0.5), 0)
+        self.ftest('ceil(-1.0)', math.ceil(-1.0), -1)
+        self.ftest('ceil(-1.5)', math.ceil(-1.5), -1)
+
+    def testCos(self):
+        self.assertRaises(TypeError, math.cos)
+        self.ftest('cos(-pi/2)', math.cos(-math.pi/2), 0)
+        self.ftest('cos(0)', math.cos(0), 1)
+        self.ftest('cos(pi/2)', math.cos(math.pi/2), 0)
+        self.ftest('cos(pi)', math.cos(math.pi), -1)
+
+    def testCosh(self):
+        self.assertRaises(TypeError, math.cosh)
+        self.ftest('cosh(0)', math.cosh(0), 1)
+        self.ftest('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
+
+    def testDegrees(self):
+        self.assertRaises(TypeError, math.degrees)
+        self.ftest('degrees(pi)', math.degrees(math.pi), 180.0)
+        self.ftest('degrees(pi/2)', math.degrees(math.pi/2), 90.0)
+        self.ftest('degrees(-pi/4)', math.degrees(-math.pi/4), -45.0)
+
+    def testExp(self):
+        self.assertRaises(TypeError, math.exp)
+        self.ftest('exp(-1)', math.exp(-1), 1/math.e)
+        self.ftest('exp(0)', math.exp(0), 1)
+        self.ftest('exp(1)', math.exp(1), math.e)
+
+    def testFabs(self):
+        self.assertRaises(TypeError, math.fabs)
+        self.ftest('fabs(-1)', math.fabs(-1), 1)
+        self.ftest('fabs(0)', math.fabs(0), 0)
+        self.ftest('fabs(1)', math.fabs(1), 1)
+
+    def testFloor(self):
+        self.assertRaises(TypeError, math.floor)
+        self.ftest('floor(0.5)', math.floor(0.5), 0)
+        self.ftest('floor(1.0)', math.floor(1.0), 1)
+        self.ftest('floor(1.5)', math.floor(1.5), 1)
+        self.ftest('floor(-0.5)', math.floor(-0.5), -1)
+        self.ftest('floor(-1.0)', math.floor(-1.0), -1)
+        self.ftest('floor(-1.5)', math.floor(-1.5), -2)
+
+    def testFmod(self):
+        self.assertRaises(TypeError, math.fmod)
+        self.ftest('fmod(10,1)', math.fmod(10,1), 0)
+        self.ftest('fmod(10,0.5)', math.fmod(10,0.5), 0)
+        self.ftest('fmod(10,1.5)', math.fmod(10,1.5), 1)
+        self.ftest('fmod(-10,1)', math.fmod(-10,1), 0)
+        self.ftest('fmod(-10,0.5)', math.fmod(-10,0.5), 0)
+        self.ftest('fmod(-10,1.5)', math.fmod(-10,1.5), -1)
+
+    def testFrexp(self):
+        self.assertRaises(TypeError, math.frexp)
+
+        def testfrexp(name, (mant, exp), (emant, eexp)):
+            if abs(mant-emant) > eps or exp != eexp:
+                self.fail('%s returned %r, expected %r'%\
+                          (name, (mant, exp), (emant,eexp)))
+
+        testfrexp('frexp(-1)', math.frexp(-1), (-0.5, 1))
+        testfrexp('frexp(0)', math.frexp(0), (0, 0))
+        testfrexp('frexp(1)', math.frexp(1), (0.5, 1))
+        testfrexp('frexp(2)', math.frexp(2), (0.5, 2))
+
+    def testHypot(self):
+        self.assertRaises(TypeError, math.hypot)
+        self.ftest('hypot(0,0)', math.hypot(0,0), 0)
+        self.ftest('hypot(3,4)', math.hypot(3,4), 5)
+
+    def testLdexp(self):
+        self.assertRaises(TypeError, math.ldexp)
+        self.ftest('ldexp(0,1)', math.ldexp(0,1), 0)
+        self.ftest('ldexp(1,1)', math.ldexp(1,1), 2)
+        self.ftest('ldexp(1,-1)', math.ldexp(1,-1), 0.5)
+        self.ftest('ldexp(-1,1)', math.ldexp(-1,1), -2)
+
+    def testLog(self):
+        self.assertRaises(TypeError, math.log)
+        self.ftest('log(1/e)', math.log(1/math.e), -1)
+        self.ftest('log(1)', math.log(1), 0)
+        self.ftest('log(e)', math.log(math.e), 1)
+        self.ftest('log(32,2)', math.log(32,2), 5)
+        self.ftest('log(10**40, 10)', math.log(10**40, 10), 40)
+        self.ftest('log(10**40, 10**20)', math.log(10**40, 10**20), 2)
+
+    def testLog10(self):
+        self.assertRaises(TypeError, math.log10)
+        self.ftest('log10(0.1)', math.log10(0.1), -1)
+        self.ftest('log10(1)', math.log10(1), 0)
+        self.ftest('log10(10)', math.log10(10), 1)
+
+    def testModf(self):
+        self.assertRaises(TypeError, math.modf)
+
+        def testmodf(name, (v1, v2), (e1, e2)):
+            if abs(v1-e1) > eps or abs(v2-e2):
+                self.fail('%s returned %r, expected %r'%\
+                          (name, (v1,v2), (e1,e2)))
+
+        testmodf('modf(1.5)', math.modf(1.5), (0.5, 1.0))
+        testmodf('modf(-1.5)', math.modf(-1.5), (-0.5, -1.0))
+
+    def testPow(self):
+        self.assertRaises(TypeError, math.pow)
+        self.ftest('pow(0,1)', math.pow(0,1), 0)
+        self.ftest('pow(1,0)', math.pow(1,0), 1)
+        self.ftest('pow(2,1)', math.pow(2,1), 2)
+        self.ftest('pow(2,-1)', math.pow(2,-1), 0.5)
+
+    def testRadians(self):
+        self.assertRaises(TypeError, math.radians)
+        self.ftest('radians(180)', math.radians(180), math.pi)
+        self.ftest('radians(90)', math.radians(90), math.pi/2)
+        self.ftest('radians(-45)', math.radians(-45), -math.pi/4)
+
+    def testSin(self):
+        self.assertRaises(TypeError, math.sin)
+        self.ftest('sin(0)', math.sin(0), 0)
+        self.ftest('sin(pi/2)', math.sin(math.pi/2), 1)
+        self.ftest('sin(-pi/2)', math.sin(-math.pi/2), -1)
+
+    def testSinh(self):
+        self.assertRaises(TypeError, math.sinh)
+        self.ftest('sinh(0)', math.sinh(0), 0)
+        self.ftest('sinh(1)**2-cosh(1)**2', math.sinh(1)**2-math.cosh(1)**2, -1)
+        self.ftest('sinh(1)+sinh(-1)', math.sinh(1)+math.sinh(-1), 0)
+
+    def testSqrt(self):
+        self.assertRaises(TypeError, math.sqrt)
+        self.ftest('sqrt(0)', math.sqrt(0), 0)
+        self.ftest('sqrt(1)', math.sqrt(1), 1)
+        self.ftest('sqrt(4)', math.sqrt(4), 2)
+
+    def testTan(self):
+        self.assertRaises(TypeError, math.tan)
+        self.ftest('tan(0)', math.tan(0), 0)
+        self.ftest('tan(pi/4)', math.tan(math.pi/4), 1)
+        self.ftest('tan(-pi/4)', math.tan(-math.pi/4), -1)
+
+    def testTanh(self):
+        self.assertRaises(TypeError, math.tanh)
+        self.ftest('tanh(0)', math.tanh(0), 0)
+        self.ftest('tanh(1)+tanh(-1)', math.tanh(1)+math.tanh(-1), 0)
+
+    # RED_FLAG 16-Oct-2000 Tim
+    # While 2.0 is more consistent about exceptions than previous releases, it
+    # still fails this part of the test on some platforms.  For now, we only
+    # *run* test_exceptions() in verbose mode, so that this isn't normally
+    # tested.
+
+    if verbose:
+        def test_exceptions(self):
+            try:
+                x = math.exp(-1000000000)
+            except:
+                # mathmodule.c is failing to weed out underflows from libm, or
+                # we've got an fp format with huge dynamic range
+                self.fail("underflowing exp() should not have raised "
+                          "an exception")
+            if x != 0:
+                self.fail("underflowing exp() should have returned 0")
+
+            # If this fails, probably using a strict IEEE-754 conforming libm, and x
+            # is +Inf afterwards.  But Python wants overflows detected by default.
+            try:
+                x = math.exp(1000000000)
+            except OverflowError:
+                pass
+            else:
+                self.fail("overflowing exp() didn't trigger OverflowError")
+
+            # If this fails, it could be a puzzle.  One odd possibility is that
+            # mathmodule.c's macros are getting confused while comparing
+            # Inf (HUGE_VAL) to a NaN, and artificially setting errno to ERANGE
+            # as a result (and so raising OverflowError instead).
+            try:
+                x = math.sqrt(-1.0)
+            except ValueError:
+                pass
+            else:
+                self.fail("sqrt(-1) didn't raise ValueError")
+
+
+def test_main():
+    run_unittest(MathTests)
 
-if verbose:
-    test_exceptions()
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_mmap.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_mmap.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_mmap.py	Fri Dec 15 05:21:50 2006
@@ -1,190 +1,158 @@
-from test.test_support import verify, vereq, TESTFN
+from test.test_support import TESTFN, run_unittest
 import mmap
+import unittest
 import os, re
 
 PAGESIZE = mmap.PAGESIZE
 
-def test_both():
-    "Test mmap module on Unix systems and Windows"
+class MmapTests(unittest.TestCase):
 
-    # Create a file to be mmap'ed.
-    if os.path.exists(TESTFN):
-        os.unlink(TESTFN)
-    f = open(TESTFN, 'w+')
-
-    try:    # unlink TESTFN no matter what
-        # Write 2 pages worth of data to the file
-        f.write('\0'* PAGESIZE)
-        f.write('foo')
-        f.write('\0'* (PAGESIZE-3) )
-        f.flush()
-        m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
-        f.close()
+    def setUp(self):
+        if os.path.exists(TESTFN):
+            os.unlink(TESTFN)
 
-        # Simple sanity checks
+    def tearDown(self):
+        try:
+            os.unlink(TESTFN)
+        except OSError:
+            pass
 
-        print type(m)  # SF bug 128713:  segfaulted on Linux
-        print '  Position of foo:', m.find('foo') / float(PAGESIZE), 'pages'
-        vereq(m.find('foo'), PAGESIZE)
-
-        print '  Length of file:', len(m) / float(PAGESIZE), 'pages'
-        vereq(len(m), 2*PAGESIZE)
-
-        print '  Contents of byte 0:', repr(m[0])
-        vereq(m[0], '\0')
-        print '  Contents of first 3 bytes:', repr(m[0:3])
-        vereq(m[0:3], '\0\0\0')
-
-        # Modify the file's content
-        print "\n  Modifying file's content..."
-        m[0] = '3'
-        m[PAGESIZE +3: PAGESIZE +3+3] = 'bar'
-
-        # Check that the modification worked
-        print '  Contents of byte 0:', repr(m[0])
-        vereq(m[0], '3')
-        print '  Contents of first 3 bytes:', repr(m[0:3])
-        vereq(m[0:3], '3\0\0')
-        print '  Contents of second page:',  repr(m[PAGESIZE-1 : PAGESIZE + 7])
-        vereq(m[PAGESIZE-1 : PAGESIZE + 7], '\0foobar\0')
+    def test_basic(self):
+        # Test mmap module on Unix systems and Windows
 
-        m.flush()
+        # Create a file to be mmap'ed.
+        f = open(TESTFN, 'w+')
+        try:
+            # Write 2 pages worth of data to the file
+            f.write('\0'* PAGESIZE)
+            f.write('foo')
+            f.write('\0'* (PAGESIZE-3) )
+            f.flush()
+            m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
+            f.close()
 
-        # Test doing a regular expression match in an mmap'ed file
-        match = re.search('[A-Za-z]+', m)
-        if match is None:
-            print '  ERROR: regex match on mmap failed!'
-        else:
-            start, end = match.span(0)
-            length = end - start
+            # Simple sanity checks
 
-            print '  Regex match on mmap (page start, length of match):',
-            print start / float(PAGESIZE), length
+            tp = str(type(m))  # SF bug 128713:  segfaulted on Linux
+            self.assertEqual(m.find('foo'), PAGESIZE)
 
-            vereq(start, PAGESIZE)
-            vereq(end, PAGESIZE + 6)
+            self.assertEqual(len(m), 2*PAGESIZE)
 
-        # test seeking around (try to overflow the seek implementation)
-        m.seek(0,0)
-        print '  Seek to zeroth byte'
-        vereq(m.tell(), 0)
-        m.seek(42,1)
-        print '  Seek to 42nd byte'
-        vereq(m.tell(), 42)
-        m.seek(0,2)
-        print '  Seek to last byte'
-        vereq(m.tell(), len(m))
+            self.assertEqual(m[0], '\0')
+            self.assertEqual(m[0:3], '\0\0\0')
 
-        print '  Try to seek to negative position...'
-        try:
-            m.seek(-1)
-        except ValueError:
-            pass
-        else:
-            verify(0, 'expected a ValueError but did not get it')
+            # Modify the file's content
+            m[0] = '3'
+            m[PAGESIZE +3: PAGESIZE +3+3] = 'bar'
 
-        print '  Try to seek beyond end of mmap...'
-        try:
-            m.seek(1,2)
-        except ValueError:
-            pass
-        else:
-            verify(0, 'expected a ValueError but did not get it')
+            # Check that the modification worked
+            self.assertEqual(m[0], '3')
+            self.assertEqual(m[0:3], '3\0\0')
+            self.assertEqual(m[PAGESIZE-1 : PAGESIZE + 7], '\0foobar\0')
 
-        print '  Try to seek to negative position...'
-        try:
-            m.seek(-len(m)-1,2)
-        except ValueError:
-            pass
-        else:
-            verify(0, 'expected a ValueError but did not get it')
+            m.flush()
 
-        # Try resizing map
-        print '  Attempting resize()'
-        try:
-            m.resize(512)
-        except SystemError:
-            # resize() not supported
-            # No messages are printed, since the output of this test suite
-            # would then be different across platforms.
-            pass
-        else:
-            # resize() is supported
-            verify(len(m) == 512,
-                    "len(m) is %d, but expecting 512" % (len(m),) )
-            # Check that we can no longer seek beyond the new size.
+            # Test doing a regular expression match in an mmap'ed file
+            match = re.search('[A-Za-z]+', m)
+            if match is None:
+                self.fail('regex match on mmap failed!')
+            else:
+                start, end = match.span(0)
+                length = end - start
+
+                self.assertEqual(start, PAGESIZE)
+                self.assertEqual(end, PAGESIZE + 6)
+
+            # test seeking around (try to overflow the seek implementation)
+            m.seek(0,0)
+            self.assertEqual(m.tell(), 0)
+            m.seek(42,1)
+            self.assertEqual(m.tell(), 42)
+            m.seek(0,2)
+            self.assertEqual(m.tell(), len(m))
+
+            # Try to seek to negative position...
+            self.assertRaises(ValueError, m.seek, -1)
+
+            # Try to seek beyond end of mmap...
+            self.assertRaises(ValueError, m.seek, 1, 2)
+
+            # Try to seek to negative position...
+            self.assertRaises(ValueError, m.seek, -len(m)-1, 2)
+
+            # Try resizing map
             try:
-                m.seek(513,0)
-            except ValueError:
+                m.resize(512)
+            except SystemError:
+                # resize() not supported
+                # No messages are printed, since the output of this test suite
+                # would then be different across platforms.
                 pass
             else:
-                verify(0, 'Could seek beyond the new size')
+                # resize() is supported
+                self.assertEqual(len(m), 512)
+                # Check that we can no longer seek beyond the new size.
+                self.assertRaises(ValueError, m.seek, 513, 0)
+
+                # Check that the underlying file is truncated too
+                # (bug #728515)
+                f = open(TESTFN)
+                f.seek(0, 2)
+                self.assertEqual(f.tell(), 512)
+                f.close()
+                self.assertEqual(m.size(), 512)
 
-            # Check that the underlying file is truncated too
-            # (bug #728515)
-            f = open(TESTFN)
-            f.seek(0, 2)
-            verify(f.tell() == 512, 'Underlying file not truncated')
-            f.close()
-            verify(m.size() == 512, 'New size not reflected in file')
-
-        m.close()
+            m.close()
 
-    finally:
-        try:
-            f.close()
-        except OSError:
-            pass
-        try:
-            os.unlink(TESTFN)
-        except OSError:
-            pass
+        finally:
+            try:
+                f.close()
+            except OSError:
+                pass
 
-    # Test for "access" keyword parameter
-    try:
+    def test_access_parameter(self):
+        # Test for "access" keyword parameter
         mapsize = 10
-        print "  Creating", mapsize, "byte test data file."
         open(TESTFN, "wb").write("a"*mapsize)
-        print "  Opening mmap with access=ACCESS_READ"
         f = open(TESTFN, "rb")
         m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_READ)
-        verify(m[:] == 'a'*mapsize, "Readonly memory map data incorrect.")
+        self.assertEqual(m[:], 'a'*mapsize, "Readonly memory map data incorrect.")
 
-        print "  Ensuring that readonly mmap can't be slice assigned."
+        # Ensuring that readonly mmap can't be slice assigned
         try:
             m[:] = 'b'*mapsize
         except TypeError:
             pass
         else:
-            verify(0, "Able to write to readonly memory map")
+            self.fail("Able to write to readonly memory map")
 
-        print "  Ensuring that readonly mmap can't be item assigned."
+        # Ensuring that readonly mmap can't be item assigned
         try:
             m[0] = 'b'
         except TypeError:
             pass
         else:
-            verify(0, "Able to write to readonly memory map")
+            self.fail("Able to write to readonly memory map")
 
-        print "  Ensuring that readonly mmap can't be write() to."
+        # Ensuring that readonly mmap can't be write() to
         try:
             m.seek(0,0)
             m.write('abc')
         except TypeError:
             pass
         else:
-            verify(0, "Able to write to readonly memory map")
+            self.fail("Able to write to readonly memory map")
 
-        print "  Ensuring that readonly mmap can't be write_byte() to."
+        # Ensuring that readonly mmap can't be write_byte() to
         try:
             m.seek(0,0)
             m.write_byte('d')
         except TypeError:
             pass
         else:
-            verify(0, "Able to write to readonly memory map")
+            self.fail("Able to write to readonly memory map")
 
-        print "  Ensuring that readonly mmap can't be resized."
+        # Ensuring that readonly mmap can't be resized
         try:
             m.resize(2*mapsize)
         except SystemError:   # resize is not universally supported
@@ -192,12 +160,12 @@
         except TypeError:
             pass
         else:
-            verify(0, "Able to resize readonly memory map")
+            self.fail("Able to resize readonly memory map")
         del m, f
-        verify(open(TESTFN, "rb").read() == 'a'*mapsize,
+        self.assertEqual(open(TESTFN, "rb").read(), 'a'*mapsize,
                "Readonly memory map data file was modified")
 
-        print "  Opening mmap with size too big"
+        # Opening mmap with size too big
         import sys
         f = open(TESTFN, "r+b")
         try:
@@ -208,11 +176,11 @@
             # later tests assume that the length hasn't changed.  We need to
             # repair that.
             if sys.platform.startswith('win'):
-                verify(0, "Opening mmap with size+1 should work on Windows.")
+                self.fail("Opening mmap with size+1 should work on Windows.")
         else:
             # we expect a ValueError on Unix, but not on Windows
             if not sys.platform.startswith('win'):
-                verify(0, "Opening mmap with size+1 should raise ValueError.")
+                self.fail("Opening mmap with size+1 should raise ValueError.")
             m.close()
         f.close()
         if sys.platform.startswith('win'):
@@ -221,12 +189,12 @@
             f.truncate(mapsize)
             f.close()
 
-        print "  Opening mmap with access=ACCESS_WRITE"
+        # Opening mmap with access=ACCESS_WRITE
         f = open(TESTFN, "r+b")
         m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_WRITE)
-        print "  Modifying write-through memory map."
+        # Modifying write-through memory map
         m[:] = 'c'*mapsize
-        verify(m[:] == 'c'*mapsize,
+        self.assertEqual(m[:], 'c'*mapsize,
                "Write-through memory map memory not updated properly.")
         m.flush()
         m.close()
@@ -234,66 +202,45 @@
         f = open(TESTFN, 'rb')
         stuff = f.read()
         f.close()
-        verify(stuff == 'c'*mapsize,
+        self.assertEqual(stuff, 'c'*mapsize,
                "Write-through memory map data file not updated properly.")
 
-        print "  Opening mmap with access=ACCESS_COPY"
+        # Opening mmap with access=ACCESS_COPY
         f = open(TESTFN, "r+b")
         m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_COPY)
-        print "  Modifying copy-on-write memory map."
+        # Modifying copy-on-write memory map
         m[:] = 'd'*mapsize
-        verify(m[:] == 'd' * mapsize,
+        self.assertEqual(m[:], 'd' * mapsize,
                "Copy-on-write memory map data not written correctly.")
         m.flush()
-        verify(open(TESTFN, "rb").read() == 'c'*mapsize,
+        self.assertEqual(open(TESTFN, "rb").read(), 'c'*mapsize,
                "Copy-on-write test data file should not be modified.")
-        try:
-            print "  Ensuring copy-on-write maps cannot be resized."
-            m.resize(2*mapsize)
-        except TypeError:
-            pass
-        else:
-            verify(0, "Copy-on-write mmap resize did not raise exception.")
+        # Ensuring copy-on-write maps cannot be resized
+        self.assertRaises(TypeError, m.resize, 2*mapsize)
         del m, f
-        try:
-            print "  Ensuring invalid access parameter raises exception."
-            f = open(TESTFN, "r+b")
-            m = mmap.mmap(f.fileno(), mapsize, access=4)
-        except ValueError:
-            pass
-        else:
-            verify(0, "Invalid access code should have raised exception.")
+
+        # Ensuring invalid access parameter raises exception
+        f = open(TESTFN, "r+b")
+        self.assertRaises(ValueError, mmap.mmap, f.fileno(), mapsize, access=4)
+        f.close()
 
         if os.name == "posix":
             # Try incompatible flags, prot and access parameters.
             f = open(TESTFN, "r+b")
-            try:
-                m = mmap.mmap(f.fileno(), mapsize, flags=mmap.MAP_PRIVATE,
+            self.assertRaises(ValueError, mmap.mmap, f.fileno(), mapsize,
+                              flags=mmap.MAP_PRIVATE,
                               prot=mmap.PROT_READ, access=mmap.ACCESS_WRITE)
-            except ValueError:
-                pass
-            else:
-                verify(0, "Incompatible parameters should raise ValueError.")
             f.close()
-    finally:
-        try:
-            os.unlink(TESTFN)
-        except OSError:
-            pass
 
-    print '  Try opening a bad file descriptor...'
-    try:
-        mmap.mmap(-2, 4096)
-    except mmap.error:
-        pass
-    else:
-        verify(0, 'expected a mmap.error but did not get it')
-
-    # Do a tougher .find() test.  SF bug 515943 pointed out that, in 2.2,
-    # searching for data with embedded \0 bytes didn't work.
-    f = open(TESTFN, 'w+')
+    def test_bad_file_desc(self):
+        # Try opening a bad file descriptor...
+        self.assertRaises(mmap.error, mmap.mmap, -2, 4096)
+
+    def test_tougher_find(self):
+        # Do a tougher .find() test.  SF bug 515943 pointed out that, in 2.2,
+        # searching for data with embedded \0 bytes didn't work.
+        f = open(TESTFN, 'w+')
 
-    try:    # unlink TESTFN no matter what
         data = 'aabaac\x00deef\x00\x00aa\x00'
         n = len(data)
         f.write(data)
@@ -304,17 +251,14 @@
         for start in range(n+1):
             for finish in range(start, n+1):
                 slice = data[start : finish]
-                vereq(m.find(slice), data.find(slice))
-                vereq(m.find(slice + 'x'), -1)
+                self.assertEqual(m.find(slice), data.find(slice))
+                self.assertEqual(m.find(slice + 'x'), -1)
         m.close()
 
-    finally:
-        os.unlink(TESTFN)
-
-    # make sure a double close doesn't crash on Solaris (Bug# 665913)
-    f = open(TESTFN, 'w+')
+    def test_double_close(self):
+        # make sure a double close doesn't crash on Solaris (Bug# 665913)
+        f = open(TESTFN, 'w+')
 
-    try:    # unlink TESTFN no matter what
         f.write(2**16 * 'a') # Arbitrary character
         f.close()
 
@@ -324,72 +268,46 @@
         mf.close()
         f.close()
 
-    finally:
-        os.unlink(TESTFN)
+    def test_entire_file(self):
+        # test mapping of entire file by passing 0 for map length
+        if hasattr(os, "stat"):
+            f = open(TESTFN, "w+")
 
-    # test mapping of entire file by passing 0 for map length
-    if hasattr(os, "stat"):
-        print "  Ensuring that passing 0 as map length sets map size to current file size."
-        f = open(TESTFN, "w+")
-
-        try:
             f.write(2**16 * 'm') # Arbitrary character
             f.close()
 
             f = open(TESTFN, "rb+")
             mf = mmap.mmap(f.fileno(), 0)
-            verify(len(mf) == 2**16, "Map size should equal file size.")
-            vereq(mf.read(2**16), 2**16 * "m")
+            self.assertEqual(len(mf), 2**16, "Map size should equal file size.")
+            self.assertEqual(mf.read(2**16), 2**16 * "m")
             mf.close()
             f.close()
 
-        finally:
-            os.unlink(TESTFN)
-
-    # test mapping of entire file by passing 0 for map length
-    if hasattr(os, "stat"):
-        print "  Ensuring that passing 0 as map length sets map size to current file size."
-        f = open(TESTFN, "w+")
-        try:
-            f.write(2**16 * 'm') # Arbitrary character
-            f.close()
+    def test_move(self):
+        # make move works everywhere (64-bit format problem earlier)
+        f = open(TESTFN, 'w+')
 
-            f = open(TESTFN, "rb+")
-            mf = mmap.mmap(f.fileno(), 0)
-            verify(len(mf) == 2**16, "Map size should equal file size.")
-            vereq(mf.read(2**16), 2**16 * "m")
-            mf.close()
-            f.close()
-
-        finally:
-            os.unlink(TESTFN)
-
-    # make move works everywhere (64-bit format problem earlier)
-    f = open(TESTFN, 'w+')
-
-    try:    # unlink TESTFN no matter what
         f.write("ABCDEabcde") # Arbitrary character
         f.flush()
 
         mf = mmap.mmap(f.fileno(), 10)
         mf.move(5, 0, 5)
-        verify(mf[:] == "ABCDEABCDE", "Map move should have duplicated front 5")
+        self.assertEqual(mf[:], "ABCDEABCDE", "Map move should have duplicated front 5")
         mf.close()
         f.close()
 
-    finally:
-        os.unlink(TESTFN)
+    def test_anonymous(self):
+        # anonymous mmap.mmap(-1, PAGE)
+        m = mmap.mmap(-1, PAGESIZE)
+        for x in xrange(PAGESIZE):
+            self.assertEqual(m[x], '\0', "anonymously mmap'ed contents should be zero")
+
+        for x in xrange(PAGESIZE):
+            m[x] = ch = chr(x & 255)
+            self.assertEqual(m[x], ch)
+
+def test_main():
+    run_unittest(MmapTests)
 
-def test_anon():
-    print "  anonymous mmap.mmap(-1, PAGESIZE)..."
-    m = mmap.mmap(-1, PAGESIZE)
-    for x in xrange(PAGESIZE):
-        verify(m[x] == '\0', "anonymously mmap'ed contents should be zero")
-
-    for x in xrange(PAGESIZE):
-        m[x] = ch = chr(x & 255)
-        vereq(m[x], ch)
-
-test_both()
-test_anon()
-print ' Test passed'
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_multibytecodec.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_multibytecodec.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_multibytecodec.py	Fri Dec 15 05:21:50 2006
@@ -49,7 +49,7 @@
         try:
             for enc in ALL_CJKENCODINGS:
                 print >> open(TESTFN, 'w'), '# coding:', enc
-                exec open(TESTFN)
+                execfile(TESTFN)
         finally:
             os.unlink(TESTFN)
 
@@ -202,6 +202,22 @@
         uni = u':hu4:unit\xe9 de famille'
         self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
 
+    def test_iso2022_jp_g0(self):
+        self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
+        for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
+            e = u'\u3406'.encode(encoding)
+            self.failIf(filter(lambda x: x >= '\x80', e))
+
+    def test_bug1572832(self):
+        if sys.maxunicode >= 0x10000:
+            myunichr = unichr
+        else:
+            myunichr = lambda x: unichr(0xD7C0+(x>>10)) + unichr(0xDC00+(x&0x3FF))
+
+        for x in xrange(0x10000, 0x110000):
+            # Any ISO 2022 codec will cause the segfault
+            myunichr(x).encode('iso_2022_jp', 'ignore')
+
 def test_main():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(Test_MultibyteCodec))

Modified: python/branches/p3yk-noslice/Lib/test/test_mutants.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_mutants.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_mutants.py	Fri Dec 15 05:21:50 2006
@@ -88,14 +88,21 @@
         # have any systematic relationship between comparison outcomes
         # (based on self.i and other.i) and relative position within the
         # hash vector (based on hashcode).
-        self.hashcode = random.randrange(1000000000)
+        # XXX This is no longer effective.
+        ##self.hashcode = random.randrange(1000000000)
 
     def __hash__(self):
+        return 42
         return self.hashcode
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         maybe_mutate()   # The point of the test.
-        return cmp(self.i, other.i)
+        return self.i == other.i
+
+    def __ne__(self, other):
+        raise RuntimeError("I didn't expect some kind of Spanish inquisition!")
+
+    __lt__ = __le__ = __gt__ = __ge__ = __ne__
 
     def __repr__(self):
         return "Horrid(%d)" % self.i
@@ -132,7 +139,7 @@
     while dict1 and len(dict1) == len(dict2):
         if verbose:
             print ".",
-        c = cmp(dict1, dict2)
+        c = dict1 == dict2
     if verbose:
         print
 
@@ -202,7 +209,7 @@
         # Tim sez:  "luck of the draw; crashes with or without for me."
         print >> f
 
-        return `"machiavelli"`
+        return repr("machiavelli")
 
     def __hash__(self):
         return 0

Modified: python/branches/p3yk-noslice/Lib/test/test_new.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_new.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_new.py	Fri Dec 15 05:21:50 2006
@@ -47,6 +47,14 @@
 else:
     raise TestFailed, "dangerous instance method creation allowed"
 
+# Verify that instancemethod() doesn't allow keyword args
+try:
+    new.instancemethod(break_yolks, c, kw=1)
+except TypeError:
+    pass
+else:
+    raise TestFailed, "instancemethod shouldn't accept keyword args"
+
 # It's unclear what the semantics should be for a code object compiled at
 # module scope, but bound and run in a function.  In CPython, `c' is global
 # (by accident?) while in Jython, `c' is local.  The intent of the test
@@ -103,6 +111,7 @@
 
     c = f.func_code
     argcount = c.co_argcount
+    kwonlyargcount = c.co_kwonlyargcount
     nlocals = c.co_nlocals
     stacksize = c.co_stacksize
     flags = c.co_flags
@@ -117,17 +126,20 @@
     freevars = c.co_freevars
     cellvars = c.co_cellvars
 
-    d = new.code(argcount, nlocals, stacksize, flags, codestring,
+    d = new.code(argcount, kwonlyargcount,
+                 nlocals, stacksize, flags, codestring,
                  constants, names, varnames, filename, name,
                  firstlineno, lnotab, freevars, cellvars)
 
     # test backwards-compatibility version with no freevars or cellvars
-    d = new.code(argcount, nlocals, stacksize, flags, codestring,
+    d = new.code(argcount, kwonlyargcount,
+                 nlocals, stacksize, flags, codestring,
                  constants, names, varnames, filename, name,
                  firstlineno, lnotab)
 
     try: # this used to trigger a SystemError
-        d = new.code(-argcount, nlocals, stacksize, flags, codestring,
+        d = new.code(-argcount, kwonlyargcount,
+                     nlocals, stacksize, flags, codestring,
                      constants, names, varnames, filename, name,
                      firstlineno, lnotab)
     except ValueError:
@@ -136,7 +148,8 @@
         raise TestFailed, "negative co_argcount didn't trigger an exception"
 
     try: # this used to trigger a SystemError
-        d = new.code(argcount, -nlocals, stacksize, flags, codestring,
+        d = new.code(argcount, kwonlyargcount,
+                     -nlocals, stacksize, flags, codestring,
                      constants, names, varnames, filename, name,
                      firstlineno, lnotab)
     except ValueError:
@@ -145,7 +158,8 @@
         raise TestFailed, "negative co_nlocals didn't trigger an exception"
 
     try: # this used to trigger a Py_FatalError!
-        d = new.code(argcount, nlocals, stacksize, flags, codestring,
+        d = new.code(argcount, kwonlyargcount,
+                     nlocals, stacksize, flags, codestring,
                      constants, (5,), varnames, filename, name,
                      firstlineno, lnotab)
     except TypeError:
@@ -156,7 +170,8 @@
     # new.code used to be a way to mutate a tuple...
     class S(str): pass
     t = (S("ab"),)
-    d = new.code(argcount, nlocals, stacksize, flags, codestring,
+    d = new.code(argcount, kwonlyargcount,
+                 nlocals, stacksize, flags, codestring,
                  constants, t, varnames, filename, name,
                  firstlineno, lnotab)
     verify(type(t[0]) is S, "eek, tuple changed under us!")

Modified: python/branches/p3yk-noslice/Lib/test/test_nis.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_nis.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_nis.py	Fri Dec 15 05:21:50 2006
@@ -1,32 +1,41 @@
-from test.test_support import verbose, TestFailed, TestSkipped
+from test.test_support import verbose, run_unittest
+import unittest
 import nis
 
-print 'nis.maps()'
-try:
-    maps = nis.maps()
-except nis.error, msg:
-    # NIS is probably not active, so this test isn't useful
-    if verbose:
-        raise TestFailed, msg
-    # only do this if running under the regression suite
-    raise TestSkipped, msg
+class NisTests(unittest.TestCase):
+    def test_maps(self):
+        try:
+            maps = nis.maps()
+        except nis.error, msg:
+            # NIS is probably not active, so this test isn't useful
+            if verbose:
+                self.fail("(failing because of verbose mode) %s" % msg)
+            return
+        try:
+            # On some systems, this map is only accessible to the
+            # super user
+            maps.remove("passwd.adjunct.byname")
+        except ValueError:
+            pass
 
-done = 0
-for nismap in maps:
-    if verbose:
-        print nismap
-    mapping = nis.cat(nismap)
-    for k, v in mapping.items():
-        if verbose:
-            print '    ', k, v
-        if not k:
-            continue
-        if nis.match(k, nismap) != v:
-            print "NIS match failed for key `%s' in map `%s'" % (k, nismap)
-        else:
-            # just test the one key, otherwise this test could take a
-            # very long time
-            done = 1
-            break
-    if done:
-        break
+        done = 0
+        for nismap in maps:
+            mapping = nis.cat(nismap)
+            for k, v in mapping.items():
+                if not k:
+                    continue
+                if nis.match(k, nismap) != v:
+                    self.fail("NIS match failed for key `%s' in map `%s'" % (k, nismap))
+                else:
+                    # just test the one key, otherwise this test could take a
+                    # very long time
+                    done = 1
+                    break
+            if done:
+                break
+
+def test_main():
+    run_unittest(NisTests)
+
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_opcodes.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_opcodes.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_opcodes.py	Fri Dec 15 05:21:50 2006
@@ -1,101 +1,110 @@
 # Python test set -- part 2, opcodes
 
-from test.test_support import TestFailed
+from test.test_support import run_unittest
+import unittest
 
+class OpcodeTest(unittest.TestCase):
 
-print '2. Opcodes'
-print 'XXX Not yet fully implemented'
+    def test_try_inside_for_loop(self):
+        n = 0
+        for i in range(10):
+            n = n+i
+            try: 1/0
+            except NameError: pass
+            except ZeroDivisionError: pass
+            except TypeError: pass
+            try: pass
+            except: pass
+            try: pass
+            finally: pass
+            n = n+i
+        if n != 90:
+            self.fail('try inside for')
+
+    def test_raise_class_exceptions(self):
+
+        class AClass(Exception): pass
+        class BClass(AClass): pass
+        class CClass(Exception): pass
+        class DClass(AClass):
+            def __init__(self, ignore):
+                pass
+
+        try: raise AClass()
+        except: pass
+
+        try: raise AClass()
+        except AClass: pass
+
+        try: raise BClass()
+        except AClass: pass
+
+        try: raise BClass()
+        except CClass: self.fail()
+        except: pass
+
+        a = AClass()
+        b = BClass()
+
+        try: raise AClass, b
+        except BClass, v:
+            if v != b: self.fail("v!=b")
+        else: self.fail("no exception")
+
+        try: raise b
+        except AClass, v:
+            if v != b: self.fail("v!=b AClass")
+        else:
+            self.fail("no exception")
+
+        # not enough arguments
+        ##try:  raise BClass, a
+        ##except TypeError: pass
+        ##else: self.fail("no exception")
+
+        try:  raise DClass, a
+        except DClass, v:
+            self.assert_(isinstance(v, DClass))
+        else:
+            self.fail("no exception")
+
+    def test_compare_function_objects(self):
+
+        f = eval('lambda: None')
+        g = eval('lambda: None')
+        self.failIf(f == g)
+
+        f = eval('lambda a: a')
+        g = eval('lambda a: a')
+        self.failIf(f == g)
+
+        f = eval('lambda a=1: a')
+        g = eval('lambda a=1: a')
+        self.failIf(f == g)
+
+        f = eval('lambda: 0')
+        g = eval('lambda: 1')
+        self.failIf(f == g)
+
+        f = eval('lambda: None')
+        g = eval('lambda a: None')
+        self.failIf(f == g)
+
+        f = eval('lambda a: None')
+        g = eval('lambda b: None')
+        self.failIf(f == g)
+
+        f = eval('lambda a: None')
+        g = eval('lambda a=None: None')
+        self.failIf(f == g)
+
+        f = eval('lambda a=0: None')
+        g = eval('lambda a=1: None')
+        self.failIf(f == g)
 
-print '2.1 try inside for loop'
-n = 0
-for i in range(10):
-    n = n+i
-    try: 1/0
-    except NameError: pass
-    except ZeroDivisionError: pass
-    except TypeError: pass
-    try: pass
-    except: pass
-    try: pass
-    finally: pass
-    n = n+i
-if n != 90:
-    raise TestFailed, 'try inside for'
-
-
-print '2.2 raise class exceptions'
-
-class AClass(Exception): pass
-class BClass(AClass): pass
-class CClass(Exception): pass
-class DClass(AClass):
-    def __init__(self, ignore):
-        pass
-
-try: raise AClass()
-except: pass
-
-try: raise AClass()
-except AClass: pass
-
-try: raise BClass()
-except AClass: pass
-
-try: raise BClass()
-except CClass: raise TestFailed
-except: pass
-
-a = AClass()
-b = BClass()
-
-try: raise AClass, b
-except BClass, v:
-    if v != b: raise TestFailed, "v!=b"
-else: raise TestFailed, "no exception"
-
-try: raise b
-except AClass, v:
-    if v != b: raise TestFailed, "v!=b AClass"
-
-# not enough arguments
-##try:  raise BClass, a
-##except TypeError: pass
-
-try:  raise DClass, a
-except DClass, v:
-    if not isinstance(v, DClass):
-        raise TestFailed, "v not DClass"
-
-print '2.3 comparing function objects'
-
-f = eval('lambda: None')
-g = eval('lambda: None')
-if f == g: raise TestFailed, "functions should not be same"
-
-f = eval('lambda a: a')
-g = eval('lambda a: a')
-if f == g: raise TestFailed, "functions should not be same"
-
-f = eval('lambda a=1: a')
-g = eval('lambda a=1: a')
-if f == g: raise TestFailed, "functions should not be same"
-
-f = eval('lambda: 0')
-g = eval('lambda: 1')
-if f == g: raise TestFailed
-
-f = eval('lambda: None')
-g = eval('lambda a: None')
-if f == g: raise TestFailed
-
-f = eval('lambda a: None')
-g = eval('lambda b: None')
-if f == g: raise TestFailed
-
-f = eval('lambda a: None')
-g = eval('lambda a=None: None')
-if f == g: raise TestFailed
-
-f = eval('lambda a=0: None')
-g = eval('lambda a=1: None')
-if f == g: raise TestFailed
+
+def test_main():
+    run_unittest(OpcodeTest)
+
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_openpty.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_openpty.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_openpty.py	Fri Dec 15 05:21:50 2006
@@ -1,19 +1,23 @@
 # Test to see if openpty works. (But don't worry if it isn't available.)
 
-import os
-from test.test_support import verbose, TestFailed, TestSkipped
+import os, unittest
+from test.test_support import run_unittest, TestSkipped
 
-try:
-    if verbose:
-        print "Calling os.openpty()"
-    master, slave = os.openpty()
-    if verbose:
-        print "(master, slave) = (%d, %d)"%(master, slave)
-except AttributeError:
+if not hasattr(os, "openpty"):
     raise TestSkipped, "No openpty() available."
 
-if not os.isatty(slave):
-    raise TestFailed, "Slave-end of pty is not a terminal."
 
-os.write(slave, 'Ping!')
-print os.read(master, 1024)
+class OpenptyTest(unittest.TestCase):
+    def test(self):
+        master, slave = os.openpty()
+        if not os.isatty(slave):
+            self.fail("Slave-end of pty is not a terminal.")
+
+        os.write(slave, 'Ping!')
+        self.assertEqual(os.read(master, 1024), 'Ping!')
+
+def test_main():
+    run_unittest(OpenptyTest)
+
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_operations.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_operations.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_operations.py	Fri Dec 15 05:21:50 2006
@@ -12,7 +12,7 @@
     def __hash__(self):
         return hash(self.__class__)
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if isinstance(other, self.__class__):
             print "raising error"
             raise RuntimeError, "gotcha"
@@ -30,11 +30,11 @@
              'd.pop(x2)',
              'd.update({x2: 2})']:
     try:
-        exec stmt
+        exec(stmt)
     except RuntimeError:
         print "%s: caught the RuntimeError outside" % (stmt,)
     else:
-        print "%s: No exception passed through!"     # old CPython behavior
+        print "%s: No exception passed through!" % (stmt,) # old CPython behavior
 
 
 # Dict resizing bug, found by Jack Jansen in 2.2 CVS development.

Modified: python/branches/p3yk-noslice/Lib/test/test_operator.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_operator.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_operator.py	Fri Dec 15 05:21:50 2006
@@ -319,7 +319,7 @@
 
     def test_truth(self):
         class C(object):
-            def __nonzero__(self):
+            def __bool__(self):
                 raise SyntaxError
         self.failUnlessRaises(TypeError, operator.truth)
         self.failUnlessRaises(SyntaxError, operator.truth, C())

Modified: python/branches/p3yk-noslice/Lib/test/test_os.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_os.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_os.py	Fri Dec 15 05:21:50 2006
@@ -223,6 +223,23 @@
         except TypeError:
             pass
 
+    def test_utime_dir(self):
+        delta = 1000000
+        st = os.stat(test_support.TESTFN)
+        # round to int, because some systems may support sub-second
+        # time stamps in stat, but not in utime.
+        os.utime(test_support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
+        st2 = os.stat(test_support.TESTFN)
+        self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))
+
+    # Restrict test to Win32, since there is no guarantee other
+    # systems support centiseconds
+    if sys.platform == 'win32':
+        def test_1565150(self):
+            t1 = 1159195039.25
+            os.utime(self.fname, (t1, t1))
+            self.assertEquals(os.stat(self.fname).st_mtime, t1)
+
 from test import mapping_tests
 
 class EnvironTests(mapping_tests.BasicTestMappingProtocol):
@@ -273,7 +290,7 @@
         os.makedirs(sub11_path)
         os.makedirs(sub2_path)
         for path in tmp1_path, tmp2_path, tmp3_path:
-            f = file(path, "w")
+            f = open(path, "w")
             f.write("I'm " + path + " and proud of it.  Blame test_os.\n")
             f.close()
 
@@ -361,10 +378,10 @@
 
 class DevNullTests (unittest.TestCase):
     def test_devnull(self):
-        f = file(os.devnull, 'w')
+        f = open(os.devnull, 'w')
         f.write('hello')
         f.close()
-        f = file(os.devnull, 'r')
+        f = open(os.devnull, 'r')
         self.assertEqual(f.read(), '')
         f.close()
 

Modified: python/branches/p3yk-noslice/Lib/test/test_parser.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_parser.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_parser.py	Fri Dec 15 05:21:50 2006
@@ -183,6 +183,44 @@
     def test_assert(self):
         self.check_suite("assert alo < ahi and blo < bhi\n")
 
+    def test_position(self):
+        # An absolutely minimal test of position information.  Better
+        # tests would be a big project.
+        code = "def f(x):\n    return x + 1\n"
+        st1 = parser.suite(code)
+        st2 = st1.totuple(line_info=1, col_info=1)
+
+        def walk(tree):
+            node_type = tree[0]
+            next = tree[1]
+            if isinstance(next, tuple):
+                for elt in tree[1:]:
+                    for x in walk(elt):
+                        yield x
+            else:
+                yield tree
+
+        terminals = list(walk(st2))
+        self.assertEqual([
+            (1, 'def', 1, 0),
+            (1, 'f', 1, 4),
+            (7, '(', 1, 5),
+            (1, 'x', 1, 6),
+            (8, ')', 1, 7),
+            (11, ':', 1, 8),
+            (4, '', 1, 9),
+            (5, '', 2, -1),
+            (1, 'return', 2, 4),
+            (1, 'x', 2, 11),
+            (14, '+', 2, 13),
+            (2, '1', 2, 15),
+            (4, '', 2, 16),
+            (6, '', 2, -1),
+            (4, '', 2, -1),
+            (0, '', 2, -1)],
+                         terminals)
+
+
 #
 #  Second, we take *invalid* trees and make sure we get ParserError
 #  rejections for them.
@@ -429,7 +467,7 @@
         st = parser.suite('x = 2; y = x + 3')
         code = parser.compilest(st)
         globs = {}
-        exec code in globs
+        exec(code, globs)
         self.assertEquals(globs['y'], 5)
 
     def test_compile_error(self):

Modified: python/branches/p3yk-noslice/Lib/test/test_peepholer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_peepholer.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_peepholer.py	Fri Dec 15 05:21:50 2006
@@ -135,7 +135,6 @@
 
     def test_folding_of_unaryops_on_constants(self):
         for line, elem in (
-            ('`1`', "('1')"),                       # unary convert
             ('-0.5', '(-0.5)'),                     # unary negative
             ('~-2', '(1)'),                         # unary invert
         ):
@@ -161,6 +160,41 @@
         self.assert_('(None)' not in asm)
         self.assertEqual(asm.split().count('RETURN_VALUE'), 1)
 
+    def test_elim_jump_to_return(self):
+        # JUMP_FORWARD to RETURN -->  RETURN
+        def f(cond, true_value, false_value):
+            return true_value if cond else false_value
+        asm = disassemble(f)
+        self.assert_('JUMP_FORWARD' not in asm)
+        self.assert_('JUMP_ABSOLUTE' not in asm)
+        self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
+
+    def test_elim_jump_after_return1(self):
+        # Eliminate dead code: jumps immediately after returns can't be reached
+        def f(cond1, cond2):
+            if cond1: return 1
+            if cond2: return 2
+            while 1:
+                return 3
+            while 1:
+                if cond1: return 4
+                return 5
+            return 6
+        asm = disassemble(f)
+        self.assert_('JUMP_FORWARD' not in asm)
+        self.assert_('JUMP_ABSOLUTE' not in asm)
+        self.assertEqual(asm.split().count('RETURN_VALUE'), 6)
+
+    def test_elim_jump_after_return2(self):
+        # Eliminate dead code: jumps immediately after returns can't be reached
+        def f(cond1, cond2):
+            while 1:
+                if cond1: return 4
+        asm = disassemble(f)
+        self.assert_('JUMP_FORWARD' not in asm)
+        # There should be one jump for the while loop.
+        self.assertEqual(asm.split().count('JUMP_ABSOLUTE'), 1)
+        self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
 
 
 def test_main(verbose=None):

Modified: python/branches/p3yk-noslice/Lib/test/test_pep352.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_pep352.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_pep352.py	Fri Dec 15 05:21:50 2006
@@ -15,8 +15,7 @@
         self.failUnless(issubclass(Exception, object))
 
     def verify_instance_interface(self, ins):
-        for attr in ("args", "message", "__str__", "__unicode__", "__repr__",
-                "__getitem__"):
+        for attr in ("args", "message", "__str__", "__repr__", "__getitem__"):
             self.failUnless(hasattr(ins, attr), "%s missing %s attribute" %
                     (ins.__class__.__name__, attr))
 

Modified: python/branches/p3yk-noslice/Lib/test/test_poll.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_poll.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_poll.py	Fri Dec 15 05:21:50 2006
@@ -1,7 +1,7 @@
 # Test case for the os.poll() function
 
-import sys, os, select, random
-from test.test_support import verify, verbose, TestSkipped, TESTFN
+import sys, os, select, random, unittest
+from test.test_support import TestSkipped, TESTFN, run_unittest
 
 try:
     select.poll
@@ -16,177 +16,141 @@
             match.append(fd)
     return match
 
-def test_poll1():
-    """Basic functional test of poll object
+class PollTests(unittest.TestCase):
 
-    Create a bunch of pipe and test that poll works with them.
-    """
-    print 'Running poll test 1'
-    p = select.poll()
-
-    NUM_PIPES = 12
-    MSG = " This is a test."
-    MSG_LEN = len(MSG)
-    readers = []
-    writers = []
-    r2w = {}
-    w2r = {}
-
-    for i in range(NUM_PIPES):
-        rd, wr = os.pipe()
-        p.register(rd, select.POLLIN)
-        p.register(wr, select.POLLOUT)
-        readers.append(rd)
-        writers.append(wr)
-        r2w[rd] = wr
-        w2r[wr] = rd
-
-    while writers:
-        ready = p.poll()
-        ready_writers = find_ready_matching(ready, select.POLLOUT)
-        if not ready_writers:
-            raise RuntimeError, "no pipes ready for writing"
-        wr = random.choice(ready_writers)
-        os.write(wr, MSG)
-
-        ready = p.poll()
-        ready_readers = find_ready_matching(ready, select.POLLIN)
-        if not ready_readers:
-            raise RuntimeError, "no pipes ready for reading"
-        rd = random.choice(ready_readers)
-        buf = os.read(rd, MSG_LEN)
-        verify(len(buf) == MSG_LEN)
-        print buf
-        os.close(r2w[rd]) ; os.close( rd )
-        p.unregister( r2w[rd] )
-        p.unregister( rd )
-        writers.remove(r2w[rd])
-
-    poll_unit_tests()
-    print 'Poll test 1 complete'
-
-def poll_unit_tests():
-    # returns NVAL for invalid file descriptor
-    FD = 42
-    try:
-        os.close(FD)
-    except OSError:
-        pass
-    p = select.poll()
-    p.register(FD)
-    r = p.poll()
-    verify(r[0] == (FD, select.POLLNVAL))
-
-    f = open(TESTFN, 'w')
-    fd = f.fileno()
-    p = select.poll()
-    p.register(f)
-    r = p.poll()
-    verify(r[0][0] == fd)
-    f.close()
-    r = p.poll()
-    verify(r[0] == (fd, select.POLLNVAL))
-    os.unlink(TESTFN)
-
-    # type error for invalid arguments
-    p = select.poll()
-    try:
-        p.register(p)
-    except TypeError:
-        pass
-    else:
-        print "Bogus register call did not raise TypeError"
-    try:
-        p.unregister(p)
-    except TypeError:
-        pass
-    else:
-        print "Bogus unregister call did not raise TypeError"
-
-    # can't unregister non-existent object
-    p = select.poll()
-    try:
-        p.unregister(3)
-    except KeyError:
-        pass
-    else:
-        print "Bogus unregister call did not raise KeyError"
-
-    # Test error cases
-    pollster = select.poll()
-    class Nope:
-        pass
-
-    class Almost:
-        def fileno(self):
-            return 'fileno'
-
-    try:
-        pollster.register( Nope(), 0 )
-    except TypeError: pass
-    else: print 'expected TypeError exception, not raised'
-
-    try:
-        pollster.register( Almost(), 0 )
-    except TypeError: pass
-    else: print 'expected TypeError exception, not raised'
-
-
-# Another test case for poll().  This is copied from the test case for
-# select(), modified to use poll() instead.
-
-def test_poll2():
-    print 'Running poll test 2'
-    cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
-    p = os.popen(cmd, 'r')
-    pollster = select.poll()
-    pollster.register( p, select.POLLIN )
-    for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10:
-        if verbose:
-            print 'timeout =', tout
-        fdlist = pollster.poll(tout)
-        if (fdlist == []):
-            continue
-        fd, flags = fdlist[0]
-        if flags & select.POLLHUP:
-            line = p.readline()
-            if line != "":
-                print 'error: pipe seems to be closed, but still returns data'
-            continue
-
-        elif flags & select.POLLIN:
-            line = p.readline()
-            if verbose:
-                print repr(line)
-            if not line:
-                if verbose:
-                    print 'EOF'
-                break
-            continue
-        else:
-            print 'Unexpected return value from select.poll:', fdlist
-    p.close()
-    print 'Poll test 2 complete'
-
-def test_poll3():
-    # test int overflow
-    print 'Running poll test 3'
-    pollster = select.poll()
-    pollster.register(1)
-
-    try:
-        pollster.poll(1L << 64)
-    except OverflowError:
-        pass
-    else:
-        print 'Expected OverflowError with excessive timeout'
-
-    x = 2 + 3
-    if x != 5:
-        print 'Overflow must have occurred'
-    print 'Poll test 3 complete'
-
-
-test_poll1()
-test_poll2()
-test_poll3()
+    def test_poll1(self):
+        # Basic functional test of poll object
+        # Create a bunch of pipe and test that poll works with them.
+
+        p = select.poll()
+
+        NUM_PIPES = 12
+        MSG = " This is a test."
+        MSG_LEN = len(MSG)
+        readers = []
+        writers = []
+        r2w = {}
+        w2r = {}
+
+        for i in range(NUM_PIPES):
+            rd, wr = os.pipe()
+            p.register(rd, select.POLLIN)
+            p.register(wr, select.POLLOUT)
+            readers.append(rd)
+            writers.append(wr)
+            r2w[rd] = wr
+            w2r[wr] = rd
+
+        bufs = []
+
+        while writers:
+            ready = p.poll()
+            ready_writers = find_ready_matching(ready, select.POLLOUT)
+            if not ready_writers:
+                raise RuntimeError, "no pipes ready for writing"
+            wr = random.choice(ready_writers)
+            os.write(wr, MSG)
+
+            ready = p.poll()
+            ready_readers = find_ready_matching(ready, select.POLLIN)
+            if not ready_readers:
+                raise RuntimeError, "no pipes ready for reading"
+            rd = random.choice(ready_readers)
+            buf = os.read(rd, MSG_LEN)
+            self.assertEqual(len(buf), MSG_LEN)
+            bufs.append(buf)
+            os.close(r2w[rd]) ; os.close( rd )
+            p.unregister( r2w[rd] )
+            p.unregister( rd )
+            writers.remove(r2w[rd])
+
+        self.assertEqual(bufs, [MSG] * NUM_PIPES)
+
+    def poll_unit_tests(self):
+        # returns NVAL for invalid file descriptor
+        FD = 42
+        try:
+            os.close(FD)
+        except OSError:
+            pass
+        p = select.poll()
+        p.register(FD)
+        r = p.poll()
+        self.assertEqual(r[0], (FD, select.POLLNVAL))
+
+        f = open(TESTFN, 'w')
+        fd = f.fileno()
+        p = select.poll()
+        p.register(f)
+        r = p.poll()
+        self.assertEqual(r[0][0], fd)
+        f.close()
+        r = p.poll()
+        self.assertEqual(r[0], (fd, select.POLLNVAL))
+        os.unlink(TESTFN)
+
+        # type error for invalid arguments
+        p = select.poll()
+        self.assertRaises(TypeError, p.register, p)
+        self.assertRaises(TypeError, p.unregister, p)
+
+        # can't unregister non-existent object
+        p = select.poll()
+        self.assertRaises(KeyError, p.unregister, 3)
+
+        # Test error cases
+        pollster = select.poll()
+        class Nope:
+            pass
+
+        class Almost:
+            def fileno(self):
+                return 'fileno'
+
+        self.assertRaises(TypeError, pollster.register, Nope(), 0)
+        self.assertRaises(TypeError, pollster.register, Almost(), 0)
+
+    # Another test case for poll().  This is copied from the test case for
+    # select(), modified to use poll() instead.
+
+    def test_poll2(self):
+        cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
+        p = os.popen(cmd, 'r')
+        pollster = select.poll()
+        pollster.register( p, select.POLLIN )
+        for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10:
+            fdlist = pollster.poll(tout)
+            if (fdlist == []):
+                continue
+            fd, flags = fdlist[0]
+            if flags & select.POLLHUP:
+                line = p.readline()
+                if line != "":
+                    self.fail('error: pipe seems to be closed, but still returns data')
+                continue
+
+            elif flags & select.POLLIN:
+                line = p.readline()
+                if not line:
+                    break
+                continue
+            else:
+                self.fail('Unexpected return value from select.poll: %s' % fdlist)
+        p.close()
+
+    def test_poll3(self):
+        # test int overflow
+        pollster = select.poll()
+        pollster.register(1)
+
+        self.assertRaises(OverflowError, pollster.poll, 1L << 64)
+
+        x = 2 + 3
+        if x != 5:
+            self.fail('Overflow must have occurred')
+
+def test_main():
+    run_unittest(PollTests)
+
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_pyclbr.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_pyclbr.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_pyclbr.py	Fri Dec 15 05:21:50 2006
@@ -95,6 +95,9 @@
             py_item = getattr(module, name)
             if isinstance(value, pyclbr.Function):
                 self.assert_(isinstance(py_item, (FunctionType, BuiltinFunctionType)))
+                if py_item.__module__ != moduleName:
+                    continue   # skip functions that came from somewhere else
+                self.assertEquals(py_item.__module__, value.module)
             else:
                 self.failUnless(isinstance(py_item, (ClassType, type)))
                 if py_item.__module__ != moduleName:

Modified: python/branches/p3yk-noslice/Lib/test/test_rfc822.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_rfc822.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_rfc822.py	Fri Dec 15 05:21:50 2006
@@ -46,9 +46,9 @@
                 continue
             i = i + 1
             self.assertEqual(mn, n,
-                             "Un-expected name: %s != %s" % (`mn`, `n`))
+                             "Un-expected name: %r != %r" % (mn, n))
             self.assertEqual(ma, a,
-                             "Un-expected address: %s != %s" % (`ma`, `a`))
+                             "Un-expected address: %r != %r" % (ma, a))
             if mn == n and ma == a:
                 pass
             else:

Modified: python/branches/p3yk-noslice/Lib/test/test_richcmp.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_richcmp.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_richcmp.py	Fri Dec 15 05:21:50 2006
@@ -51,7 +51,7 @@
     def __hash__(self):
         raise TypeError, "Vectors cannot be hashed"
 
-    def __nonzero__(self):
+    def __bool__(self):
         raise TypeError, "Vectors cannot be used in Boolean contexts"
 
     def __cmp__(self, other):
@@ -133,7 +133,7 @@
 
             for ops in opmap.itervalues():
                 for op in ops:
-                    # calls __nonzero__, which should fail
+                    # calls __bool__, which should fail
                     self.assertRaises(TypeError, bool, op(a, b))
 
 class NumberTest(unittest.TestCase):
@@ -208,13 +208,13 @@
         self.assertRaises(RuntimeError, cmp, a, b)
 
     def test_not(self):
-        # Check that exceptions in __nonzero__ are properly
+        # Check that exceptions in __bool__ are properly
         # propagated by the not operator
         import operator
         class Exc(Exception):
             pass
         class Bad:
-            def __nonzero__(self):
+            def __bool__(self):
                 raise Exc
 
         def do(bad):

Modified: python/branches/p3yk-noslice/Lib/test/test_scope.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_scope.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_scope.py	Fri Dec 15 05:21:50 2006
@@ -1,186 +1,190 @@
-from test.test_support import verify, TestFailed, check_syntax, vereq
+import unittest
+from test.test_support import check_syntax_error, run_unittest
 
 import warnings
+warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<test string>")
 warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<string>")
 
-print "1. simple nesting"
+class ScopeTests(unittest.TestCase):
 
-def make_adder(x):
-    def adder(y):
-        return x + y
-    return adder
+    def testSimpleNesting(self):
 
-inc = make_adder(1)
-plus10 = make_adder(10)
+        def make_adder(x):
+            def adder(y):
+                return x + y
+            return adder
 
-vereq(inc(1), 2)
-vereq(plus10(-2), 8)
+        inc = make_adder(1)
+        plus10 = make_adder(10)
 
-print "2. extra nesting"
+        self.assertEqual(inc(1), 2)
+        self.assertEqual(plus10(-2), 8)
 
-def make_adder2(x):
-    def extra(): # check freevars passing through non-use scopes
-        def adder(y):
-            return x + y
-        return adder
-    return extra()
+    def testExtraNesting(self):
 
-inc = make_adder2(1)
-plus10 = make_adder2(10)
+        def make_adder2(x):
+            def extra(): # check freevars passing through non-use scopes
+                def adder(y):
+                    return x + y
+                return adder
+            return extra()
 
-vereq(inc(1), 2)
-vereq(plus10(-2), 8)
+        inc = make_adder2(1)
+        plus10 = make_adder2(10)
 
-print "3. simple nesting + rebinding"
+        self.assertEqual(inc(1), 2)
+        self.assertEqual(plus10(-2), 8)
 
-def make_adder3(x):
-    def adder(y):
-        return x + y
-    x = x + 1 # check tracking of assignment to x in defining scope
-    return adder
+    def testSimpleAndRebinding(self):
 
-inc = make_adder3(0)
-plus10 = make_adder3(9)
+        def make_adder3(x):
+            def adder(y):
+                return x + y
+            x = x + 1 # check tracking of assignment to x in defining scope
+            return adder
 
-vereq(inc(1), 2)
-vereq(plus10(-2), 8)
+        inc = make_adder3(0)
+        plus10 = make_adder3(9)
 
-print "4. nesting with global but no free"
+        self.assertEqual(inc(1), 2)
+        self.assertEqual(plus10(-2), 8)
 
-def make_adder4(): # XXX add exta level of indirection
-    def nest():
-        def nest():
-            def adder(y):
-                return global_x + y # check that plain old globals work
-            return adder
-        return nest()
-    return nest()
+    def testNestingGlobalNoFree(self):
 
-global_x = 1
-adder = make_adder4()
-vereq(adder(1), 2)
+        def make_adder4(): # XXX add exta level of indirection
+            def nest():
+                def nest():
+                    def adder(y):
+                        return global_x + y # check that plain old globals work
+                    return adder
+                return nest()
+            return nest()
 
-global_x = 10
-vereq(adder(-2), 8)
+        global_x = 1
+        adder = make_adder4()
+        self.assertEqual(adder(1), 2)
 
-print "5. nesting through class"
+        global_x = 10
+        self.assertEqual(adder(-2), 8)
 
-def make_adder5(x):
-    class Adder:
-        def __call__(self, y):
-            return x + y
-    return Adder()
+    def testNestingThroughClass(self):
 
-inc = make_adder5(1)
-plus10 = make_adder5(10)
+        def make_adder5(x):
+            class Adder:
+                def __call__(self, y):
+                    return x + y
+            return Adder()
 
-vereq(inc(1), 2)
-vereq(plus10(-2), 8)
+        inc = make_adder5(1)
+        plus10 = make_adder5(10)
 
-print "6. nesting plus free ref to global"
+        self.assertEqual(inc(1), 2)
+        self.assertEqual(plus10(-2), 8)
 
-def make_adder6(x):
-    global global_nest_x
-    def adder(y):
-        return global_nest_x + y
-    global_nest_x = x
-    return adder
+    def testNestingPlusFreeRefToGlobal(self):
 
-inc = make_adder6(1)
-plus10 = make_adder6(10)
+        def make_adder6(x):
+            global global_nest_x
+            def adder(y):
+                return global_nest_x + y
+            global_nest_x = x
+            return adder
 
-vereq(inc(1), 11) # there's only one global
-vereq(plus10(-2), 8)
+        inc = make_adder6(1)
+        plus10 = make_adder6(10)
 
-print "7. nearest enclosing scope"
+        self.assertEqual(inc(1), 11) # there's only one global
+        self.assertEqual(plus10(-2), 8)
 
-def f(x):
-    def g(y):
-        x = 42 # check that this masks binding in f()
-        def h(z):
-            return x + z
-        return h
-    return g(2)
-
-test_func = f(10)
-vereq(test_func(5), 47)
-
-print "8. mixed freevars and cellvars"
-
-def identity(x):
-    return x
-
-def f(x, y, z):
-    def g(a, b, c):
-        a = a + x # 3
-        def h():
-            # z * (4 + 9)
-            # 3 * 13
-            return identity(z * (b + y))
-        y = c + z # 9
-        return h
-    return g
-
-g = f(1, 2, 3)
-h = g(2, 4, 6)
-vereq(h(), 39)
-
-print "9. free variable in method"
-
-def test():
-    method_and_var = "var"
-    class Test:
-        def method_and_var(self):
-            return "method"
-        def test(self):
-            return method_and_var
-        def actual_global(self):
-            return str("global")
-        def str(self):
-            return str(self)
-    return Test()
-
-t = test()
-vereq(t.test(), "var")
-vereq(t.method_and_var(), "method")
-vereq(t.actual_global(), "global")
-
-method_and_var = "var"
-class Test:
-    # this class is not nested, so the rules are different
-    def method_and_var(self):
-        return "method"
-    def test(self):
-        return method_and_var
-    def actual_global(self):
-        return str("global")
-    def str(self):
-        return str(self)
-
-t = Test()
-vereq(t.test(), "var")
-vereq(t.method_and_var(), "method")
-vereq(t.actual_global(), "global")
+    def testNearestEnclosingScope(self):
 
-print "10. recursion"
+        def f(x):
+            def g(y):
+                x = 42 # check that this masks binding in f()
+                def h(z):
+                    return x + z
+                return h
+            return g(2)
 
-def f(x):
-    def fact(n):
-        if n == 0:
-            return 1
-        else:
-            return n * fact(n - 1)
-    if x >= 0:
-        return fact(x)
-    else:
-        raise ValueError, "x must be >= 0"
+        test_func = f(10)
+        self.assertEqual(test_func(5), 47)
+
+    def testMixedFreevarsAndCellvars(self):
+
+        def identity(x):
+            return x
 
-vereq(f(6), 720)
+        def f(x, y, z):
+            def g(a, b, c):
+                a = a + x # 3
+                def h():
+                    # z * (4 + 9)
+                    # 3 * 13
+                    return identity(z * (b + y))
+                y = c + z # 9
+                return h
+            return g
+
+        g = f(1, 2, 3)
+        h = g(2, 4, 6)
+        self.assertEqual(h(), 39)
+
+    def testFreeVarInMethod(self):
+
+        def test():
+            method_and_var = "var"
+            class Test:
+                def method_and_var(self):
+                    return "method"
+                def test(self):
+                    return method_and_var
+                def actual_global(self):
+                    return str("global")
+                def str(self):
+                    return str(self)
+            return Test()
+
+        t = test()
+        self.assertEqual(t.test(), "var")
+        self.assertEqual(t.method_and_var(), "method")
+        self.assertEqual(t.actual_global(), "global")
+
+        method_and_var = "var"
+        class Test:
+            # this class is not nested, so the rules are different
+            def method_and_var(self):
+                return "method"
+            def test(self):
+                return method_and_var
+            def actual_global(self):
+                return str("global")
+            def str(self):
+                return str(self)
+
+        t = Test()
+        self.assertEqual(t.test(), "var")
+        self.assertEqual(t.method_and_var(), "method")
+        self.assertEqual(t.actual_global(), "global")
+
+    def testRecursion(self):
+
+        def f(x):
+            def fact(n):
+                if n == 0:
+                    return 1
+                else:
+                    return n * fact(n - 1)
+            if x >= 0:
+                return fact(x)
+            else:
+                raise ValueError, "x must be >= 0"
 
+        self.assertEqual(f(6), 720)
 
-print "11. unoptimized namespaces"
 
-check_syntax("""\
+    def testUnoptimizedNamespaces(self):
+
+        check_syntax_error(self, """\
 def unoptimized_clash1(strip):
     def f(s):
         from string import *
@@ -188,7 +192,7 @@
     return f
 """)
 
-check_syntax("""\
+        check_syntax_error(self, """\
 def unoptimized_clash2():
     from string import *
     def f(s):
@@ -196,7 +200,7 @@
     return f
 """)
 
-check_syntax("""\
+        check_syntax_error(self, """\
 def unoptimized_clash2():
     from string import *
     def g():
@@ -205,32 +209,23 @@
         return f
 """)
 
-# XXX could allow this for exec with const argument, but what's the point
-check_syntax("""\
-def error(y):
-    exec "a = 1"
-    def f(x):
-        return x + y
-    return f
-""")
-
-check_syntax("""\
+        check_syntax_error(self, """\
 def f(x):
     def g():
         return x
     del x # can't del name
 """)
 
-check_syntax("""\
+        check_syntax_error(self, """\
 def f():
     def g():
-         from string import *
-         return strip # global or local?
+        from string import *
+        return strip # global or local?
 """)
 
-# and verify a few cases that should work
+        # and verify a few cases that should work
 
-exec """
+        exec("""
 def noproblem1():
     from string import *
     f = lambda x:x
@@ -245,61 +240,62 @@
     def f(x):
         global y
         y = x
-"""
-
-print "12. lambdas"
-
-f1 = lambda x: lambda y: x + y
-inc = f1(1)
-plus10 = f1(10)
-vereq(inc(1), 2)
-vereq(plus10(5), 15)
-
-f2 = lambda x: (lambda : lambda y: x + y)()
-inc = f2(1)
-plus10 = f2(10)
-vereq(inc(1), 2)
-vereq(plus10(5), 15)
-
-f3 = lambda x: lambda y: global_x + y
-global_x = 1
-inc = f3(None)
-vereq(inc(2), 3)
+""")
 
-f8 = lambda x, y, z: lambda a, b, c: lambda : z * (b + y)
-g = f8(1, 2, 3)
-h = g(2, 4, 6)
-vereq(h(), 18)
-
-print "13. UnboundLocal"
-
-def errorInOuter():
-    print y
-    def inner():
-        return y
-    y = 1
-
-def errorInInner():
-    def inner():
-        return y
-    inner()
-    y = 1
+    def testLambdas(self):
 
-try:
-    errorInOuter()
-except UnboundLocalError:
-    pass
-else:
-    raise TestFailed
+        f1 = lambda x: lambda y: x + y
+        inc = f1(1)
+        plus10 = f1(10)
+        self.assertEqual(inc(1), 2)
+        self.assertEqual(plus10(5), 15)
+
+        f2 = lambda x: (lambda : lambda y: x + y)()
+        inc = f2(1)
+        plus10 = f2(10)
+        self.assertEqual(inc(1), 2)
+        self.assertEqual(plus10(5), 15)
+
+        f3 = lambda x: lambda y: global_x + y
+        global_x = 1
+        inc = f3(None)
+        self.assertEqual(inc(2), 3)
+
+        f8 = lambda x, y, z: lambda a, b, c: lambda : z * (b + y)
+        g = f8(1, 2, 3)
+        h = g(2, 4, 6)
+        self.assertEqual(h(), 18)
+
+    def testUnboundLocal(self):
+
+        def errorInOuter():
+            print y
+            def inner():
+                return y
+            y = 1
+
+        def errorInInner():
+            def inner():
+                return y
+            inner()
+            y = 1
+
+        try:
+            errorInOuter()
+        except UnboundLocalError:
+            pass
+        else:
+            self.fail()
 
-try:
-    errorInInner()
-except NameError:
-    pass
-else:
-    raise TestFailed
+        try:
+            errorInInner()
+        except NameError:
+            pass
+        else:
+            self.fail()
 
-# test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation
+        # test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation
+        exec("""
 global_x = 1
 def f():
     global_x += 1
@@ -308,34 +304,36 @@
 except UnboundLocalError:
     pass
 else:
-    raise TestFailed, 'scope of global_x not correctly determined'
+    fail('scope of global_x not correctly determined')
+""", {'fail': self.fail})
 
-print "14. complex definitions"
+    def testComplexDefinitions(self):
 
-def makeReturner(*lst):
-    def returner():
-        return lst
-    return returner
+        def makeReturner(*lst):
+            def returner():
+                return lst
+            return returner
 
-vereq(makeReturner(1,2,3)(), (1,2,3))
+        self.assertEqual(makeReturner(1,2,3)(), (1,2,3))
 
-def makeReturner2(**kwargs):
-    def returner():
-        return kwargs
-    return returner
+        def makeReturner2(**kwargs):
+            def returner():
+                return kwargs
+            return returner
 
-vereq(makeReturner2(a=11)()['a'], 11)
+        self.assertEqual(makeReturner2(a=11)()['a'], 11)
 
-def makeAddPair((a, b)):
-    def addPair((c, d)):
-        return (a + c, b + d)
-    return addPair
+        def makeAddPair((a, b)):
+            def addPair((c, d)):
+                return (a + c, b + d)
+            return addPair
 
-vereq(makeAddPair((1, 2))((100, 200)), (101,202))
+        self.assertEqual(makeAddPair((1, 2))((100, 200)), (101,202))
 
-print "15. scope of global statements"
+    def testScopeOfGlobalStmt(self):
 # Examples posted by Samuele Pedroni to python-dev on 3/1/2001
 
+        exec("""\
 # I
 x = 7
 def f():
@@ -348,8 +346,8 @@
             return h()
         return i()
     return g()
-vereq(f(), 7)
-vereq(x, 7)
+self.assertEqual(f(), 7)
+self.assertEqual(x, 7)
 
 # II
 x = 7
@@ -363,8 +361,8 @@
             return h()
         return i()
     return g()
-vereq(f(), 2)
-vereq(x, 7)
+self.assertEqual(f(), 2)
+self.assertEqual(x, 7)
 
 # III
 x = 7
@@ -379,8 +377,8 @@
             return h()
         return i()
     return g()
-vereq(f(), 2)
-vereq(x, 2)
+self.assertEqual(f(), 2)
+self.assertEqual(x, 2)
 
 # IV
 x = 7
@@ -395,8 +393,8 @@
             return h()
         return i()
     return g()
-vereq(f(), 2)
-vereq(x, 2)
+self.assertEqual(f(), 2)
+self.assertEqual(x, 2)
 
 # XXX what about global statements in class blocks?
 # do they affect methods?
@@ -411,34 +409,36 @@
         return x
 
 g = Global()
-vereq(g.get(), 13)
+self.assertEqual(g.get(), 13)
 g.set(15)
-vereq(g.get(), 13)
+self.assertEqual(g.get(), 13)
+""")
 
-print "16. check leaks"
+    def testLeaks(self):
 
-class Foo:
-    count = 0
+        class Foo:
+            count = 0
 
-    def __init__(self):
-        Foo.count += 1
+            def __init__(self):
+                Foo.count += 1
 
-    def __del__(self):
-        Foo.count -= 1
+            def __del__(self):
+                Foo.count -= 1
 
-def f1():
-    x = Foo()
-    def f2():
-        return x
-    f2()
+        def f1():
+            x = Foo()
+            def f2():
+                return x
+            f2()
 
-for i in range(100):
-    f1()
+        for i in range(100):
+            f1()
 
-vereq(Foo.count, 0)
+        self.assertEqual(Foo.count, 0)
 
-print "17. class and global"
+    def testClassAndGlobal(self):
 
+        exec("""\
 def test(x):
     class Foo:
         global x
@@ -447,9 +447,9 @@
     return Foo()
 
 x = 0
-vereq(test(6)(2), 8)
+self.assertEqual(test(6)(2), 8)
 x = -1
-vereq(test(3)(2), 5)
+self.assertEqual(test(3)(2), 5)
 
 looked_up_by_load_name = False
 class X:
@@ -458,104 +458,106 @@
     locals()['looked_up_by_load_name'] = True
     passed = looked_up_by_load_name
 
-verify(X.passed)
-
-print "18. verify that locals() works"
-
-def f(x):
-    def g(y):
-        def h(z):
-            return y + z
-        w = x + y
-        y += 3
-        return locals()
-    return g
-
-d = f(2)(4)
-verify('h' in d)
-del d['h']
-vereq(d, {'x': 2, 'y': 7, 'w': 6})
-
-print "19. var is bound and free in class"
-
-def f(x):
-    class C:
-        def m(self):
-            return x
-        a = x
-    return C
-
-inst = f(3)()
-vereq(inst.a, inst.m())
-
-print "20. interaction with trace function"
-
-import sys
-def tracer(a,b,c):
-    return tracer
-
-def adaptgetter(name, klass, getter):
-    kind, des = getter
-    if kind == 1:       # AV happens when stepping from this line to next
-        if des == "":
-            des = "_%s__%s" % (klass.__name__, name)
-        return lambda obj: getattr(obj, des)
-
-class TestClass:
-    pass
+self.assert_(X.passed)
+""")
 
-sys.settrace(tracer)
-adaptgetter("foo", TestClass, (1, ""))
-sys.settrace(None)
-
-try: sys.settrace()
-except TypeError: pass
-else: raise TestFailed, 'sys.settrace() did not raise TypeError'
+    def testLocalsFunction(self):
 
-print "20. eval and exec with free variables"
+        def f(x):
+            def g(y):
+                def h(z):
+                    return y + z
+                w = x + y
+                y += 3
+                return locals()
+            return g
+
+        d = f(2)(4)
+        self.assert_('h' in d)
+        del d['h']
+        self.assertEqual(d, {'x': 2, 'y': 7, 'w': 6})
+
+    def testBoundAndFree(self):
+        # var is bound and free in class
+
+        def f(x):
+            class C:
+                def m(self):
+                    return x
+                a = x
+            return C
+
+        inst = f(3)()
+        self.assertEqual(inst.a, inst.m())
+
+    def testInteractionWithTraceFunc(self):
+
+        import sys
+        def tracer(a,b,c):
+            return tracer
+
+        def adaptgetter(name, klass, getter):
+            kind, des = getter
+            if kind == 1:       # AV happens when stepping from this line to next
+                if des == "":
+                    des = "_%s__%s" % (klass.__name__, name)
+                return lambda obj: getattr(obj, des)
+
+        class TestClass:
+            pass
+
+        sys.settrace(tracer)
+        adaptgetter("foo", TestClass, (1, ""))
+        sys.settrace(None)
+
+        self.assertRaises(TypeError, sys.settrace)
+
+    def testEvalExecFreeVars(self):
+
+        def f(x):
+            return lambda: x + 1
+
+        g = f(3)
+        self.assertRaises(TypeError, eval, g.func_code)
+
+        try:
+            exec(g.func_code, {})
+        except TypeError:
+            pass
+        else:
+            self.fail("exec should have failed, because code contained free vars")
 
-def f(x):
-    return lambda: x + 1
+    def testListCompLocalVars(self):
 
-g = f(3)
-try:
-    eval(g.func_code)
-except TypeError:
-    pass
-else:
-    print "eval() should have failed, because code contained free vars"
+        try:
+            print bad
+        except NameError:
+            pass
+        else:
+            print "bad should not be defined"
 
-try:
-    exec g.func_code
-except TypeError:
-    pass
-else:
-    print "exec should have failed, because code contained free vars"
+        def x():
+            [bad for s in 'a b' for bad in s.split()]
 
-print "21. list comprehension with local variables"
+        x()
+        try:
+            print bad
+        except NameError:
+            pass
 
-try:
-    print bad
-except NameError:
-    pass
-else:
-    print "bad should not be defined"
+    def testEvalFreeVars(self):
 
-def x():
-    [bad for s in 'a b' for bad in s.split()]
+        def f(x):
+            def g():
+                x
+                eval("x + 1")
+            return g
 
-x()
-try:
-    print bad
-except NameError:
-    pass
+        f(4)()
 
-print "22. eval with free variables"
 
-def f(x):
-    def g():
-        x
-        eval("x + 1")
-    return g
+def test_main():
+    run_unittest(ScopeTests)
 
-f(4)()
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_set.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_set.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_set.py	Fri Dec 15 05:21:50 2006
@@ -18,7 +18,7 @@
 class BadCmp:
     def __hash__(self):
         return 1
-    def __cmp__(self, other):
+    def __eq__(self, other):
         raise RuntimeError
 
 class TestJointOps(unittest.TestCase):
@@ -261,6 +261,11 @@
         t = self.thetype(s)
         self.assertNotEqual(id(s), id(t))
 
+    def test_set_literal(self):
+        s = set([1,2,3])
+        t = {1,2,3}
+        self.assertEqual(s, t)
+
     def test_hash(self):
         self.assertRaises(TypeError, hash, self.s)
 
@@ -293,6 +298,17 @@
         self.assert_(self.thetype(self.word) not in s)
         self.assertRaises(KeyError, self.s.remove, self.thetype(self.word))
 
+    def test_remove_keyerror_unpacking(self):
+        # bug:  www.python.org/sf/1576657
+        for v1 in ['Q', (1,)]:
+            try:
+                self.s.remove(v1)
+            except KeyError, e:
+                v2 = e.args[0]
+                self.assertEqual(v1, v2)
+            else:
+                self.fail()
+
     def test_discard(self):
         self.s.discard('a')
         self.assert_('a' not in self.s)
@@ -626,7 +642,7 @@
         self.set    = set(self.values)
         self.dup    = set(self.values)
         self.length = 0
-        self.repr   = "set([])"
+        self.repr   = "set()"
 
 #------------------------------------------------------------------------------
 
@@ -637,7 +653,7 @@
         self.set    = set(self.values)
         self.dup    = set(self.values)
         self.length = 1
-        self.repr   = "set([3])"
+        self.repr   = "{3}"
 
     def test_in(self):
         self.failUnless(3 in self.set)
@@ -654,7 +670,7 @@
         self.set    = set(self.values)
         self.dup    = set(self.values)
         self.length = 1
-        self.repr   = "set([(0, 'zero')])"
+        self.repr   = "{(0, 'zero')}"
 
     def test_in(self):
         self.failUnless((0, "zero") in self.set)
@@ -781,11 +797,8 @@
         a, b = set('a'), set('b')
         self.assertRaises(TypeError, cmp, a, b)
 
-        # You can view this as a buglet:  cmp(a, a) does not raise TypeError,
-        # because __eq__ is tried before __cmp__, and a.__eq__(a) returns True,
-        # which Python thinks is good enough to synthesize a cmp() result
-        # without calling __cmp__.
-        self.assertEqual(cmp(a, a), 0)
+        # In py3k, this works!
+        self.assertRaises(TypeError, cmp, a, a)
 
         self.assertRaises(TypeError, cmp, a, 12)
         self.assertRaises(TypeError, cmp, "abc", a)
@@ -1201,8 +1214,8 @@
 
     def test_copy(self):
         dup = self.set.copy()
-        dup_list = list(dup); dup_list.sort()
-        set_list = list(self.set); set_list.sort()
+        dup_list = sorted(dup, key=repr)
+        set_list = sorted(self.set, key=repr)
         self.assertEqual(len(dup_list), len(set_list))
         for i in range(len(dup_list)):
             self.failUnless(dup_list[i] is set_list[i])
@@ -1210,8 +1223,8 @@
     def test_deep_copy(self):
         dup = copy.deepcopy(self.set)
         ##print type(dup), repr(dup)
-        dup_list = list(dup); dup_list.sort()
-        set_list = list(self.set); set_list.sort()
+        dup_list = sorted(dup, key=repr)
+        set_list = sorted(self.set, key=repr)
         self.assertEqual(len(dup_list), len(set_list))
         for i in range(len(dup_list)):
             self.assertEqual(dup_list[i], set_list[i])
@@ -1374,7 +1387,7 @@
         for cons in (set, frozenset):
             for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
                 for g in (G, I, Ig, S, L, R):
-                    self.assertEqual(sorted(cons(g(s))), sorted(g(s)))
+                    self.assertEqual(sorted(cons(g(s)), key=repr), sorted(g(s), key=repr))
                 self.assertRaises(TypeError, cons , X(s))
                 self.assertRaises(TypeError, cons , N(s))
                 self.assertRaises(ZeroDivisionError, cons , E(s))
@@ -1386,7 +1399,7 @@
                 for g in (G, I, Ig, L, R):
                     expected = meth(data)
                     actual = meth(G(data))
-                    self.assertEqual(sorted(actual), sorted(expected))
+                    self.assertEqual(sorted(actual, key=repr), sorted(expected, key=repr))
                 self.assertRaises(TypeError, meth, X(s))
                 self.assertRaises(TypeError, meth, N(s))
                 self.assertRaises(ZeroDivisionError, meth, E(s))
@@ -1400,7 +1413,7 @@
                     t = s.copy()
                     getattr(s, methname)(list(g(data)))
                     getattr(t, methname)(g(data))
-                    self.assertEqual(sorted(s), sorted(t))
+                    self.assertEqual(sorted(s, key=repr), sorted(t, key=repr))
 
                 self.assertRaises(TypeError, getattr(set('january'), methname), X(data))
                 self.assertRaises(TypeError, getattr(set('january'), methname), N(data))

Modified: python/branches/p3yk-noslice/Lib/test/test_sets.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_sets.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_sets.py	Fri Dec 15 05:21:50 2006
@@ -234,11 +234,8 @@
         a, b = Set('a'), Set('b')
         self.assertRaises(TypeError, cmp, a, b)
 
-        # You can view this as a buglet:  cmp(a, a) does not raise TypeError,
-        # because __eq__ is tried before __cmp__, and a.__eq__(a) returns True,
-        # which Python thinks is good enough to synthesize a cmp() result
-        # without calling __cmp__.
-        self.assertEqual(cmp(a, a), 0)
+        # In py3k, this works!
+        self.assertRaises(TypeError, cmp, a, a)
 
         self.assertRaises(TypeError, cmp, a, 12)
         self.assertRaises(TypeError, cmp, "abc", a)
@@ -675,8 +672,8 @@
 
     def test_copy(self):
         dup = self.set.copy()
-        dup_list = list(dup); dup_list.sort()
-        set_list = list(self.set); set_list.sort()
+        dup_list = sorted(dup, key=repr)
+        set_list = sorted(self.set, key=repr)
         self.assertEqual(len(dup_list), len(set_list))
         for i in range(len(dup_list)):
             self.failUnless(dup_list[i] is set_list[i])
@@ -684,8 +681,8 @@
     def test_deep_copy(self):
         dup = copy.deepcopy(self.set)
         ##print type(dup), repr(dup)
-        dup_list = list(dup); dup_list.sort()
-        set_list = list(self.set); set_list.sort()
+        dup_list = sorted(dup, key=repr)
+        set_list = sorted(self.set, key=repr)
         self.assertEqual(len(dup_list), len(set_list))
         for i in range(len(dup_list)):
             self.assertEqual(dup_list[i], set_list[i])

Modified: python/branches/p3yk-noslice/Lib/test/test_sgmllib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_sgmllib.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_sgmllib.py	Fri Dec 15 05:21:50 2006
@@ -286,21 +286,6 @@
             ('codepoint', 'convert', 42),
             ])
 
-    def test_attr_values_quoted_markup(self):
-        """Multi-line and markup in attribute values"""
-        self.check_events("""<a title='foo\n<br>bar'>text</a>""",
-            [("starttag", "a", [("title", "foo\n<br>bar")]),
-             ("data", "text"),
-             ("endtag", "a")])
-        self.check_events("""<a title='less < than'>text</a>""",
-            [("starttag", "a", [("title", "less < than")]),
-             ("data", "text"),
-             ("endtag", "a")])
-        self.check_events("""<a title='greater > than'>text</a>""",
-            [("starttag", "a", [("title", "greater > than")]),
-             ("data", "text"),
-             ("endtag", "a")])
-
     def test_attr_funky_names(self):
         self.check_events("""<a a.b='v' c:d=v e-f=v>""", [
             ("starttag", "a", [("a.b", "v"), ("c:d", "v"), ("e-f", "v")]),
@@ -376,6 +361,19 @@
             ('decl', 'DOCTYPE doc [<!ATTLIST doc attr (a | b) >]'),
             ])
 
+    def test_read_chunks(self):
+        # SF bug #1541697, this caused sgml parser to hang
+        # Just verify this code doesn't cause a hang.
+        CHUNK = 1024  # increasing this to 8212 makes the problem go away
+
+        f = open(test_support.findfile('sgml_input.html'))
+        fp = sgmllib.SGMLParser()
+        while 1:
+            data = f.read(CHUNK)
+            fp.feed(data)
+            if len(data) != CHUNK:
+                break
+
     # XXX These tests have been disabled by prefixing their names with
     # an underscore.  The first two exercise outstanding bugs in the
     # sgmllib module, and the third exhibits questionable behavior

Modified: python/branches/p3yk-noslice/Lib/test/test_sha.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_sha.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_sha.py	Fri Dec 15 05:21:50 2006
@@ -11,9 +11,23 @@
 
 class SHATestCase(unittest.TestCase):
     def check(self, data, digest):
-        computed = sha.new(data).hexdigest()
+        # Check digest matches the expected value
+        obj = sha.new(data)
+        computed = obj.hexdigest()
         self.assert_(computed == digest)
 
+        # Verify that the value doesn't change between two consecutive
+        # digest operations.
+        computed_again = obj.hexdigest()
+        self.assert_(computed == computed_again)
+
+        # Check hexdigest() output matches digest()'s output
+        digest = obj.digest()
+        hexd = ""
+        for c in digest:
+            hexd += '%02x' % ord(c)
+        self.assert_(computed == hexd)
+
     def test_case_1(self):
         self.check("abc",
                    "a9993e364706816aba3e25717850c26c9cd0d89d")
@@ -26,6 +40,9 @@
         self.check("a" * 1000000,
                    "34aa973cd4c4daa4f61eeb2bdbad27316534016f")
 
+    def test_case_4(self):
+        self.check(chr(0xAA) * 80,
+                   '4ca0ef38f1794b28a8f8ee110ee79d48ce13be25')
 
 def test_main():
     test_support.run_unittest(SHATestCase)

Modified: python/branches/p3yk-noslice/Lib/test/test_site.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_site.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_site.py	Fri Dec 15 05:21:50 2006
@@ -164,7 +164,7 @@
         site.abs__file__()
         for module in (sys, os, __builtin__):
             try:
-                self.failUnless(os.path.isabs(module.__file__), `module`)
+                self.failUnless(os.path.isabs(module.__file__), repr(module))
             except AttributeError:
                 continue
         # We could try everything in sys.modules; however, when regrtest.py

Modified: python/branches/p3yk-noslice/Lib/test/test_slice.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_slice.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_slice.py	Fri Dec 15 05:21:50 2006
@@ -35,18 +35,18 @@
 
         s1 = slice(BadCmp())
         s2 = slice(BadCmp())
-        self.assertRaises(Exc, cmp, s1, s2)
         self.assertEqual(s1, s1)
+        self.assertRaises(Exc, lambda: s1 == s2)
 
         s1 = slice(1, BadCmp())
         s2 = slice(1, BadCmp())
         self.assertEqual(s1, s1)
-        self.assertRaises(Exc, cmp, s1, s2)
+        self.assertRaises(Exc, lambda: s1 == s2)
 
         s1 = slice(1, 2, BadCmp())
         s2 = slice(1, 2, BadCmp())
         self.assertEqual(s1, s1)
-        self.assertRaises(Exc, cmp, s1, s2)
+        self.assertRaises(Exc, lambda: s1 == s2)
 
     def test_members(self):
         s = slice(1)

Modified: python/branches/p3yk-noslice/Lib/test/test_socket.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_socket.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_socket.py	Fri Dec 15 05:21:50 2006
@@ -285,7 +285,7 @@
                 orig = sys.getrefcount(__name__)
                 socket.getnameinfo(__name__,0)
             except SystemError:
-                if sys.getrefcount(__name__) <> orig:
+                if sys.getrefcount(__name__) != orig:
                     self.fail("socket.getnameinfo loses a reference")
 
     def testInterpreterCrash(self):

Modified: python/branches/p3yk-noslice/Lib/test/test_sort.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_sort.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_sort.py	Fri Dec 15 05:21:50 2006
@@ -68,8 +68,8 @@
                 self.key = key
                 self.index = i
 
-            def __cmp__(self, other):
-                return cmp(self.key, other.key)
+            def __lt__(self, other):
+                return self.key < other.key
 
             def __repr__(self):
                 return "Stable(%d, %d)" % (self.key, self.index)
@@ -225,6 +225,8 @@
             def __del__(self):
                 del data[:]
                 data[:] = range(20)
+            def __lt__(self, other):
+                return id(self) < id(other)
         self.assertRaises(ValueError, data.sort, key=SortKiller)
 
     def test_key_with_mutating_del_and_exception(self):

Modified: python/branches/p3yk-noslice/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_subprocess.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_subprocess.py	Fri Dec 15 05:21:50 2006
@@ -234,6 +234,12 @@
         stripped = remove_stderr_debug_decorations(output)
         self.assertEqual(stripped, "appleorange")
 
+    def test_stdout_filedes_of_stdout(self):
+        # stdout is set to 1 (#1531862).
+        cmd = r"import sys, os; sys.exit(os.write(sys.stdout.fileno(), '.\n'))"
+        rc = subprocess.call([sys.executable, "-c", cmd], stdout=1)
+        self.assertEquals(rc, 2)
+
     def test_cwd(self):
         tmpdir = os.getenv("TEMP", "/tmp")
         # We cannot use os.path.realpath to canonicalize the path,

Modified: python/branches/p3yk-noslice/Lib/test/test_support.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_support.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_support.py	Fri Dec 15 05:21:50 2006
@@ -122,8 +122,8 @@
             outcome = fcmp(x[i], y[i])
             if outcome != 0:
                 return outcome
-        return cmp(len(x), len(y))
-    return cmp(x, y)
+        return (len(x) > len(y)) - (len(x) < len(y))
+    return (x > y) - (x < y)
 
 try:
     unicode
@@ -244,13 +244,13 @@
     withcommas = ", ".join(reprpairs)
     return "{%s}" % withcommas
 
-def check_syntax(statement):
+def check_syntax_error(testcase, statement):
     try:
-        compile(statement, '<string>', 'exec')
+        compile(statement, '<test string>', 'exec')
     except SyntaxError:
         pass
     else:
-        print 'Missing SyntaxError: "%s"' % statement
+        testcase.fail('Missing SyntaxError: "%s"' % statement)
 
 def open_urlresource(url):
     import urllib, urlparse

Modified: python/branches/p3yk-noslice/Lib/test/test_syntax.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_syntax.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_syntax.py	Fri Dec 15 05:21:50 2006
@@ -71,7 +71,7 @@
 
 >>> `1` = 1
 Traceback (most recent call last):
-SyntaxError: can't assign to repr (<doctest test.test_syntax[10]>, line 1)
+SyntaxError: invalid syntax
 
 If the left-hand side of an assignment is a list or tuple, an illegal
 expression inside that contain should still cause a syntax error.
@@ -235,6 +235,138 @@
 >>> f() += 1
 Traceback (most recent call last):
 SyntaxError: illegal expression for augmented assignment (<doctest test.test_syntax[33]>, line 1)
+
+
+Test continue in finally in weird combinations.
+
+continue in for loop under finally shouuld be ok.
+
+    >>> def test():
+    ...     try:
+    ...         pass
+    ...     finally:
+    ...         for abc in range(10):
+    ...             continue
+    ...     print abc
+    >>> test()
+    9
+
+Start simple, a continue in a finally should not be allowed.
+
+    >>> def test():
+    ...    for abc in range(10):
+    ...        try:
+    ...            pass
+    ...        finally:
+    ...            continue
+    Traceback (most recent call last):
+      ...
+    SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[36]>, line 6)
+
+This is essentially a continue in a finally which should not be allowed.
+
+    >>> def test():
+    ...    for abc in range(10):
+    ...        try:
+    ...            pass
+    ...        finally:
+    ...            try:
+    ...                continue
+    ...            except:
+    ...                pass
+    Traceback (most recent call last):
+      ...
+    SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[37]>, line 7)
+
+    >>> def foo():
+    ...     try:
+    ...         pass
+    ...     finally:
+    ...         continue
+    Traceback (most recent call last):
+      ...
+    SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[38]>, line 5)
+
+    >>> def foo():
+    ...     for a in ():
+    ...       try:
+    ...           pass
+    ...       finally:
+    ...           continue
+    Traceback (most recent call last):
+      ...
+    SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[39]>, line 6)
+
+    >>> def foo():
+    ...     for a in ():
+    ...         try:
+    ...             pass
+    ...         finally:
+    ...             try:
+    ...                 continue
+    ...             finally:
+    ...                 pass
+    Traceback (most recent call last):
+      ...
+    SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[40]>, line 7)
+
+    >>> def foo():
+    ...  for a in ():
+    ...   try: pass
+    ...   finally:
+    ...    try:
+    ...     pass
+    ...    except:
+    ...     continue
+    Traceback (most recent call last):
+      ...
+    SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[41]>, line 8)
+
+There is one test for a break that is not in a loop.  The compiler
+uses a single data structure to keep track of try-finally and loops,
+so we need to be sure that a break is actually inside a loop.  If it
+isn't, there should be a syntax error.
+
+   >>> try:
+   ...     print 1
+   ...     break
+   ...     print 2
+   ... finally:
+   ...     print 3
+   Traceback (most recent call last):
+     ...
+   SyntaxError: 'break' outside loop (<doctest test.test_syntax[42]>, line 3)
+
+This should probably raise a better error than a SystemError (or none at all).
+In 2.5 there was a missing exception and an assert was triggered in a debug
+build.  The number of blocks must be greater than CO_MAXBLOCKS.  SF #1565514
+
+   >>> while 1:
+   ...  while 2:
+   ...   while 3:
+   ...    while 4:
+   ...     while 5:
+   ...      while 6:
+   ...       while 8:
+   ...        while 9:
+   ...         while 10:
+   ...          while 11:
+   ...           while 12:
+   ...            while 13:
+   ...             while 14:
+   ...              while 15:
+   ...               while 16:
+   ...                while 17:
+   ...                 while 18:
+   ...                  while 19:
+   ...                   while 20:
+   ...                    while 21:
+   ...                     while 22:
+   ...                      break
+   Traceback (most recent call last):
+     ...
+   SystemError: too many statically nested blocks
+
 """
 
 import re

Modified: python/branches/p3yk-noslice/Lib/test/test_tarfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_tarfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_tarfile.py	Fri Dec 15 05:21:50 2006
@@ -280,6 +280,32 @@
             else:
                 self.dst.addfile(tarinfo, f)
 
+
+class Write100Test(BaseTest):
+    # The name field in a tar header stores strings of at most 100 chars.
+    # If a string is shorter than 100 chars it has to be padded with '\0',
+    # which implies that a string of exactly 100 chars is stored without
+    # a trailing '\0'.
+
+    def setUp(self):
+        self.name = "01234567890123456789012345678901234567890123456789"
+        self.name += "01234567890123456789012345678901234567890123456789"
+
+        self.tar = tarfile.open(tmpname(), "w")
+        t = tarfile.TarInfo(self.name)
+        self.tar.addfile(t)
+        self.tar.close()
+
+        self.tar = tarfile.open(tmpname())
+
+    def tearDown(self):
+        self.tar.close()
+
+    def test(self):
+        self.assertEqual(self.tar.getnames()[0], self.name,
+                "failed to store 100 char filename")
+
+
 class WriteSize0Test(BaseTest):
     mode = 'w'
 
@@ -333,11 +359,11 @@
             f.close()
         elif self.comp == "bz2":
             f = bz2.BZ2Decompressor()
-            s = file(self.dstname).read()
+            s = open(self.dstname).read()
             s = f.decompress(s)
             self.assertEqual(len(f.unused_data), 0, "trailing data")
         else:
-            f = file(self.dstname)
+            f = open(self.dstname)
             s = f.read()
             f.close()
 
@@ -362,13 +388,6 @@
        is tested as well.
     """
 
-    def setUp(self):
-        self.tar = tarfile.open(tmpname(), "w")
-        self.tar.posix = False
-
-    def tearDown(self):
-        self.tar.close()
-
     def _length(self, s):
         blocks, remainder = divmod(len(s) + 1, 512)
         if remainder:
@@ -397,12 +416,23 @@
             tarinfo.linkname = link
             tarinfo.type = tarfile.LNKTYPE
 
-        self.tar.addfile(tarinfo)
+        tar = tarfile.open(tmpname(), "w")
+        tar.posix = False
+        tar.addfile(tarinfo)
 
         v1 = self._calc_size(name, link)
-        v2 = self.tar.offset
+        v2 = tar.offset
         self.assertEqual(v1, v2, "GNU longname/longlink creation failed")
 
+        tar.close()
+
+        tar = tarfile.open(tmpname())
+        member = tar.next()
+        self.failIf(member is None, "unable to read longname member")
+        self.assert_(tarinfo.name == member.name and \
+                     tarinfo.linkname == member.linkname, \
+                     "unable to read longname member")
+
     def test_longname_1023(self):
         self._test(("longnam/" * 127) + "longnam")
 
@@ -623,6 +653,7 @@
         ReadAsteriskTest,
         ReadStreamAsteriskTest,
         WriteTest,
+        Write100Test,
         WriteSize0Test,
         WriteStreamTest,
         WriteGNULongTest,

Modified: python/branches/p3yk-noslice/Lib/test/test_tempfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_tempfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_tempfile.py	Fri Dec 15 05:21:50 2006
@@ -27,7 +27,7 @@
 # number of files that can be opened at one time (see ulimit -n)
 if sys.platform == 'mac':
     TEST_FILES = 32
-elif sys.platform == 'openbsd3':
+elif sys.platform in ('openbsd3', 'openbsd4'):
     TEST_FILES = 48
 else:
     TEST_FILES = 100

Modified: python/branches/p3yk-noslice/Lib/test/test_time.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_time.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_time.py	Fri Dec 15 05:21:50 2006
@@ -102,15 +102,19 @@
         self.assertEquals(expected, result)
 
     def test_strptime(self):
+        # Should be able to go round-trip from strftime to strptime without
+        # throwing an exception.
         tt = time.gmtime(self.t)
         for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
                           'j', 'm', 'M', 'p', 'S',
                           'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):
-            format = ' %' + directive
+            format = '%' + directive
+            strf_output = time.strftime(format, tt)
             try:
-                time.strptime(time.strftime(format, tt), format)
+                time.strptime(strf_output, format)
             except ValueError:
-                self.fail('conversion specifier: %r failed.' % format)
+                self.fail("conversion specifier %r failed with '%s' input." %
+                          (format, strf_output))
 
     def test_asctime(self):
         time.asctime(time.gmtime(self.t))

Modified: python/branches/p3yk-noslice/Lib/test/test_tokenize.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_tokenize.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_tokenize.py	Fri Dec 15 05:21:50 2006
@@ -1,9 +1,93 @@
-import os, glob, random
+"""Tests for the tokenize module.
+
+The tests were originally written in the old Python style, where the
+test output was compared to a golden file.  This docstring represents
+the first steps towards rewriting the entire test as a doctest.
+
+The tests can be really simple.  Given a small fragment of source
+code, print out a table with the tokens.  The ENDMARK is omitted for
+brevity.
+
+>>> dump_tokens("1 + 1")
+NUMBER      '1'           (1, 0) (1, 1)
+OP          '+'           (1, 2) (1, 3)
+NUMBER      '1'           (1, 4) (1, 5)
+
+A comment generates a token here, unlike in the parser module.  The
+comment token is followed by an NL or a NEWLINE token, depending on
+whether the line contains the completion of a statement.
+
+>>> dump_tokens("if False:\\n"
+...             "    # NL\\n"
+...             "    True = False # NEWLINE\\n")
+NAME        'if'          (1, 0) (1, 2)
+NAME        'False'       (1, 3) (1, 8)
+OP          ':'           (1, 8) (1, 9)
+NEWLINE     '\\n'          (1, 9) (1, 10)
+COMMENT     '# NL'        (2, 4) (2, 8)
+NL          '\\n'          (2, 8) (2, 9)
+INDENT      '    '        (3, 0) (3, 4)
+NAME        'True'        (3, 4) (3, 8)
+OP          '='           (3, 9) (3, 10)
+NAME        'False'       (3, 11) (3, 16)
+COMMENT     '# NEWLINE'   (3, 17) (3, 26)
+NEWLINE     '\\n'          (3, 26) (3, 27)
+DEDENT      ''            (4, 0) (4, 0)
+
+
+There will be a bunch more tests of specific source patterns.
+
+The tokenize module also defines an untokenize function that should
+regenerate the original program text from the tokens.
+
+There are some standard formatting practices that are easy to get right.
+
+>>> roundtrip("if x == 1:\\n"
+...           "    print x\\n")
+if x == 1:
+    print x
+
+Some people use different formatting conventions, which makes
+untokenize a little trickier.  Note that this test involves trailing
+whitespace after the colon.  Note that we use hex escapes to make the
+two trailing blanks apparent in the expected output.
+
+>>> roundtrip("if   x  ==  1  :  \\n"
+...           "  print x\\n")
+if   x  ==  1  :\x20\x20
+  print x
+
+Comments need to go in the right place.
+
+>>> roundtrip("if x == 1:\\n"
+...           "    # A comment by itself.\\n"
+...           "    print x  # Comment here, too.\\n"
+...           "    # Another comment.\\n"
+...           "after_if = True\\n")
+if x == 1:
+    # A comment by itself.
+    print x  # Comment here, too.
+    # Another comment.
+after_if = True
+
+>>> roundtrip("if (x  # The comments need to go in the right place\\n"
+...           "    == 1):\\n"
+...           "    print 'x == 1'\\n")
+if (x  # The comments need to go in the right place
+    == 1):
+    print 'x == 1'
+
+"""
+
+import os, glob, random, time, sys
 from cStringIO import StringIO
 from test.test_support import (verbose, findfile, is_resource_enabled,
                                TestFailed)
-from tokenize import (tokenize, generate_tokens, untokenize,
-                      NUMBER, NAME, OP, STRING)
+from tokenize import (tokenize, generate_tokens, untokenize, tok_name,
+                      ENDMARKER, NUMBER, NAME, OP, STRING, COMMENT)
+
+# How much time in seconds can pass before we print a 'Still working' message.
+_PRINT_WORKING_MSG_INTERVAL = 5 * 60
 
 # Test roundtrip for `untokenize`.  `f` is a file path.  The source code in f
 # is tokenized, converted back to source code via tokenize.untokenize(),
@@ -24,6 +108,23 @@
     if t1 != t2:
         raise TestFailed("untokenize() roundtrip failed for %r" % f)
 
+def dump_tokens(s):
+    """Print out the tokens in s in a table format.
+
+    The ENDMARKER is omitted.
+    """
+    f = StringIO(s)
+    for type, token, start, end, line in generate_tokens(f.readline):
+        if type == ENDMARKER:
+            break
+        type = tok_name[type]
+        print "%(type)-10.10s  %(token)-13.13r %(start)s %(end)s" % locals()
+
+def roundtrip(s):
+    f = StringIO(s)
+    source = untokenize(generate_tokens(f.readline))
+    print source,
+
 # This is an example from the docs, set up as a doctest.
 def decistmt(s):
     """Substitute Decimals for floats in a string of statements.
@@ -66,6 +167,8 @@
     if verbose:
         print 'starting...'
 
+    next_time = time.time() + _PRINT_WORKING_MSG_INTERVAL
+
     # This displays the tokenization of tokenize_tests.py to stdout, and
     # regrtest.py checks that this equals the expected output (in the
     # test/output/ directory).
@@ -85,6 +188,12 @@
         testfiles = random.sample(testfiles, 10)
 
     for f in testfiles:
+        # Print still working message since this test can be really slow
+        if next_time <= time.time():
+            next_time = time.time() + _PRINT_WORKING_MSG_INTERVAL
+            print >>sys.__stdout__, '  test_main still working, be patient...'
+            sys.__stdout__.flush()
+
         test_roundtrip(f)
 
     # Test detecton of IndentationError.
@@ -105,7 +214,7 @@
     # Run the doctests in this module.
     from test import test_tokenize  # i.e., this module
     from test.test_support import run_doctest
-    run_doctest(test_tokenize)
+    run_doctest(test_tokenize, verbose)
 
     if verbose:
         print 'finished'

Modified: python/branches/p3yk-noslice/Lib/test/test_traceback.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_traceback.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_traceback.py	Fri Dec 15 05:21:50 2006
@@ -118,7 +118,13 @@
         err = traceback.format_exception_only(X, X())
         self.assertEqual(len(err), 1)
         str_value = '<unprintable %s object>' % X.__name__
-        self.assertEqual(err[0], X.__name__ + ': ' + str_value + '\n')
+        self.assertEqual(err[0], "%s.%s: %s\n" % (X.__module__,
+                                                  X.__name__,
+                                                  str_value))
+
+    def test_without_exception(self):
+        err = traceback.format_exception_only(None, None)
+        self.assertEqual(err, ['None\n'])
 
 
 def test_main():

Modified: python/branches/p3yk-noslice/Lib/test/test_transformer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_transformer.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_transformer.py	Fri Dec 15 05:21:50 2006
@@ -24,7 +24,7 @@
             # is correct
             c = compile(s, '<string>', 'single')
             vals = {}
-            exec c in vals
+            exec(c, vals)
             assert vals['a'] == 1
             assert vals['b'] == 2
 

Modified: python/branches/p3yk-noslice/Lib/test/test_tuple.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_tuple.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_tuple.py	Fri Dec 15 05:21:50 2006
@@ -61,7 +61,7 @@
         base = range(N)
         xp = [(i, j) for i in base for j in base]
         inps = base + [(i, j) for i in base for j in xp] + \
-                     [(i, j) for i in xp for j in base] + xp + zip(base)
+                     [(i, j) for i in xp for j in base] + xp + list(zip(base))
         collisions = len(inps) - len(set(map(hash, inps)))
         self.assert_(collisions <= 15)
 

Modified: python/branches/p3yk-noslice/Lib/test/test_types.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_types.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_types.py	Fri Dec 15 05:21:50 2006
@@ -1,286 +1,271 @@
 # Python test set -- part 6, built-in types
 
-from test.test_support import *
+from test.test_support import run_unittest, have_unicode
+import unittest
+import sys
 
-print '6. Built-in types'
+class TypesTests(unittest.TestCase):
 
-print '6.1 Truth value testing'
-if None: raise TestFailed, 'None is true instead of false'
-if 0: raise TestFailed, '0 is true instead of false'
-if 0L: raise TestFailed, '0L is true instead of false'
-if 0.0: raise TestFailed, '0.0 is true instead of false'
-if '': raise TestFailed, '\'\' is true instead of false'
-if not 1: raise TestFailed, '1 is false instead of true'
-if not 1L: raise TestFailed, '1L is false instead of true'
-if not 1.0: raise TestFailed, '1.0 is false instead of true'
-if not 'x': raise TestFailed, '\'x\' is false instead of true'
-if not {'x': 1}: raise TestFailed, '{\'x\': 1} is false instead of true'
-def f(): pass
-class C: pass
-import sys
-x = C()
-if not f: raise TestFailed, 'f is false instead of true'
-if not C: raise TestFailed, 'C is false instead of true'
-if not sys: raise TestFailed, 'sys is false instead of true'
-if not x: raise TestFailed, 'x is false instead of true'
-
-print '6.2 Boolean operations'
-if 0 or 0: raise TestFailed, '0 or 0 is true instead of false'
-if 1 and 1: pass
-else: raise TestFailed, '1 and 1 is false instead of true'
-if not 1: raise TestFailed, 'not 1 is true instead of false'
-
-print '6.3 Comparisons'
-if 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass
-else: raise TestFailed, 'int comparisons failed'
-if 0L < 1L <= 1L == 1L >= 1L > 0L != 1L: pass
-else: raise TestFailed, 'long int comparisons failed'
-if 0.0 < 1.0 <= 1.0 == 1.0 >= 1.0 > 0.0 != 1.0: pass
-else: raise TestFailed, 'float comparisons failed'
-if '' < 'a' <= 'a' == 'a' < 'abc' < 'abd' < 'b': pass
-else: raise TestFailed, 'string comparisons failed'
-if None is None: pass
-else: raise TestFailed, 'identity test failed'
-
-try: float('')
-except ValueError: pass
-else: raise TestFailed, "float('') didn't raise ValueError"
-
-try: float('5\0')
-except ValueError: pass
-else: raise TestFailed, "float('5\0') didn't raise ValueError"
-
-try: 5.0 / 0.0
-except ZeroDivisionError: pass
-else: raise TestFailed, "5.0 / 0.0 didn't raise ZeroDivisionError"
-
-try: 5.0 // 0.0
-except ZeroDivisionError: pass
-else: raise TestFailed, "5.0 // 0.0 didn't raise ZeroDivisionError"
-
-try: 5.0 % 0.0
-except ZeroDivisionError: pass
-else: raise TestFailed, "5.0 % 0.0 didn't raise ZeroDivisionError"
-
-try: 5 / 0L
-except ZeroDivisionError: pass
-else: raise TestFailed, "5 / 0L didn't raise ZeroDivisionError"
-
-try: 5 // 0L
-except ZeroDivisionError: pass
-else: raise TestFailed, "5 // 0L didn't raise ZeroDivisionError"
-
-try: 5 % 0L
-except ZeroDivisionError: pass
-else: raise TestFailed, "5 % 0L didn't raise ZeroDivisionError"
-
-print '6.4 Numeric types (mostly conversions)'
-if 0 != 0L or 0 != 0.0 or 0L != 0.0: raise TestFailed, 'mixed comparisons'
-if 1 != 1L or 1 != 1.0 or 1L != 1.0: raise TestFailed, 'mixed comparisons'
-if -1 != -1L or -1 != -1.0 or -1L != -1.0:
-    raise TestFailed, 'int/long/float value not equal'
-# calling built-in types without argument must return 0
-if int() != 0: raise TestFailed, 'int() does not return 0'
-if long() != 0L: raise TestFailed, 'long() does not return 0L'
-if float() != 0.0: raise TestFailed, 'float() does not return 0.0'
-if int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass
-else: raise TestFailed, 'int() does not round properly'
-if long(1.9) == 1L == long(1.1) and long(-1.1) == -1L == long(-1.9): pass
-else: raise TestFailed, 'long() does not round properly'
-if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
-else: raise TestFailed, 'float() does not work properly'
-print '6.4.1 32-bit integers'
-# Ensure the first 256 integers are shared
-a = 256
-b = 128*2
-if a is not b: raise TestFailed, '256 is not shared'
-if 12 + 24 != 36: raise TestFailed, 'int op'
-if 12 + (-24) != -12: raise TestFailed, 'int op'
-if (-12) + 24 != 12: raise TestFailed, 'int op'
-if (-12) + (-24) != -36: raise TestFailed, 'int op'
-if not 12 < 24: raise TestFailed, 'int op'
-if not -24 < -12: raise TestFailed, 'int op'
-# Test for a particular bug in integer multiply
-xsize, ysize, zsize = 238, 356, 4
-if not (xsize*ysize*zsize == zsize*xsize*ysize == 338912):
-    raise TestFailed, 'int mul commutativity'
-# And another.
-m = -sys.maxint - 1
-for divisor in 1, 2, 4, 8, 16, 32:
-    j = m // divisor
-    prod = divisor * j
-    if prod != m:
-        raise TestFailed, "%r * %r == %r != %r" % (divisor, j, prod, m)
-    if type(prod) is not int:
-        raise TestFailed, ("expected type(prod) to be int, not %r" %
-                           type(prod))
-# Check for expected * overflow to long.
-for divisor in 1, 2, 4, 8, 16, 32:
-    j = m // divisor - 1
-    prod = divisor * j
-    if type(prod) is not long:
-        raise TestFailed, ("expected type(%r) to be long, not %r" %
-                           (prod, type(prod)))
-# Check for expected * overflow to long.
-m = sys.maxint
-for divisor in 1, 2, 4, 8, 16, 32:
-    j = m // divisor + 1
-    prod = divisor * j
-    if type(prod) is not long:
-        raise TestFailed, ("expected type(%r) to be long, not %r" %
-                           (prod, type(prod)))
-
-print '6.4.2 Long integers'
-if 12L + 24L != 36L: raise TestFailed, 'long op'
-if 12L + (-24L) != -12L: raise TestFailed, 'long op'
-if (-12L) + 24L != 12L: raise TestFailed, 'long op'
-if (-12L) + (-24L) != -36L: raise TestFailed, 'long op'
-if not 12L < 24L: raise TestFailed, 'long op'
-if not -24L < -12L: raise TestFailed, 'long op'
-x = sys.maxint
-if int(long(x)) != x: raise TestFailed, 'long op'
-try: y = int(long(x)+1L)
-except OverflowError: raise TestFailed, 'long op'
-if not isinstance(y, long): raise TestFailed, 'long op'
-x = -x
-if int(long(x)) != x: raise TestFailed, 'long op'
-x = x-1
-if int(long(x)) != x: raise TestFailed, 'long op'
-try: y = int(long(x)-1L)
-except OverflowError: raise TestFailed, 'long op'
-if not isinstance(y, long): raise TestFailed, 'long op'
-
-try: 5 << -5
-except ValueError: pass
-else: raise TestFailed, 'int negative shift <<'
-
-try: 5L << -5L
-except ValueError: pass
-else: raise TestFailed, 'long negative shift <<'
-
-try: 5 >> -5
-except ValueError: pass
-else: raise TestFailed, 'int negative shift >>'
-
-try: 5L >> -5L
-except ValueError: pass
-else: raise TestFailed, 'long negative shift >>'
-
-print '6.4.3 Floating point numbers'
-if 12.0 + 24.0 != 36.0: raise TestFailed, 'float op'
-if 12.0 + (-24.0) != -12.0: raise TestFailed, 'float op'
-if (-12.0) + 24.0 != 12.0: raise TestFailed, 'float op'
-if (-12.0) + (-24.0) != -36.0: raise TestFailed, 'float op'
-if not 12.0 < 24.0: raise TestFailed, 'float op'
-if not -24.0 < -12.0: raise TestFailed, 'float op'
-
-print '6.5 Sequence types'
-
-print '6.5.1 Strings'
-if len('') != 0: raise TestFailed, 'len(\'\')'
-if len('a') != 1: raise TestFailed, 'len(\'a\')'
-if len('abcdef') != 6: raise TestFailed, 'len(\'abcdef\')'
-if 'xyz' + 'abcde' != 'xyzabcde': raise TestFailed, 'string concatenation'
-if 'xyz'*3 != 'xyzxyzxyz': raise TestFailed, 'string repetition *3'
-if 0*'abcde' != '': raise TestFailed, 'string repetition 0*'
-if min('abc') != 'a' or max('abc') != 'c': raise TestFailed, 'min/max string'
-if 'a' in 'abc' and 'b' in 'abc' and 'c' in 'abc' and 'd' not in 'abc': pass
-else: raise TestFailed, 'in/not in string'
-x = 'x'*103
-if '%s!'%x != x+'!': raise TestFailed, 'nasty string formatting bug'
-
-#extended slices for strings
-a = '0123456789'
-vereq(a[::], a)
-vereq(a[::2], '02468')
-vereq(a[1::2], '13579')
-vereq(a[::-1],'9876543210')
-vereq(a[::-2], '97531')
-vereq(a[3::-2], '31')
-vereq(a[-100:100:], a)
-vereq(a[100:-100:-1], a[::-1])
-vereq(a[-100L:100L:2L], '02468')
-
-if have_unicode:
-    a = unicode('0123456789', 'ascii')
-    vereq(a[::], a)
-    vereq(a[::2], unicode('02468', 'ascii'))
-    vereq(a[1::2], unicode('13579', 'ascii'))
-    vereq(a[::-1], unicode('9876543210', 'ascii'))
-    vereq(a[::-2], unicode('97531', 'ascii'))
-    vereq(a[3::-2], unicode('31', 'ascii'))
-    vereq(a[-100:100:], a)
-    vereq(a[100:-100:-1], a[::-1])
-    vereq(a[-100L:100L:2L], unicode('02468', 'ascii'))
-
-
-print '6.5.2 Tuples [see test_tuple.py]'
-
-print '6.5.3 Lists [see test_list.py]'
-
-print '6.6 Mappings == Dictionaries [see test_dict.py]'
-
-
-try: type(1, 2)
-except TypeError: pass
-else: raise TestFailed, 'type(), w/2 args expected TypeError'
-
-try: type(1, 2, 3, 4)
-except TypeError: pass
-else: raise TestFailed, 'type(), w/4 args expected TypeError'
-
-print 'Buffers'
-try: buffer('asdf', -1)
-except ValueError: pass
-else: raise TestFailed, "buffer('asdf', -1) should raise ValueError"
-cmp(buffer("abc"), buffer("def")) # used to raise a warning: tp_compare didn't return -1, 0, or 1
-
-try: buffer(None)
-except TypeError: pass
-else: raise TestFailed, "buffer(None) should raise TypeError"
-
-a = buffer('asdf')
-hash(a)
-b = a * 5
-if a == b:
-    raise TestFailed, 'buffers should not be equal'
-if str(b) != ('asdf' * 5):
-    raise TestFailed, 'repeated buffer has wrong content'
-if str(a * 0) != '':
-    raise TestFailed, 'repeated buffer zero times has wrong content'
-if str(a + buffer('def')) != 'asdfdef':
-    raise TestFailed, 'concatenation of buffers yields wrong content'
-if str(buffer(a)) != 'asdf':
-    raise TestFailed, 'composing buffers failed'
-if str(buffer(a, 2)) != 'df':
-    raise TestFailed, 'specifying buffer offset failed'
-if str(buffer(a, 0, 2)) != 'as':
-    raise TestFailed, 'specifying buffer size failed'
-if str(buffer(a, 1, 2)) != 'sd':
-    raise TestFailed, 'specifying buffer offset and size failed'
-try: buffer(buffer('asdf', 1), -1)
-except ValueError: pass
-else: raise TestFailed, "buffer(buffer('asdf', 1), -1) should raise ValueError"
-if str(buffer(buffer('asdf', 0, 2), 0)) != 'as':
-    raise TestFailed, 'composing length-specified buffer failed'
-if str(buffer(buffer('asdf', 0, 2), 0, 5000)) != 'as':
-    raise TestFailed, 'composing length-specified buffer failed'
-if str(buffer(buffer('asdf', 0, 2), 0, -1)) != 'as':
-    raise TestFailed, 'composing length-specified buffer failed'
-if str(buffer(buffer('asdf', 0, 2), 1, 2)) != 's':
-    raise TestFailed, 'composing length-specified buffer failed'
-
-try: a[1] = 'g'
-except TypeError: pass
-else: raise TestFailed, "buffer assignment should raise TypeError"
-
-try: a[0:1] = 'g'
-except TypeError: pass
-else: raise TestFailed, "buffer slice assignment should raise TypeError"
-
-# array.array() returns an object that does not implement a char buffer,
-# something which int() uses for conversion.
-import array
-try: int(buffer(array.array('c')))
-except TypeError :pass
-else: raise TestFailed, "char buffer (at C level) not working"
+    def test_truth_values(self):
+        if None: self.fail('None is true instead of false')
+        if 0: self.fail('0 is true instead of false')
+        if 0L: self.fail('0L is true instead of false')
+        if 0.0: self.fail('0.0 is true instead of false')
+        if '': self.fail('\'\' is true instead of false')
+        if not 1: self.fail('1 is false instead of true')
+        if not 1L: self.fail('1L is false instead of true')
+        if not 1.0: self.fail('1.0 is false instead of true')
+        if not 'x': self.fail('\'x\' is false instead of true')
+        if not {'x': 1}: self.fail('{\'x\': 1} is false instead of true')
+        def f(): pass
+        class C: pass
+        import sys
+        x = C()
+        if not f: self.fail('f is false instead of true')
+        if not C: self.fail('C is false instead of true')
+        if not sys: self.fail('sys is false instead of true')
+        if not x: self.fail('x is false instead of true')
+
+    def test_boolean_ops(self):
+        if 0 or 0: self.fail('0 or 0 is true instead of false')
+        if 1 and 1: pass
+        else: self.fail('1 and 1 is false instead of true')
+        if not 1: self.fail('not 1 is true instead of false')
+
+    def test_comparisons(self):
+        if 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass
+        else: self.fail('int comparisons failed')
+        if 0L < 1L <= 1L == 1L >= 1L > 0L != 1L: pass
+        else: self.fail('long int comparisons failed')
+        if 0.0 < 1.0 <= 1.0 == 1.0 >= 1.0 > 0.0 != 1.0: pass
+        else: self.fail('float comparisons failed')
+        if '' < 'a' <= 'a' == 'a' < 'abc' < 'abd' < 'b': pass
+        else: self.fail('string comparisons failed')
+        if None is None: pass
+        else: self.fail('identity test failed')
+
+    def test_float_constructor(self):
+        self.assertRaises(ValueError, float, '')
+        self.assertRaises(ValueError, float, '5\0')
+
+    def test_zero_division(self):
+        try: 5.0 / 0.0
+        except ZeroDivisionError: pass
+        else: self.fail("5.0 / 0.0 didn't raise ZeroDivisionError")
+
+        try: 5.0 // 0.0
+        except ZeroDivisionError: pass
+        else: self.fail("5.0 // 0.0 didn't raise ZeroDivisionError")
+
+        try: 5.0 % 0.0
+        except ZeroDivisionError: pass
+        else: self.fail("5.0 % 0.0 didn't raise ZeroDivisionError")
+
+        try: 5 / 0L
+        except ZeroDivisionError: pass
+        else: self.fail("5 / 0L didn't raise ZeroDivisionError")
+
+        try: 5 // 0L
+        except ZeroDivisionError: pass
+        else: self.fail("5 // 0L didn't raise ZeroDivisionError")
+
+        try: 5 % 0L
+        except ZeroDivisionError: pass
+        else: self.fail("5 % 0L didn't raise ZeroDivisionError")
+
+    def test_numeric_types(self):
+        if 0 != 0L or 0 != 0.0 or 0L != 0.0: self.fail('mixed comparisons')
+        if 1 != 1L or 1 != 1.0 or 1L != 1.0: self.fail('mixed comparisons')
+        if -1 != -1L or -1 != -1.0 or -1L != -1.0:
+            self.fail('int/long/float value not equal')
+        # calling built-in types without argument must return 0
+        if int() != 0: self.fail('int() does not return 0')
+        if long() != 0L: self.fail('long() does not return 0L')
+        if float() != 0.0: self.fail('float() does not return 0.0')
+        if int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass
+        else: self.fail('int() does not round properly')
+        if long(1.9) == 1L == long(1.1) and long(-1.1) == -1L == long(-1.9): pass
+        else: self.fail('long() does not round properly')
+        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_normal_integers(self):
+        # Ensure the first 256 integers are shared
+        a = 256
+        b = 128*2
+        if a is not b: self.fail('256 is not shared')
+        if 12 + 24 != 36: self.fail('int op')
+        if 12 + (-24) != -12: self.fail('int op')
+        if (-12) + 24 != 12: self.fail('int op')
+        if (-12) + (-24) != -36: self.fail('int op')
+        if not 12 < 24: self.fail('int op')
+        if not -24 < -12: self.fail('int op')
+        # Test for a particular bug in integer multiply
+        xsize, ysize, zsize = 238, 356, 4
+        if not (xsize*ysize*zsize == zsize*xsize*ysize == 338912):
+            self.fail('int mul commutativity')
+        # And another.
+        m = -sys.maxint - 1
+        for divisor in 1, 2, 4, 8, 16, 32:
+            j = m // divisor
+            prod = divisor * j
+            if prod != m:
+                self.fail("%r * %r == %r != %r" % (divisor, j, prod, m))
+            if type(prod) is not int:
+                self.fail("expected type(prod) to be int, not %r" %
+                                   type(prod))
+        # Check for expected * overflow to long.
+        for divisor in 1, 2, 4, 8, 16, 32:
+            j = m // divisor - 1
+            prod = divisor * j
+            if type(prod) is not long:
+                self.fail("expected type(%r) to be long, not %r" %
+                                   (prod, type(prod)))
+        # Check for expected * overflow to long.
+        m = sys.maxint
+        for divisor in 1, 2, 4, 8, 16, 32:
+            j = m // divisor + 1
+            prod = divisor * j
+            if type(prod) is not long:
+                self.fail("expected type(%r) to be long, not %r" %
+                                   (prod, type(prod)))
+
+    def test_long_integers(self):
+        if 12L + 24L != 36L: self.fail('long op')
+        if 12L + (-24L) != -12L: self.fail('long op')
+        if (-12L) + 24L != 12L: self.fail('long op')
+        if (-12L) + (-24L) != -36L: self.fail('long op')
+        if not 12L < 24L: self.fail('long op')
+        if not -24L < -12L: self.fail('long op')
+        x = sys.maxint
+        if int(long(x)) != x: self.fail('long op')
+        try: y = int(long(x)+1L)
+        except OverflowError: self.fail('long op')
+        if not isinstance(y, long): self.fail('long op')
+        x = -x
+        if int(long(x)) != x: self.fail('long op')
+        x = x-1
+        if int(long(x)) != x: self.fail('long op')
+        try: y = int(long(x)-1L)
+        except OverflowError: self.fail('long op')
+        if not isinstance(y, long): self.fail('long op')
+
+        try: 5 << -5
+        except ValueError: pass
+        else: self.fail('int negative shift <<')
+
+        try: 5L << -5L
+        except ValueError: pass
+        else: self.fail('long negative shift <<')
+
+        try: 5 >> -5
+        except ValueError: pass
+        else: self.fail('int negative shift >>')
+
+        try: 5L >> -5L
+        except ValueError: pass
+        else: self.fail('long negative shift >>')
+
+    def test_floats(self):
+        if 12.0 + 24.0 != 36.0: self.fail('float op')
+        if 12.0 + (-24.0) != -12.0: self.fail('float op')
+        if (-12.0) + 24.0 != 12.0: self.fail('float op')
+        if (-12.0) + (-24.0) != -36.0: self.fail('float op')
+        if not 12.0 < 24.0: self.fail('float op')
+        if not -24.0 < -12.0: self.fail('float op')
+
+    def test_strings(self):
+        if len('') != 0: self.fail('len(\'\')')
+        if len('a') != 1: self.fail('len(\'a\')')
+        if len('abcdef') != 6: self.fail('len(\'abcdef\')')
+        if 'xyz' + 'abcde' != 'xyzabcde': self.fail('string concatenation')
+        if 'xyz'*3 != 'xyzxyzxyz': self.fail('string repetition *3')
+        if 0*'abcde' != '': self.fail('string repetition 0*')
+        if min('abc') != 'a' or max('abc') != 'c': self.fail('min/max string')
+        if 'a' in 'abc' and 'b' in 'abc' and 'c' in 'abc' and 'd' not in 'abc': pass
+        else: self.fail('in/not in string')
+        x = 'x'*103
+        if '%s!'%x != x+'!': self.fail('nasty string formatting bug')
+
+        #extended slices for strings
+        a = '0123456789'
+        self.assertEqual(a[::], a)
+        self.assertEqual(a[::2], '02468')
+        self.assertEqual(a[1::2], '13579')
+        self.assertEqual(a[::-1],'9876543210')
+        self.assertEqual(a[::-2], '97531')
+        self.assertEqual(a[3::-2], '31')
+        self.assertEqual(a[-100:100:], a)
+        self.assertEqual(a[100:-100:-1], a[::-1])
+        self.assertEqual(a[-100L:100L:2L], '02468')
+
+        if have_unicode:
+            a = unicode('0123456789', 'ascii')
+            self.assertEqual(a[::], a)
+            self.assertEqual(a[::2], unicode('02468', 'ascii'))
+            self.assertEqual(a[1::2], unicode('13579', 'ascii'))
+            self.assertEqual(a[::-1], unicode('9876543210', 'ascii'))
+            self.assertEqual(a[::-2], unicode('97531', 'ascii'))
+            self.assertEqual(a[3::-2], unicode('31', 'ascii'))
+            self.assertEqual(a[-100:100:], a)
+            self.assertEqual(a[100:-100:-1], a[::-1])
+            self.assertEqual(a[-100L:100L:2L], unicode('02468', 'ascii'))
+
+
+    def test_type_function(self):
+        self.assertRaises(TypeError, type, 1, 2)
+        self.assertRaises(TypeError, type, 1, 2, 3, 4)
+
+    def test_buffers(self):
+        self.assertRaises(ValueError, buffer, 'asdf', -1)
+        self.assertRaises(TypeError, buffer, None)
+
+        a = buffer('asdf')
+        hash(a)
+        b = a * 5
+        if a == b:
+            self.fail('buffers should not be equal')
+        if str(b) != ('asdf' * 5):
+            self.fail('repeated buffer has wrong content')
+        if str(a * 0) != '':
+            self.fail('repeated buffer zero times has wrong content')
+        if str(a + buffer('def')) != 'asdfdef':
+            self.fail('concatenation of buffers yields wrong content')
+        if str(buffer(a)) != 'asdf':
+            self.fail('composing buffers failed')
+        if str(buffer(a, 2)) != 'df':
+            self.fail('specifying buffer offset failed')
+        if str(buffer(a, 0, 2)) != 'as':
+            self.fail('specifying buffer size failed')
+        if str(buffer(a, 1, 2)) != 'sd':
+            self.fail('specifying buffer offset and size failed')
+        self.assertRaises(ValueError, buffer, buffer('asdf', 1), -1)
+        if str(buffer(buffer('asdf', 0, 2), 0)) != 'as':
+            self.fail('composing length-specified buffer failed')
+        if str(buffer(buffer('asdf', 0, 2), 0, 5000)) != 'as':
+            self.fail('composing length-specified buffer failed')
+        if str(buffer(buffer('asdf', 0, 2), 0, -1)) != 'as':
+            self.fail('composing length-specified buffer failed')
+        if str(buffer(buffer('asdf', 0, 2), 1, 2)) != 's':
+            self.fail('composing length-specified buffer failed')
+
+        try: a[1] = 'g'
+        except TypeError: pass
+        else: self.fail("buffer assignment should raise TypeError")
+
+        try: a[0:1] = 'g'
+        except TypeError: pass
+        else: self.fail("buffer slice assignment should raise TypeError")
+
+        # array.array() returns an object that does not implement a char buffer,
+        # something which int() uses for conversion.
+        import array
+        try: int(buffer(array.array('c')))
+        except TypeError: pass
+        else: self.fail("char buffer (at C level) not working")
+
+def test_main():
+    run_unittest(TypesTests)
+
+if __name__ == '__main__':
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_unicode.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_unicode.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_unicode.py	Fri Dec 15 05:21:50 2006
@@ -92,6 +92,9 @@
                 "\\xfe\\xff'")
             testrepr = repr(u''.join(map(unichr, xrange(256))))
             self.assertEqual(testrepr, latin1repr)
+            # Test repr works on wide unicode escapes without overflow.
+            self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096),
+                             repr(u"\U00010000" * 39 + u"\uffff" * 4096))
 
     def test_iterators(self):
         # Make sure unicode objects have an __iter__ method

Modified: python/branches/p3yk-noslice/Lib/test/test_unicode_file.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_unicode_file.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_unicode_file.py	Fri Dec 15 05:21:50 2006
@@ -152,7 +152,7 @@
     # top-level 'test' functions would be if they could take params
     def _test_single(self, filename):
         remove_if_exists(filename)
-        f = file(filename, "w")
+        f = open(filename, "w")
         f.close()
         try:
             self._do_single(filename)
@@ -170,7 +170,7 @@
     def _test_equivalent(self, filename1, filename2):
         remove_if_exists(filename1)
         self.failUnless(not os.path.exists(filename2))
-        f = file(filename1, "w")
+        f = open(filename1, "w")
         f.close()
         try:
             self._do_equivilent(filename1, filename2)

Modified: python/branches/p3yk-noslice/Lib/test/test_unpack.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_unpack.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_unpack.py	Fri Dec 15 05:21:50 2006
@@ -107,7 +107,7 @@
     >>> a, b, c, d, e = BadSeq()
     Traceback (most recent call last):
       ...
-    BozoError
+    test.test_unpack.BozoError
 
 Trigger code while expecting an IndexError (unpack sequence too short, wrong
 error)
@@ -115,7 +115,7 @@
     >>> a, b, c = BadSeq()
     Traceback (most recent call last):
       ...
-    BozoError
+    test.test_unpack.BozoError
 
 """
 

Modified: python/branches/p3yk-noslice/Lib/test/test_urllib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_urllib.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_urllib.py	Fri Dec 15 05:21:50 2006
@@ -27,7 +27,7 @@
     def setUp(self):
         """Setup of a temp file to use for testing"""
         self.text = "test_urllib: %s\n" % self.__class__.__name__
-        FILE = file(test_support.TESTFN, 'wb')
+        FILE = open(test_support.TESTFN, 'wb')
         try:
             FILE.write(self.text)
         finally:
@@ -139,7 +139,7 @@
         self.registerFileForCleanUp(test_support.TESTFN)
         self.text = 'testing urllib.urlretrieve'
         try:
-            FILE = file(test_support.TESTFN, 'wb')
+            FILE = open(test_support.TESTFN, 'wb')
             FILE.write(self.text)
             FILE.close()
         finally:
@@ -192,7 +192,7 @@
         self.assertEqual(second_temp, result[0])
         self.assert_(os.path.exists(second_temp), "copy of the file was not "
                                                   "made")
-        FILE = file(second_temp, 'rb')
+        FILE = open(second_temp, 'rb')
         try:
             text = FILE.read()
             FILE.close()

Modified: python/branches/p3yk-noslice/Lib/test/test_urllibnet.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_urllibnet.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_urllibnet.py	Fri Dec 15 05:21:50 2006
@@ -120,7 +120,7 @@
         file_location,info = urllib.urlretrieve("http://www.python.org/")
         self.assert_(os.path.exists(file_location), "file location returned by"
                         " urlretrieve is not a valid path")
-        FILE = file(file_location)
+        FILE = open(file_location)
         try:
             self.assert_(FILE.read(), "reading from the file location returned"
                          " by urlretrieve failed")
@@ -134,7 +134,7 @@
                                                 test_support.TESTFN)
         self.assertEqual(file_location, test_support.TESTFN)
         self.assert_(os.path.exists(file_location))
-        FILE = file(file_location)
+        FILE = open(file_location)
         try:
             self.assert_(FILE.read(), "reading from temporary file failed")
         finally:

Modified: python/branches/p3yk-noslice/Lib/test/test_userdict.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_userdict.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_userdict.py	Fri Dec 15 05:21:50 2006
@@ -46,13 +46,13 @@
         # Test __repr__
         self.assertEqual(str(u0), str(d0))
         self.assertEqual(repr(u1), repr(d1))
-        self.assertEqual(`u2`, `d2`)
+        self.assertEqual(repr(u2), repr(d2))
 
         # Test __cmp__ and __len__
         all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2]
         for a in all:
             for b in all:
-                self.assertEqual(cmp(a, b), cmp(len(a), len(b)))
+                self.assertEqual(a == b, len(a) == len(b))
 
         # Test __getitem__
         self.assertEqual(u2["one"], 1)

Modified: python/branches/p3yk-noslice/Lib/test/test_weakref.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_weakref.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_weakref.py	Fri Dec 15 05:21:50 2006
@@ -51,10 +51,10 @@
         # Live reference:
         o = C()
         wr = weakref.ref(o)
-        `wr`
+        repr(wr)
         # Dead reference:
         del o
-        `wr`
+        repr(wr)
 
     def test_basic_callback(self):
         self.check_basic_callback(C)
@@ -701,6 +701,12 @@
         self.arg = arg
     def __repr__(self):
         return "<Object %r>" % self.arg
+    def __lt__(self, other):
+        if isinstance(other, Object):
+            return self.arg < other.arg
+        return NotImplemented
+    def __hash__(self):
+        return hash(self.arg)
 
 
 class MappingTestCase(TestBase):

Modified: python/branches/p3yk-noslice/Lib/test/test_wsgiref.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_wsgiref.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_wsgiref.py	Fri Dec 15 05:21:50 2006
@@ -515,7 +515,7 @@
             "Content-Length: %d\r\n"
             "\r\n%s" % (h.error_status,len(h.error_body),h.error_body))
 
-        self.failUnless(h.stderr.getvalue().find("AssertionError")<>-1)
+        self.failUnless("AssertionError" in h.stderr.getvalue())
 
     def testErrorAfterOutput(self):
         MSG = "Some output has been sent"
@@ -528,7 +528,7 @@
         self.assertEqual(h.stdout.getvalue(),
             "Status: 200 OK\r\n"
             "\r\n"+MSG)
-        self.failUnless(h.stderr.getvalue().find("AssertionError")<>-1)
+        self.failUnless("AssertionError" in h.stderr.getvalue())
 
 
     def testHeaderFormats(self):

Modified: python/branches/p3yk-noslice/Lib/test/test_xdrlib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_xdrlib.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_xdrlib.py	Fri Dec 15 05:21:50 2006
@@ -1,3 +1,56 @@
+from test import test_support
+import unittest
+
 import xdrlib
 
-xdrlib._test()
+class XDRTest(unittest.TestCase):
+
+    def test_xdr(self):
+        p = xdrlib.Packer()
+
+        s = 'hello world'
+        a = ['what', 'is', 'hapnin', 'doctor']
+
+        p.pack_int(42)
+        p.pack_uint(9)
+        p.pack_bool(True)
+        p.pack_bool(False)
+        p.pack_uhyper(45L)
+        p.pack_float(1.9)
+        p.pack_double(1.9)
+        p.pack_string(s)
+        p.pack_list(range(5), p.pack_uint)
+        p.pack_array(a, p.pack_string)
+
+        # now verify
+        data = p.get_buffer()
+        up = xdrlib.Unpacker(data)
+
+        self.assertEqual(up.get_position(), 0)
+
+        self.assertEqual(up.unpack_int(), 42)
+        self.assertEqual(up.unpack_uint(), 9)
+        self.assert_(up.unpack_bool() is True)
+
+        # remember position
+        pos = up.get_position()
+        self.assert_(up.unpack_bool() is False)
+
+        # rewind and unpack again
+        up.set_position(pos)
+        self.assert_(up.unpack_bool() is False)
+
+        self.assertEqual(up.unpack_uhyper(), 45L)
+        self.assertAlmostEqual(up.unpack_float(), 1.9)
+        self.assertAlmostEqual(up.unpack_double(), 1.9)
+        self.assertEqual(up.unpack_string(), s)
+        self.assertEqual(up.unpack_list(up.unpack_uint), range(5))
+        self.assertEqual(up.unpack_array(up.unpack_string), a)
+        up.done()
+        self.assertRaises(EOFError, up.unpack_uint)
+
+def test_main():
+    test_support.run_unittest(XDRTest)
+
+if __name__ == "__main__":
+    test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_xmlrpc.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_xmlrpc.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_xmlrpc.py	Fri Dec 15 05:21:50 2006
@@ -86,6 +86,15 @@
         s = xmlrpclib.dumps((new_d,), methodresponse=True)
         self.assert_(isinstance(s, str))
 
+    def test_newstyle_class(self):
+        class T(object):
+            pass
+        t = T()
+        t.x = 100
+        t.y = "Hello"
+        ((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
+        self.assertEquals(t2, t.__dict__)
+
     def test_dump_big_long(self):
         self.assertRaises(OverflowError, xmlrpclib.dumps, (2L**99,))
 

Modified: python/branches/p3yk-noslice/Lib/test/time_hashlib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/time_hashlib.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/time_hashlib.py	Fri Dec 15 05:21:50 2006
@@ -44,22 +44,22 @@
 # setup our creatorFunc to test the requested hash
 #
 if hName in ('_md5', '_sha'):
-    exec 'import '+hName
-    exec 'creatorFunc = '+hName+'.new'
+    exec('import '+hName)
+    exec('creatorFunc = '+hName+'.new')
     print "testing speed of old", hName, "legacy interface"
 elif hName == '_hashlib' and len(sys.argv) > 3:
     import _hashlib
-    exec 'creatorFunc = _hashlib.%s' % sys.argv[2]
+    exec('creatorFunc = _hashlib.%s' % sys.argv[2])
     print "testing speed of _hashlib.%s" % sys.argv[2], getattr(_hashlib, sys.argv[2])
 elif hName == '_hashlib' and len(sys.argv) == 3:
     import _hashlib
-    exec 'creatorFunc = lambda x=_hashlib.new : x(%r)' % sys.argv[2]
+    exec('creatorFunc = lambda x=_hashlib.new : x(%r)' % sys.argv[2])
     print "testing speed of _hashlib.new(%r)" % sys.argv[2]
 elif hasattr(hashlib, hName) and callable(getattr(hashlib, hName)):
     creatorFunc = getattr(hashlib, hName)
     print "testing speed of hashlib."+hName, getattr(hashlib, hName)
 else:
-    exec "creatorFunc = lambda x=hashlib.new : x(%r)" % hName
+    exec("creatorFunc = lambda x=hashlib.new : x(%r)" % hName)
     print "testing speed of hashlib.new(%r)" % hName
 
 try:

Modified: python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt	(original)
+++ python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt	Fri Dec 15 05:21:50 2006
@@ -21,7 +21,7 @@
   5]
 z = {'a':5,
   'b':6}
-x = (len(`y`) + 5*x - a[
+x = (len(repr(y)) + 5*x - a[
    3 ]
    - x + len({
    }
@@ -36,8 +36,8 @@
 x = 0
 
 # Ordinary integers
-0xff <> 255
-0377 <> 255
+0xff != 255
+0377 != 255
 2147483647   != 017777777777
 -2147483647-1 != 020000000000
 037777777777 != -1
@@ -146,10 +146,10 @@
 def d22(a, b, c=1, d=2): pass
 def d01v(a=1, *restt, **restd): pass
 
-(x, y) <> ({'a':1}, {'b':2})
+(x, y) != ({'a':1}, {'b':2})
 
 # comparison
-if 1 < 1 > 1 == 1 >= 1 <= 1 <> 1 != 1 in 1 not in 1 is 1 is not 1: pass
+if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 != 1 in 1 not in 1 is 1 is not 1: pass
 
 # binary
 x = 1 & 1

Modified: python/branches/p3yk-noslice/Lib/timeit.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/timeit.py	(original)
+++ python/branches/p3yk-noslice/Lib/timeit.py	Fri Dec 15 05:21:50 2006
@@ -115,7 +115,7 @@
         self.src = src # Save for traceback display
         code = compile(src, dummy_src_name, "exec")
         ns = {}
-        exec code in globals(), ns
+        exec(code, globals(), ns)
         self.inner = ns["inner"]
 
     def print_exc(self, file=None):

Modified: python/branches/p3yk-noslice/Lib/token.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/token.py	(original)
+++ python/branches/p3yk-noslice/Lib/token.py	Fri Dec 15 05:21:50 2006
@@ -35,7 +35,6 @@
 EQUAL = 22
 DOT = 23
 PERCENT = 24
-BACKQUOTE = 25
 LBRACE = 26
 RBRACE = 27
 EQEQUAL = 28

Modified: python/branches/p3yk-noslice/Lib/tokenize.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/tokenize.py	(original)
+++ python/branches/p3yk-noslice/Lib/tokenize.py	Fri Dec 15 05:21:50 2006
@@ -24,7 +24,7 @@
 
 __author__ = 'Ka-Ping Yee <ping at lfw.org>'
 __credits__ = \
-    'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro'
+    'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger'
 
 import string, re
 from token import *
@@ -77,13 +77,13 @@
 # Because of leftmost-then-longest match semantics, be sure to put the
 # longest operators first (e.g., if = came before ==, == would get
 # recognized as two instances of =).
-Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=",
+Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"!=",
                  r"//=?",
                  r"[+\-*/%&|^=<>]=?",
                  r"~")
 
 Bracket = '[][(){}]'
-Special = group(r'\r?\n', r'[:;.,`@]')
+Special = group(r'\r?\n', r'[:;.,@]')
 Funny = group(Operator, Bracket, Special)
 
 PlainToken = group(Number, Funny, String, Name)
@@ -159,14 +159,73 @@
     for token_info in generate_tokens(readline):
         tokeneater(*token_info)
 
+class Untokenizer:
+
+    def __init__(self):
+        self.tokens = []
+        self.prev_row = 1
+        self.prev_col = 0
+
+    def add_whitespace(self, start):
+        row, col = start
+        assert row <= self.prev_row
+        col_offset = col - self.prev_col
+        if col_offset:
+            self.tokens.append(" " * col_offset)
+
+    def untokenize(self, iterable):
+        for t in iterable:
+            if len(t) == 2:
+                self.compat(t, iterable)
+                break
+            tok_type, token, start, end, line = t
+            self.add_whitespace(start)
+            self.tokens.append(token)
+            self.prev_row, self.prev_col = end
+            if tok_type in (NEWLINE, NL):
+                self.prev_row += 1
+                self.prev_col = 0
+        return "".join(self.tokens)
+
+    def compat(self, token, iterable):
+        startline = False
+        indents = []
+        toks_append = self.tokens.append
+        toknum, tokval = token
+        if toknum in (NAME, NUMBER):
+            tokval += ' '
+        if toknum in (NEWLINE, NL):
+            startline = True
+        for tok in iterable:
+            toknum, tokval = tok[:2]
+
+            if toknum in (NAME, NUMBER):
+                tokval += ' '
+
+            if toknum == INDENT:
+                indents.append(tokval)
+                continue
+            elif toknum == DEDENT:
+                indents.pop()
+                continue
+            elif toknum in (NEWLINE, NL):
+                startline = True
+            elif startline and indents:
+                toks_append(indents[-1])
+                startline = False
+            toks_append(tokval)
 
 def untokenize(iterable):
     """Transform tokens back into Python source code.
 
     Each element returned by the iterable must be a token sequence
-    with at least two elements, a token number and token value.
+    with at least two elements, a token number and token value.  If
+    only two tokens are passed, the resulting output is poor.
+
+    Round-trip invariant for full input:
+        Untokenized source will match input source exactly
 
-    Round-trip invariant:
+    Round-trip invariant for limited intput:
         # Output text will tokenize the back to the input
         t1 = [tok[:2] for tok in generate_tokens(f.readline)]
         newcode = untokenize(t1)
@@ -174,31 +233,8 @@
         t2 = [tok[:2] for tokin generate_tokens(readline)]
         assert t1 == t2
     """
-
-    startline = False
-    indents = []
-    toks = []
-    toks_append = toks.append
-    for tok in iterable:
-        toknum, tokval = tok[:2]
-
-        if toknum in (NAME, NUMBER):
-            tokval += ' '
-
-        if toknum == INDENT:
-            indents.append(tokval)
-            continue
-        elif toknum == DEDENT:
-            indents.pop()
-            continue
-        elif toknum in (NEWLINE, COMMENT, NL):
-            startline = True
-        elif startline and indents:
-            toks_append(indents[-1])
-            startline = False
-        toks_append(tokval)
-    return ''.join(toks)
-
+    ut = Untokenizer()
+    return ut.untokenize(iterable)
 
 def generate_tokens(readline):
     """
@@ -237,7 +273,7 @@
             if endmatch:
                 pos = end = endmatch.end(0)
                 yield (STRING, contstr + line[:end],
-                           strstart, (lnum, end), contline + line)
+                       strstart, (lnum, end), contline + line)
                 contstr, needcont = '', 0
                 contline = None
             elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n':
@@ -263,7 +299,15 @@
             if pos == max: break
 
             if line[pos] in '#\r\n':           # skip comments or blank lines
-                yield ((NL, COMMENT)[line[pos] == '#'], line[pos:],
+                if line[pos] == '#':
+                    comment_token = line[pos:].rstrip('\r\n')
+                    nl_pos = pos + len(comment_token)
+                    yield (COMMENT, comment_token,
+                           (lnum, pos), (lnum, pos + len(comment_token)), line)
+                    yield (NL, line[nl_pos:],
+                           (lnum, nl_pos), (lnum, len(line)), line)
+                else:
+                    yield ((NL, COMMENT)[line[pos] == '#'], line[pos:],
                            (lnum, pos), (lnum, len(line)), line)
                 continue
 
@@ -294,9 +338,10 @@
                    (initial == '.' and token != '.'):      # ordinary number
                     yield (NUMBER, token, spos, epos, line)
                 elif initial in '\r\n':
-                    yield (parenlev > 0 and NL or NEWLINE,
-                               token, spos, epos, line)
+                    yield (NL if parenlev > 0 else NEWLINE,
+                           token, spos, epos, line)
                 elif initial == '#':
+                    assert not token.endswith("\n")
                     yield (COMMENT, token, spos, epos, line)
                 elif token in triple_quoted:
                     endprog = endprogs[token]

Modified: python/branches/p3yk-noslice/Lib/trace.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/trace.py	(original)
+++ python/branches/p3yk-noslice/Lib/trace.py	Fri Dec 15 05:21:50 2006
@@ -484,7 +484,7 @@
             sys.settrace(self.globaltrace)
             threading.settrace(self.globaltrace)
         try:
-            exec cmd in dict, dict
+            exec(cmd, dict, dict)
         finally:
             if not self.donothing:
                 sys.settrace(None)
@@ -497,7 +497,7 @@
             sys.settrace(self.globaltrace)
             threading.settrace(self.globaltrace)
         try:
-            exec cmd in globals, locals
+            exec(cmd, globals, locals)
         finally:
             if not self.donothing:
                 sys.settrace(None)

Modified: python/branches/p3yk-noslice/Lib/traceback.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/traceback.py	(original)
+++ python/branches/p3yk-noslice/Lib/traceback.py	Fri Dec 15 05:21:50 2006
@@ -162,7 +162,15 @@
 
     """
 
+    # Gracefully handle (the way Python 2.4 and earlier did) the case of
+    # being called with (None, None).
+    if etype is None:
+        return [_format_final_exc_line(etype, value)]
+
     stype = etype.__name__
+    smod = etype.__module__
+    if smod not in ("exceptions", "__main__", "__builtin__"):
+        stype = smod + '.' + stype
 
     if not issubclass(etype, SyntaxError):
         return [_format_final_exc_line(stype, value)]

Modified: python/branches/p3yk-noslice/Lib/urllib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/urllib.py	(original)
+++ python/branches/p3yk-noslice/Lib/urllib.py	Fri Dec 15 05:21:50 2006
@@ -302,13 +302,13 @@
 
         if proxy_passwd:
             import base64
-            proxy_auth = base64.encodestring(proxy_passwd).strip()
+            proxy_auth = base64.b64encode(proxy_passwd).strip()
         else:
             proxy_auth = None
 
         if user_passwd:
             import base64
-            auth = base64.encodestring(user_passwd).strip()
+            auth = base64.b64encode(user_passwd).strip()
         else:
             auth = None
         h = httplib.HTTP(host)
@@ -387,12 +387,12 @@
             if not host: raise IOError, ('https error', 'no host given')
             if proxy_passwd:
                 import base64
-                proxy_auth = base64.encodestring(proxy_passwd).strip()
+                proxy_auth = base64.b64encode(proxy_passwd).strip()
             else:
                 proxy_auth = None
             if user_passwd:
                 import base64
-                auth = base64.encodestring(user_passwd).strip()
+                auth = base64.b64encode(user_passwd).strip()
             else:
                 auth = None
             h = httplib.HTTPS(host, 0,

Modified: python/branches/p3yk-noslice/Lib/urllib2.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/urllib2.py	(original)
+++ python/branches/p3yk-noslice/Lib/urllib2.py	Fri Dec 15 05:21:50 2006
@@ -674,7 +674,7 @@
             proxy_type = orig_type
         if user and password:
             user_pass = '%s:%s' % (unquote(user), unquote(password))
-            creds = base64.encodestring(user_pass).strip()
+            creds = base64.b64encode(user_pass).strip()
             req.add_header('Proxy-authorization', 'Basic ' + creds)
         hostport = unquote(hostport)
         req.set_proxy(hostport, proxy_type)
@@ -798,7 +798,7 @@
         user, pw = self.passwd.find_user_password(realm, host)
         if pw is not None:
             raw = "%s:%s" % (user, pw)
-            auth = 'Basic %s' % base64.encodestring(raw).strip()
+            auth = 'Basic %s' % base64.b64encode(raw).strip()
             if req.headers.get(self.auth_header, None) == auth:
                 return None
             req.add_header(self.auth_header, auth)

Modified: python/branches/p3yk-noslice/Lib/uu.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/uu.py	(original)
+++ python/branches/p3yk-noslice/Lib/uu.py	Fri Dec 15 05:21:50 2006
@@ -114,6 +114,7 @@
     #
     # Open the output file
     #
+    opened = False
     if out_file == '-':
         out_file = sys.stdout
     elif isinstance(out_file, basestring):
@@ -123,6 +124,7 @@
         except AttributeError:
             pass
         out_file = fp
+        opened = True
     #
     # Main decoding loop
     #
@@ -140,6 +142,8 @@
         s = in_file.readline()
     if not s:
         raise Error('Truncated input file')
+    if opened:
+        out_file.close()
 
 def test():
     """uuencode/uudecode main program"""

Modified: python/branches/p3yk-noslice/Lib/uuid.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/uuid.py	(original)
+++ python/branches/p3yk-noslice/Lib/uuid.py	Fri Dec 15 05:21:50 2006
@@ -177,9 +177,36 @@
             int |= version << 76L
         self.__dict__['int'] = int
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if isinstance(other, UUID):
-            return cmp(self.int, other.int)
+            return self.int == other.int
+        return NotImplemented
+
+    def __ne__(self, other):
+        if isinstance(other, UUID):
+            return self.int != other.int
+        return NotImplemented
+
+    # XXX What's the value of being able to sort UUIDs?
+
+    def __lt__(self, other):
+        if isinstance(other, UUID):
+            return self.int < other.int
+        return NotImplemented
+
+    def __gt__(self, other):
+        if isinstance(other, UUID):
+            return self.int > other.int
+        return NotImplemented
+
+    def __le__(self, other):
+        if isinstance(other, UUID):
+            return self.int <= other.int
+        return NotImplemented
+
+    def __ge__(self, other):
+        if isinstance(other, UUID):
+            return self.int >= other.int
         return NotImplemented
 
     def __hash__(self):
@@ -488,7 +515,7 @@
     # 0x01b21dd213814000 is the number of 100-ns intervals between the
     # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
     timestamp = int(nanoseconds/100) + 0x01b21dd213814000L
-    if timestamp <= _last_timestamp:
+    if _last_timestamp is not None and timestamp <= _last_timestamp:
         timestamp = _last_timestamp + 1
     _last_timestamp = timestamp
     if clock_seq is None:

Modified: python/branches/p3yk-noslice/Lib/webbrowser.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/webbrowser.py	(original)
+++ python/branches/p3yk-noslice/Lib/webbrowser.py	Fri Dec 15 05:21:50 2006
@@ -165,7 +165,10 @@
         cmdline = [self.name] + [arg.replace("%s", url)
                                  for arg in self.args]
         try:
-            p = subprocess.Popen(cmdline, close_fds=True)
+            if sys.platform[:3] == 'win':
+                p = subprocess.Popen(cmdline)
+            else:
+                p = subprocess.Popen(cmdline, close_fds=True)
             return not p.wait()
         except OSError:
             return False
@@ -178,11 +181,14 @@
     def open(self, url, new=0, autoraise=1):
         cmdline = [self.name] + [arg.replace("%s", url)
                                  for arg in self.args]
-        setsid = getattr(os, 'setsid', None)
-        if not setsid:
-            setsid = getattr(os, 'setpgrp', None)
         try:
-            p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
+            if sys.platform[:3] == 'win':
+                p = subprocess.Popen(cmdline)
+            else:
+                setsid = getattr(os, 'setsid', None)
+                if not setsid:
+                    setsid = getattr(os, 'setpgrp', None)
+                p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
             return (p.poll() is None)
         except OSError:
             return False
@@ -210,7 +216,7 @@
         cmdline = [self.name] + raise_opt + args
 
         if remote or self.background:
-            inout = file(os.devnull, "r+")
+            inout = open(os.devnull, "r+")
         else:
             # for TTY browsers, we need stdin/out
             inout = None
@@ -334,7 +340,7 @@
         else:
             action = "openURL"
 
-        devnull = file(os.devnull, "r+")
+        devnull = open(os.devnull, "r+")
         # if possible, put browser in separate process group, so
         # keyboard interrupts don't affect browser as well as Python
         setsid = getattr(os, 'setsid', None)
@@ -441,7 +447,7 @@
 
         # if successful, register it
         if retncode is None and commd:
-            register("gnome", None, BackgroundBrowser(commd))
+            register("gnome", None, BackgroundBrowser(commd.split()))
 
     # First, the Mozilla/Netscape browsers
     for browser in ("mozilla-firefox", "firefox",
@@ -627,7 +633,7 @@
     for o, a in opts:
         if o == '-n': new_win = 1
         elif o == '-t': new_win = 2
-    if len(args) <> 1:
+    if len(args) != 1:
         print >>sys.stderr, usage
         sys.exit(1)
 

Modified: python/branches/p3yk-noslice/Lib/wsgiref/headers.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/wsgiref/headers.py	(original)
+++ python/branches/p3yk-noslice/Lib/wsgiref/headers.py	Fri Dec 15 05:21:50 2006
@@ -63,7 +63,7 @@
         Does *not* raise an exception if the header is missing.
         """
         name = name.lower()
-        self._headers[:] = [kv for kv in self._headers if kv[0].lower()<>name]
+        self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name]
 
     def __getitem__(self,name):
         """Get the first header value for 'name'
@@ -140,7 +140,7 @@
         return self._headers[:]
 
     def __repr__(self):
-        return "Headers(%s)" % `self._headers`
+        return "Headers(%r)" % self._headers
 
     def __str__(self):
         """str() returns the formatted headers, complete with end line,

Modified: python/branches/p3yk-noslice/Lib/wsgiref/simple_server.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/wsgiref/simple_server.py	(original)
+++ python/branches/p3yk-noslice/Lib/wsgiref/simple_server.py	Fri Dec 15 05:21:50 2006
@@ -169,7 +169,7 @@
     print >>stdout
     h = environ.items(); h.sort()
     for k,v in h:
-        print >>stdout, k,'=',`v`
+        print >>stdout, k,'=',repr(v)
     start_response("200 OK", [('Content-Type','text/plain')])
     return [stdout.getvalue()]
 

Modified: python/branches/p3yk-noslice/Lib/wsgiref/util.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/wsgiref/util.py	(original)
+++ python/branches/p3yk-noslice/Lib/wsgiref/util.py	Fri Dec 15 05:21:50 2006
@@ -98,7 +98,7 @@
         return None
 
     path_parts = path_info.split('/')
-    path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p<>'.']
+    path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p != '.']
     name = path_parts[1]
     del path_parts[1]
 

Modified: python/branches/p3yk-noslice/Lib/xdrlib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/xdrlib.py	(original)
+++ python/branches/p3yk-noslice/Lib/xdrlib.py	Fri Dec 15 05:21:50 2006
@@ -227,61 +227,3 @@
     def unpack_array(self, unpack_item):
         n = self.unpack_uint()
         return self.unpack_farray(n, unpack_item)
-
-
-# test suite
-def _test():
-    p = Packer()
-    packtest = [
-        (p.pack_uint,    (9,)),
-        (p.pack_bool,    (True,)),
-        (p.pack_bool,    (False,)),
-        (p.pack_uhyper,  (45L,)),
-        (p.pack_float,   (1.9,)),
-        (p.pack_double,  (1.9,)),
-        (p.pack_string,  ('hello world',)),
-        (p.pack_list,    (range(5), p.pack_uint)),
-        (p.pack_array,   (['what', 'is', 'hapnin', 'doctor'], p.pack_string)),
-        ]
-    succeedlist = [1] * len(packtest)
-    count = 0
-    for method, args in packtest:
-        print 'pack test', count,
-        try:
-            method(*args)
-            print 'succeeded'
-        except ConversionError, var:
-            print 'ConversionError:', var.msg
-            succeedlist[count] = 0
-        count = count + 1
-    data = p.get_buffer()
-    # now verify
-    up = Unpacker(data)
-    unpacktest = [
-        (up.unpack_uint,   (), lambda x: x == 9),
-        (up.unpack_bool,   (), lambda x: x is True),
-        (up.unpack_bool,   (), lambda x: x is False),
-        (up.unpack_uhyper, (), lambda x: x == 45L),
-        (up.unpack_float,  (), lambda x: 1.89 < x < 1.91),
-        (up.unpack_double, (), lambda x: 1.89 < x < 1.91),
-        (up.unpack_string, (), lambda x: x == 'hello world'),
-        (up.unpack_list,   (up.unpack_uint,), lambda x: x == range(5)),
-        (up.unpack_array,  (up.unpack_string,),
-         lambda x: x == ['what', 'is', 'hapnin', 'doctor']),
-        ]
-    count = 0
-    for method, args, pred in unpacktest:
-        print 'unpack test', count,
-        try:
-            if succeedlist[count]:
-                x = method(*args)
-                print pred(x) and 'succeeded' or 'failed', ':', x
-            else:
-                print 'skipping'
-        except ConversionError, var:
-            print 'ConversionError:', var.msg
-        count = count + 1
-
-
-if __name__ == '__main__':
-    _test()

Modified: python/branches/p3yk-noslice/Lib/xml/dom/minidom.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/xml/dom/minidom.py	(original)
+++ python/branches/p3yk-noslice/Lib/xml/dom/minidom.py	Fri Dec 15 05:21:50 2006
@@ -38,7 +38,7 @@
 
     prefix = EMPTY_PREFIX # non-null only for NS elements and attributes
 
-    def __nonzero__(self):
+    def __bool__(self):
         return True
 
     def toxml(self, encoding = None):

Modified: python/branches/p3yk-noslice/Lib/xmlrpclib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/xmlrpclib.py	(original)
+++ python/branches/p3yk-noslice/Lib/xmlrpclib.py	Fri Dec 15 05:21:50 2006
@@ -282,56 +282,9 @@
 # @param value A boolean value.  Any true value is interpreted as True,
 #              all other values are interpreted as False.
 
-if _bool_is_builtin:
-    boolean = Boolean = bool
-    # to avoid breaking code which references xmlrpclib.{True,False}
-    True, False = True, False
-else:
-    class Boolean:
-        """Boolean-value wrapper.
-
-        Use True or False to generate a "boolean" XML-RPC value.
-        """
-
-        def __init__(self, value = 0):
-            self.value = operator.truth(value)
-
-        def encode(self, out):
-            out.write("<value><boolean>%d</boolean></value>\n" % self.value)
-
-        def __cmp__(self, other):
-            if isinstance(other, Boolean):
-                other = other.value
-            return cmp(self.value, other)
-
-        def __repr__(self):
-            if self.value:
-                return "<Boolean True at %x>" % id(self)
-            else:
-                return "<Boolean False at %x>" % id(self)
-
-        def __int__(self):
-            return self.value
-
-        def __nonzero__(self):
-            return self.value
-
-    True, False = Boolean(1), Boolean(0)
-
-    ##
-    # Map true or false value to XML-RPC boolean values.
-    #
-    # @def boolean(value)
-    # @param value A boolean value.  Any true value is mapped to True,
-    #              all other values are mapped to False.
-    # @return xmlrpclib.True or xmlrpclib.False.
-    # @see Boolean
-    # @see True
-    # @see False
-
-    def boolean(value, _truefalse=(False, True)):
-        """Convert any Python value to XML-RPC 'boolean'."""
-        return _truefalse[operator.truth(value)]
+boolean = Boolean = bool
+# to avoid breaking code which references xmlrpclib.{True,False}
+True, False = True, False
 
 ##
 # Wrapper for XML-RPC DateTime values.  This converts a time value to
@@ -371,10 +324,15 @@
             value = time.strftime("%Y%m%dT%H:%M:%S", value)
         self.value = value
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if isinstance(other, DateTime):
             other = other.value
-        return cmp(self.value, other)
+        return self.value == other
+
+    def __ne__(self, other):
+        if isinstance(other, DateTime):
+            other = other.value
+        return self.value != other
 
     ##
     # Get date/time value.
@@ -432,10 +390,15 @@
     def __str__(self):
         return self.data or ""
 
-    def __cmp__(self, other):
+    def __eq__(self, other):
         if isinstance(other, Binary):
             other = other.data
-        return cmp(self.data, other)
+        return self.data == other
+
+    def __ne__(self, other):
+        if isinstance(other, Binary):
+            other = other.data
+        return self.data != other
 
     def decode(self, data):
         self.data = base64.decodestring(data)
@@ -630,9 +593,21 @@
         try:
             f = self.dispatch[type(value)]
         except KeyError:
-            raise TypeError, "cannot marshal %s objects" % type(value)
-        else:
-            f(self, value, write)
+            # check if this object can be marshalled as a structure
+            try:
+                value.__dict__
+            except:
+                raise TypeError, "cannot marshal %s objects" % type(value)
+            # check if this class is a sub-class of a basic type,
+            # because we don't know how to marshal these types
+            # (e.g. a string sub-class)
+            for type_ in type(value).__mro__:
+                if type_ in self.dispatch.keys():
+                    raise TypeError, "cannot marshal %s objects" % type(value)
+            # XXX(twouters): using "_arbitrary_instance" as key as a quick-fix
+            # for the p3yk merge, this should probably be fixed more neatly.
+            f = self.dispatch["_arbitrary_instance"]
+        f(self, value, write)
 
     def dump_nil (self, value, write):
         if not self.allow_none:
@@ -750,6 +725,9 @@
             self.dump_struct(value.__dict__, write)
     dispatch[DateTime] = dump_instance
     dispatch[Binary] = dump_instance
+    # XXX(twouters): using "_arbitrary_instance" as key as a quick-fix
+    # for the p3yk merge, this should probably be fixed more neatly.
+    dispatch["_arbitrary_instance"] = dump_instance
 
 ##
 # XML-RPC unmarshaller.

Modified: python/branches/p3yk-noslice/Mac/BuildScript/build-installer.py
==============================================================================
--- python/branches/p3yk-noslice/Mac/BuildScript/build-installer.py	(original)
+++ python/branches/p3yk-noslice/Mac/BuildScript/build-installer.py	Fri Dec 15 05:21:50 2006
@@ -10,9 +10,10 @@
 Usage: see USAGE variable in the script.
 """
 import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd
+import grp
 
-INCLUDE_TIMESTAMP=1
-VERBOSE=1
+INCLUDE_TIMESTAMP = 1
+VERBOSE = 1
 
 from plistlib import Plist
 
@@ -32,7 +33,7 @@
 
 def shellQuote(value):
     """
-    Return the string value in a form that can savely be inserted into
+    Return the string value in a form that can safely be inserted into
     a shell command.
     """
     return "'%s'"%(value.replace("'", "'\"'\"'"))
@@ -55,28 +56,28 @@
 
     raise RuntimeError, "Cannot find full version??"
 
-# The directory we'll use to create the build, will be erased and recreated
-WORKDIR="/tmp/_py"
+# The directory we'll use to create the build (will be erased and recreated)
+WORKDIR = "/tmp/_py"
 
-# The directory we'll use to store third-party sources, set this to something
+# The directory we'll use to store third-party sources. Set this to something
 # else if you don't want to re-fetch required libraries every time.
-DEPSRC=os.path.join(WORKDIR, 'third-party')
-DEPSRC=os.path.expanduser('~/Universal/other-sources')
+DEPSRC = os.path.join(WORKDIR, 'third-party')
+DEPSRC = os.path.expanduser('~/Universal/other-sources')
 
 # Location of the preferred SDK
-SDKPATH="/Developer/SDKs/MacOSX10.4u.sdk"
-#SDKPATH="/"
+SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
+#SDKPATH = "/"
 
-ARCHLIST=('i386', 'ppc',)
+ARCHLIST = ('i386', 'ppc',)
 
 # Source directory (asume we're in Mac/BuildScript)
-SRCDIR=os.path.dirname(
+SRCDIR = os.path.dirname(
         os.path.dirname(
             os.path.dirname(
                 os.path.abspath(__file__
         ))))
 
-USAGE=textwrap.dedent("""\
+USAGE = textwrap.dedent("""\
     Usage: build_python [options]
 
     Options:
@@ -91,7 +92,7 @@
 
 # Instructions for building libraries that are necessary for building a
 # batteries included python.
-LIBRARY_RECIPES=[
+LIBRARY_RECIPES = [
     dict(
         name="Bzip2 1.0.3",
         url="http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz",
@@ -183,7 +184,7 @@
 
 
 # Instructions for building packages inside the .mpkg.
-PKG_RECIPES=[
+PKG_RECIPES = [
     dict(
         name="PythonFramework",
         long_name="Python Framework",
@@ -200,7 +201,7 @@
         long_name="GUI Applications",
         source="/Applications/MacPython %(VER)s",
         readme="""\
-            This package installs IDLE (an interactive Python IDLE),
+            This package installs IDLE (an interactive Python IDE),
             Python Launcher and Build Applet (create application bundles
             from python scripts).
 
@@ -256,8 +257,7 @@
         readme="""\
             This package updates the system python installation on
             Mac OS X 10.3 to ensure that you can build new python extensions
-            using that copy of python after installing this version of
-            python.
+            using that copy of python after installing this version.
             """,
         postflight="../Tools/fixapplepython23.py",
         topdir="/Library/Frameworks/Python.framework",
@@ -323,7 +323,7 @@
 
 
 
-def parseOptions(args = None):
+def parseOptions(args=None):
     """
     Parse arguments and update global settings.
     """
@@ -636,15 +636,15 @@
     print "Running make"
     runCommand("make")
 
-    print "Runing make frameworkinstall"
+    print "Running make frameworkinstall"
     runCommand("make frameworkinstall DESTDIR=%s"%(
         shellQuote(rootDir)))
 
-    print "Runing make frameworkinstallextras"
+    print "Running make frameworkinstallextras"
     runCommand("make frameworkinstallextras DESTDIR=%s"%(
         shellQuote(rootDir)))
 
-    print "Copy required shared libraries"
+    print "Copying required shared libraries"
     if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
         runCommand("mv %s/* %s"%(
             shellQuote(os.path.join(
@@ -657,9 +657,13 @@
 
     print "Fix file modes"
     frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
+    gid = grp.getgrnam('admin').gr_gid
+
     for dirpath, dirnames, filenames in os.walk(frmDir):
         for dn in dirnames:
             os.chmod(os.path.join(dirpath, dn), 0775)
+            os.chown(os.path.join(dirpath, dn), -1, gid)
+
 
         for fn in filenames:
             if os.path.islink(fn):
@@ -668,7 +672,8 @@
             # "chmod g+w $fn"
             p = os.path.join(dirpath, fn)
             st = os.stat(p)
-            os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP)
+            os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
+            os.chown(p, -1, gid)
 
     # We added some directories to the search path during the configure
     # phase. Remove those because those directories won't be there on
@@ -729,8 +734,8 @@
 def packageFromRecipe(targetDir, recipe):
     curdir = os.getcwd()
     try:
-        # The major version (such as 2.5) is included in the pacakge name
-        # because haveing two version of python installed at the same time is
+        # The major version (such as 2.5) is included in the package name
+        # because having two version of python installed at the same time is
         # common.
         pkgname = '%s-%s'%(recipe['name'], getVersion())
         srcdir  = recipe.get('source')
@@ -904,7 +909,7 @@
 
 def buildDMG():
     """
-    Create DMG containing the rootDir
+    Create DMG containing the rootDir.
     """
     outdir = os.path.join(WORKDIR, 'diskimage')
     if os.path.exists(outdir):
@@ -917,7 +922,7 @@
     imagepath = imagepath + '.dmg'
 
     os.mkdir(outdir)
-    runCommand("hdiutil create -volname 'Univeral MacPython %s' -srcfolder %s %s"%(
+    runCommand("hdiutil create -volname 'Universal MacPython %s' -srcfolder %s %s"%(
             getFullVersion(),
             shellQuote(os.path.join(WORKDIR, 'installer')),
             shellQuote(imagepath)))
@@ -945,6 +950,10 @@
     ref, isDirectory = Carbon.File.FSPathMakeRef(filePath)
 
     if isDirectory:
+        # There is a problem with getting this into the pax(1) archive,
+        # just ignore directory icons for now.
+        return
+
         tmpPath = os.path.join(filePath, "Icon\r")
         if not os.path.exists(tmpPath):
             fp = open(tmpPath, 'w')

Modified: python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.documentation
==============================================================================
--- python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.documentation	(original)
+++ python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.documentation	Fri Dec 15 05:21:50 2006
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-# FIXME
 PYVER="@PYVER@"
 
 if [ -d /Developer/Documentation ]; then
@@ -8,5 +7,5 @@
 		mkdir -p /Developer/Documentation/Python
 	fi
 
-	ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation"
+	ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation @PYVER@"
 fi

Modified: python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.patch-profile
==============================================================================
--- python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.patch-profile	(original)
+++ python/branches/p3yk-noslice/Mac/BuildScript/scripts/postflight.patch-profile	Fri Dec 15 05:21:50 2006
@@ -47,22 +47,29 @@
 echo "${PYTHON_ROOT}/bin is not on your PATH or at least not early enough"
 case "${BSH}" in
 *csh)
+	if [ -f "${HOME}/.tcshrc" ]; then
+		RC="${HOME}/.tcshrc"
+	else
+		RC="${HOME}/.cshrc"
+	fi
 	# Create backup copy before patching
-	if [ -f "${HOME}/.cshrc" ]; then
-		cp -fp "${HOME}/.cshrc" "${HOME}/.cshrc.pysave"
+	if [ -f "${RC}" ]; then
+		cp -fp "${RC}" "${RC}.pysave"
 	fi
-	echo "" >> "${HOME}/.cshrc"
-	echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc"
-	echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc"
-	echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc"
+	echo "" >> "${RC}"
+	echo "# Setting PATH for MacPython ${PYVER}" >> "${RC}"
+	echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}"
+	echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}"
 	if [ `id -ur` = 0 ]; then
-		chown "${USER}" "${HOME}/.cshrc"
+		chown "${USER}" "${RC}"
 	fi
 	exit 0
 	;;
 bash)
 	if [ -e "${HOME}/.bash_profile" ]; then
 		PR="${HOME}/.bash_profile"
+	elif [ -e "${HOME}/.bash_login" ]; then
+		PR="${HOME}/.bash_login"
 	elif [ -e "${HOME}/.profile" ]; then
 		PR="${HOME}/.profile"
 	else

Modified: python/branches/p3yk-noslice/Mac/Makefile.in
==============================================================================
--- python/branches/p3yk-noslice/Mac/Makefile.in	(original)
+++ python/branches/p3yk-noslice/Mac/Makefile.in	Fri Dec 15 05:21:50 2006
@@ -101,7 +101,7 @@
 	fi
 
 
-pythonw: $(srcdir)/Tools/pythonw.c
+pythonw: $(srcdir)/Tools/pythonw.c Makefile
 	$(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
 		-DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/Python"'
 
@@ -249,3 +249,6 @@
 	rm pythonw
 	cd PythonLauncher && make clean
 	cd IDLE && make clean
+
+Makefile: $(srcdir)/Makefile.in ../config.status
+	cd .. && CONFIG_FILES=Mac/Makefile CONFIG_HEADERS= $(SHELL) ./config.status

Modified: python/branches/p3yk-noslice/Mac/PythonLauncher/FileSettings.m
==============================================================================
--- python/branches/p3yk-noslice/Mac/PythonLauncher/FileSettings.m	(original)
+++ python/branches/p3yk-noslice/Mac/PythonLauncher/FileSettings.m	Fri Dec 15 05:21:50 2006
@@ -207,7 +207,7 @@
             [NSNumber numberWithBool: inspect], @"inspect",
             [NSNumber numberWithBool: optimize], @"optimize",
             [NSNumber numberWithBool: nosite], @"nosite",
-            [NSNumber numberWithBool: nosite], @"nosite",
+            [NSNumber numberWithBool: tabs], @"tabs",
             others, @"others",
             scriptargs, @"scriptargs",
             [NSNumber numberWithBool: with_terminal], @"with_terminal",
@@ -235,7 +235,7 @@
     if (value) optimize = [value boolValue];
     value = [dict objectForKey: @"nosite"];
     if (value) nosite = [value boolValue];
-    value = [dict objectForKey: @"nosite"];
+    value = [dict objectForKey: @"tabs"];
     if (value) tabs = [value boolValue];
     value = [dict objectForKey: @"others"];
     if (value) others = [value retain];
@@ -291,7 +291,7 @@
         tabs?" -t":"",
         others,
         [self _replaceSingleQuotes:script],
-        scriptargs,
+        scriptargs ? scriptargs : @"",
         with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
 }
 

Modified: python/branches/p3yk-noslice/Mac/README
==============================================================================
--- python/branches/p3yk-noslice/Mac/README	(original)
+++ python/branches/p3yk-noslice/Mac/README	Fri Dec 15 05:21:50 2006
@@ -48,7 +48,7 @@
 
 A second reason for using frameworks is that they put Python-related items in
 only two places: "/Library/Framework/Python.framework" and 
-"/Applications/MacPython 2.5".  This simplifies matters for users installing 
+"/Applications/MacPython 2.6".  This simplifies matters for users installing 
 Python from a binary distribution if they want to get rid of it again. Moreover,
 due to the way frameworks work a user without admin privileges can install a 
 binary distribution in his or her home directory without recompilation.
@@ -75,7 +75,7 @@
 
 This directory contains a Makefile that will create a couple of python-related
 applications (fullblown OSX .app applications, that is) in
-"/Applications/MacPython 2.3", and a hidden helper application Python.app 
+"/Applications/MacPython 2.6", and a hidden helper application Python.app 
 inside the Python.framework, and unix tools "python" and "pythonw" into 
 /usr/local/bin.  In addition it has a target "installmacsubtree" that installs 
 the relevant portions of the Mac subtree into the Python.framework.
@@ -90,20 +90,16 @@
  3. make install
 
 This sequence will put the framework in /Library/Framework/Python.framework,
-the applications in /Applications/MacPython 2.5 and the unix tools in 
+the applications in "/Applications/MacPython 2.6" and the unix tools in 
 /usr/local/bin.
 
 Installing in another place, for instance $HOME/Library/Frameworks if you have
 no admin privileges on your machine, has only been tested very lightly. This
 can be done by configuring with --enable-framework=$HOME/Library/Frameworks.
-The other two directories, /Applications/MacPython-2.3 and /usr/local/bin, will 
-then also be deposited in $HOME. This is sub-optimal for the unix tools, which 
-you would want in $HOME/bin, but there is no easy way to fix this right now.
-
-Note that there are no references to the actual locations in the code or
-resource files, so you are free to move things around afterwards. For example,
-you could use --enable-framework=/tmp/newversion/Library/Frameworks and use
-/tmp/newversion as the basis for an installer or something.
+The other two directories, "/Applications/MacPython-2.6" and /usr/local/bin, 
+will then also be deposited in $HOME. This is sub-optimal for the unix tools, 
+which you would want in $HOME/bin, but there is no easy way to fix this right 
+now.
 
 If you want to install some part, but not all, read the main Makefile. The
 frameworkinstall is composed of a couple of sub-targets that install the
@@ -111,7 +107,7 @@
 
 There is an extra target frameworkinstallextras that is not part of the
 normal frameworkinstall which installs the Demo and Tools directories
-into /Applications/MacPython-2.3, this is useful for binary distributions.
+into "/Applications/MacPython 2.6", this is useful for binary distributions.
 
 What do all these programs do?
 ===============================

Modified: python/branches/p3yk-noslice/Mac/Tools/fixapplepython23.py
==============================================================================
--- python/branches/p3yk-noslice/Mac/Tools/fixapplepython23.py	(original)
+++ python/branches/p3yk-noslice/Mac/Tools/fixapplepython23.py	Fri Dec 15 05:21:50 2006
@@ -123,7 +123,8 @@
             makescript(GXX_SCRIPT, "g++")
     #  Finally fix the makefile
     rv = fix(MAKEFILE, do_apply)
-    sys.exit(rv)
+    #sys.exit(rv)
+    sys.exit(0)
 
 if __name__ == '__main__':
     main()

Modified: python/branches/p3yk-noslice/Makefile.pre.in
==============================================================================
--- python/branches/p3yk-noslice/Makefile.pre.in	(original)
+++ python/branches/p3yk-noslice/Makefile.pre.in	Fri Dec 15 05:21:50 2006
@@ -346,7 +346,7 @@
 
 # Build the shared modules
 sharedmods: $(BUILDPYTHON)
-	case $$MAKEFLAGS in \
+	@case $$MAKEFLAGS in \
 	*-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
 	esac
@@ -457,7 +457,7 @@
 		$(SIGNAL_OBJS) \
 		$(MODOBJS) \
 		$(srcdir)/Modules/getbuildinfo.c
-	$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
+	$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
 
 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
 	$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \

Modified: python/branches/p3yk-noslice/Misc/ACKS
==============================================================================
--- python/branches/p3yk-noslice/Misc/ACKS	(original)
+++ python/branches/p3yk-noslice/Misc/ACKS	Fri Dec 15 05:21:50 2006
@@ -242,6 +242,7 @@
 Michael Guravage
 Lars Gustäbel
 Barry Haddow
+Václav Haisman
 Paul ten Hagen
 Rasmus Hahn
 Peter Haight
@@ -365,6 +366,7 @@
 Soren Larsen
 Piers Lauder
 Ben Laurie
+Simon Law
 Chris Lawrence
 Christopher Lee
 Inyeol Lee
@@ -611,6 +613,7 @@
 Christian Tanzer
 Steven Taschuk
 Amy Taylor
+Monty Taylor
 Tobias Thelen
 Robin Thomas
 Eric Tiedemann
@@ -631,6 +634,7 @@
 Bill Tutt
 Doobee R. Tzeck
 Lionel Ulmer
+Roger Upole
 Michael Urman
 Hector Urtubia
 Dmitry Vasiliev

Modified: python/branches/p3yk-noslice/Misc/HISTORY
==============================================================================
--- python/branches/p3yk-noslice/Misc/HISTORY	(original)
+++ python/branches/p3yk-noslice/Misc/HISTORY	Fri Dec 15 05:21:50 2006
@@ -11679,7 +11679,7 @@
 - The way GNU readline is configured is totally different.  The
 --with-readline configure option is gone.  It is now an extension
 module, which may be loaded dynamically.  You must enable it (and
-specify the correct linraries to link with) in the Modules/Setup file.
+specify the correct libraries to link with) in the Modules/Setup file.
 Importing the module installs some hooks which enable command line
 editing.  When the interpreter shell is invoked interactively, it
 attempts to import the readline module; when this fails, the default

Modified: python/branches/p3yk-noslice/Misc/NEWS
==============================================================================
--- python/branches/p3yk-noslice/Misc/NEWS	(original)
+++ python/branches/p3yk-noslice/Misc/NEWS	Fri Dec 15 05:21:50 2006
@@ -32,10 +32,11 @@
 
 - Get rid of various compatibility-related flags (e.g. division flags).
 
+
 Core and Builtins
 -----------------
 
-- __coerce__ has been removed.
+- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__
 
 - Classic classes are a thing of the past.  All classes are new style.
 
@@ -55,19 +56,23 @@
 
 - Absolute import is the default behavior for 'import foo' etc.
 
+- Removed support for syntax:
+  backticks (`x`), <>
+
 - Removed these Python builtins:
   apply(), coerce(), input(), raw_input()
 
+- Removed these Python methods:
+  {}.has_key
+
 - Removed these Python slots:
   __coerce__, __div__, __idiv__, __rdiv__
 
 - Removed these attributes from Python modules:
   * operator module: div, idiv, __div__, __idiv__
 
-*** PyNumber_CoerceEx() and nb_coerce still need to be removed.
-
 - Removed these C APIs:
-  PyNumber_Coerce(), 
+  PyNumber_Coerce(), PyNumber_CoerceEx() 
 
 - Removed these C slots/fields:
   nb_divide, nb_inplace_divide
@@ -80,7 +85,13 @@
   getreadbufferproc, getwritebufferproc, getsegcountproc, getcharbufferproc
 
 - Removed these opcodes:
-  BINARY_DIVIDE, INPLACE_DIVIDE
+  BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT
+
+- zip returns an iterator
+
+- Additions:
+  set literals
+
 
 Extension Modules
 -----------------

Modified: python/branches/p3yk-noslice/Misc/SpecialBuilds.txt
==============================================================================
--- python/branches/p3yk-noslice/Misc/SpecialBuilds.txt	(original)
+++ python/branches/p3yk-noslice/Misc/SpecialBuilds.txt	Fri Dec 15 05:21:50 2006
@@ -91,7 +91,7 @@
 
 #define CLEANBYTE     0xCB   /* clean (newly allocated) memory */
 #define DEADBYTE      0xDB   /* dead (newly freed) memory */
-#define FORBIDDENBYTE 0xFB   /* fordidden -- untouchable bytes */
+#define FORBIDDENBYTE 0xFB   /* forbidden -- untouchable bytes */
 
 Strings of these bytes are unlikely to be valid addresses, floats, or 7-bit
 ASCII strings.

Modified: python/branches/p3yk-noslice/Misc/Vim/python.vim
==============================================================================
--- python/branches/p3yk-noslice/Misc/Vim/python.vim	(original)
+++ python/branches/p3yk-noslice/Misc/Vim/python.vim	Fri Dec 15 05:21:50 2006
@@ -62,39 +62,39 @@
 
 
 if exists("python_highlight_builtins")
-  syn keyword pythonBuiltin    unichr all set abs vars int __import__ unicode
-  syn keyword pythonBuiltin    enumerate reduce exit issubclass
-  syn keyword pythonBuiltin    divmod file Ellipsis isinstance open any
-  syn keyword pythonBuiltin    locals help filter basestring slice copyright min
-  syn keyword pythonBuiltin    super sum tuple hex execfile long id chr
-  syn keyword pythonBuiltin    complex bool zip pow dict True oct NotImplemented
-  syn keyword pythonBuiltin    map None float hash getattr buffer max reversed
-  syn keyword pythonBuiltin    object quit len repr callable credits setattr
-  syn keyword pythonBuiltin    eval frozenset sorted ord __debug__ hasattr
-  syn keyword pythonBuiltin    delattr False license classmethod type
-  syn keyword pythonBuiltin    list iter reload range globals
-  syn keyword pythonBuiltin    staticmethod str property round dir cmp
+  syn keyword pythonBuiltin    Ellipsis False None NotImplemented True __debug__
+  syn keyword pythonBuiltin    __import__ abs all any basestring bool
+  syn keyword pythonBuiltin    buffer callable chr classmethod cmp
+  syn keyword pythonBuiltin    complex copyright credits delattr dict
+  syn keyword pythonBuiltin    dir divmod enumerate eval execfile exit file
+  syn keyword pythonBuiltin    filter float frozenset getattr globals hasattr
+  syn keyword pythonBuiltin    hash help hex id int isinstance
+  syn keyword pythonBuiltin    issubclass iter len license list locals long map
+  syn keyword pythonBuiltin    max min object oct open ord pow property quit
+  syn keyword pythonBuiltin    range reload repr reversed round
+  syn keyword pythonBuiltin    set setattr slice sorted staticmethod str sum
+  syn keyword pythonBuiltin    super tuple type unichr unicode vars zip
 
 endif
 
 
 if exists("python_highlight_exceptions")
-  syn keyword pythonException    GeneratorExit ImportError RuntimeError
-  syn keyword pythonException    UnicodeTranslateError MemoryError StopIteration
-  syn keyword pythonException    PendingDeprecationWarning EnvironmentError
-  syn keyword pythonException    LookupError OSError DeprecationWarning
-  syn keyword pythonException    UnicodeError UnicodeEncodeError
-  syn keyword pythonException    FloatingPointError ReferenceError NameError
-  syn keyword pythonException    IOError SyntaxError
-  syn keyword pythonException    FutureWarning ImportWarning SystemExit
-  syn keyword pythonException    Exception EOFError StandardError ValueError
-  syn keyword pythonException    TabError KeyError ZeroDivisionError SystemError
-  syn keyword pythonException    UnicodeDecodeError IndentationError
-  syn keyword pythonException    AssertionError TypeError IndexError
-  syn keyword pythonException    RuntimeWarning KeyboardInterrupt UserWarning
-  syn keyword pythonException    SyntaxWarning UnboundLocalError ArithmeticError
-  syn keyword pythonException    Warning NotImplementedError AttributeError
-  syn keyword pythonException    OverflowError BaseException
+  syn keyword pythonException    ArithmeticError AssertionError AttributeError
+  syn keyword pythonException    BaseException DeprecationWarning EOFError
+  syn keyword pythonException    EnvironmentError Exception FloatingPointError
+  syn keyword pythonException    FutureWarning GeneratorExit IOError ImportError
+  syn keyword pythonException    ImportWarning IndentationError IndexError
+  syn keyword pythonException    KeyError KeyboardInterrupt LookupError
+  syn keyword pythonException    MemoryError NameError NotImplementedError
+  syn keyword pythonException    OSError OverflowError PendingDeprecationWarning
+  syn keyword pythonException    ReferenceError RuntimeError RuntimeWarning
+  syn keyword pythonException    StandardError StopIteration SyntaxError
+  syn keyword pythonException    SyntaxWarning SystemError SystemExit TabError
+  syn keyword pythonException    TypeError UnboundLocalError UnicodeDecodeError
+  syn keyword pythonException    UnicodeEncodeError UnicodeError
+  syn keyword pythonException    UnicodeTranslateError UnicodeWarning
+  syn keyword pythonException    UserWarning ValueError Warning
+  syn keyword pythonException    ZeroDivisionError
 
 endif
 

Modified: python/branches/p3yk-noslice/Misc/Vim/vim_syntax.py
==============================================================================
--- python/branches/p3yk-noslice/Misc/Vim/vim_syntax.py	(original)
+++ python/branches/p3yk-noslice/Misc/Vim/vim_syntax.py	Fri Dec 15 05:21:50 2006
@@ -5,9 +5,9 @@
 import __builtin__
 from string import Template
 
-comment_header = """" Auto-generated Vim syntax file for Python
+comment_header = '''" Auto-generated Vim syntax file for Python.
 "
-" To use: copy or symlink to ~/.vim/syntax/python.vim"""
+" To use: copy or symlink to ~/.vim/syntax/python.vim'''
 
 statement_header = """
 if exists("b:current_syntax")
@@ -30,14 +30,14 @@
 import_stmts = ('import', 'from')
 object_defs = ('def', 'class')
 
-exception_names = frozenset(exc for exc in dir(exceptions)
+exception_names = sorted(exc for exc in dir(exceptions)
                                 if not exc.startswith('__'))
 
 # Need to include functions that start with '__' (e.g., __import__), but
 # nothing that comes with modules (e.g., __name__), so just exclude anything in
 # the 'exceptions' module since we want to ignore exceptions *and* what any
 # module would have
-builtin_names = frozenset(builtin for builtin in dir(__builtin__)
+builtin_names = sorted(builtin for builtin in dir(__builtin__)
                             if builtin not in dir(exceptions))
 
 escapes = (r'+\\[abfnrtv\'"\\]+', r'"\\\o\{1,3}"', r'"\\x\x\{2}"',

Modified: python/branches/p3yk-noslice/Misc/Vim/vimrc
==============================================================================
--- python/branches/p3yk-noslice/Misc/Vim/vimrc	(original)
+++ python/branches/p3yk-noslice/Misc/Vim/vimrc	Fri Dec 15 05:21:50 2006
@@ -19,9 +19,10 @@
 " Number of spaces to use for an indent.
 " This will affect Ctrl-T and 'autoindent'.
 " Python: 4 spaces
-" C: tab (8 spaces)
+" C: 4 spaces
 au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
-au BufRead,BufNewFile *.c,*.h set shiftwidth=4
+au BufRead *.c,*.h set shiftwidth=8
+au BufNewFile *.c,*.h set shiftwidth=4
 
 " Number of spaces that a pre-existing tab is equal to.
 " For the amount of space used for a new tab use shiftwidth.

Modified: python/branches/p3yk-noslice/Misc/cheatsheet
==============================================================================
--- python/branches/p3yk-noslice/Misc/cheatsheet	(original)
+++ python/branches/p3yk-noslice/Misc/cheatsheet	Fri Dec 15 05:21:50 2006
@@ -215,7 +215,6 @@
         x^y                               Bitwise exclusive or
         x|y                               Bitwise or
         x<y  x<=y  x>y  x>=y  x==y x!=y   Comparison,
-        x<>y                              identity,
         x is y   x is not y               membership
         x in s   x not in s
         not x                             boolean negation
@@ -241,7 +240,7 @@
 >          strictly greater than
 >=         greater than or equal to
 ==         equal to
-!= or <>   not equal to
+!=         not equal to
 is         object identity           (2)
 is not     negated object identity   (2)
 
@@ -270,7 +269,7 @@
 
 Notes :
     Truth testing behavior can be overridden for a given class by defining
-special method __nonzero__.
+special method __bool__.
     (1) Evaluate second arg only if necessary to determine outcome.
 
 None
@@ -901,7 +900,7 @@
                 -- Creates an anonymous function. returnedExpr must be
                    an expression, not a statement (e.g., not "if xx:...",
                    "print xxx", etc.) and thus can't contain newlines.
-                   Used mostly for filter(), map(), reduce() functions, and GUI callbacks..
+                   Used mostly for filter(), map() functions, and GUI callbacks..
 List comprehensions
 result = [expression for item1 in sequence1  [if condition1]
                         [for item2 in sequence2 ... for itemN in sequenceN]
@@ -1005,18 +1004,12 @@
 range(start [,end   Returns list of ints from >= start and < end.With 1 arg,
 [, step]])          list from 0..arg-1With 2 args, list from start..end-1With 3
                     args, list from start up to end by step
-reduce(f, list [,   Applies the binary function f to the items oflist so as to
-init])              reduce the list to a single value.If init given, it is
-                    "prepended" to list.
-                    Re-parses and re-initializes an already imported module.
-                    Useful in interactive mode, if you want to reload amodule
 reload(module)      after fixing it. If module was syntacticallycorrect but had
                     an error in initialization, mustimport it one more time
                     before calling reload().
                     Returns a string containing a printable and if possible
-repr(object)        evaluable representation of an object. <=> `object`
-                    (usingbackquotes). Class redefinissable (__repr__). See
-                    also str()
+repr(object)        evaluable representation of an object. 
+                    Class redefinable (__repr__). See also str().
 round(x, n=0)       Returns the floating point value x rounded to n digitsafter
                     the decimal point.
 setattr(object,     This is the counterpart of getattr().setattr(o, 'foobar',
@@ -1150,7 +1143,7 @@
         __cmp__(s, o)     Compares s to o and returns <0, 0, or >0.
                           Implements >, <, == etc...
         __hash__(s)       Compute a 32 bit hash code; hash() and dictionary ops
-        __nonzero__(s)    Returns False or True for truth value testing
+        __bool__(s)    Returns False or True for truth value testing
         __getattr__(s, name)  called when attr lookup doesn't find <name>
         __setattr__(s, name, val) called when setting an attr
                                   (inside, don't use "self.name = value"
@@ -1174,7 +1167,7 @@
         s&o       =  __and__(s,o)
         s^o       =  __xor__(s,o)         s|o        =  __or__(s,o)
         s<<o      =  __lshift__(s,o)      s>>o       =  __rshift__(s,o)
-        nonzero(s) = __nonzero__(s) (used in boolean testing)
+        bool(s) = __bool__(s) (used in boolean testing)
         -s        =  __neg__(s)           +s         =  __pos__(s)
         abs(s)    =  __abs__(s)           ~s         =  __invert__(s)  (bitwise)
         s+=o      =  __iadd__(s,o)        s-=o       =  __isub__(s,o)

Modified: python/branches/p3yk-noslice/Misc/python-mode.el
==============================================================================
--- python/branches/p3yk-noslice/Misc/python-mode.el	(original)
+++ python/branches/p3yk-noslice/Misc/python-mode.el	Fri Dec 15 05:21:50 2006
@@ -386,7 +386,7 @@
 			  "isinstance" "issubclass" "iter" "len" "license"
 			  "list" "locals" "long" "map" "max" "min" "object"
 			  "oct" "open" "ord" "pow" "property" "range"
-			  "reduce" "reload" "repr" "round"
+			  "reload" "repr" "round"
 			  "setattr" "slice" "staticmethod" "str" "sum"
 			  "super" "tuple" "type" "unichr" "unicode" "vars"
 			  "zip")
@@ -690,8 +690,6 @@
   ;; Both single quote and double quote are string delimiters
   (modify-syntax-entry ?\' "\"" py-mode-syntax-table)
   (modify-syntax-entry ?\" "\"" py-mode-syntax-table)
-  ;; backquote is open and close paren
-  (modify-syntax-entry ?\` "$"  py-mode-syntax-table)
   ;; comment delimiters
   (modify-syntax-entry ?\# "<"  py-mode-syntax-table)
   (modify-syntax-entry ?\n ">"  py-mode-syntax-table)

Modified: python/branches/p3yk-noslice/Misc/vgrindefs
==============================================================================
--- python/branches/p3yk-noslice/Misc/vgrindefs	(original)
+++ python/branches/p3yk-noslice/Misc/vgrindefs	Fri Dec 15 05:21:50 2006
@@ -6,5 +6,5 @@
         :pb=^\d?(def|class)\d\p(\d|\\|\(|\:):\
         :cb=#:ce=$:sb=":se=\e":lb=':le=\e':\
         :kw=assert and break class continue def del elif else except\
-         exec finally for from global if import in is lambda not or\
+         finally for from global if import in is lambda not or\
          pass print raise return try while yield:

Modified: python/branches/p3yk-noslice/Modules/_bsddb.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_bsddb.c	(original)
+++ python/branches/p3yk-noslice/Modules/_bsddb.c	Fri Dec 15 05:21:50 2006
@@ -98,7 +98,7 @@
 #error "eek! DBVER can't handle minor versions > 9"
 #endif
 
-#define PY_BSDDB_VERSION "4.4.5"
+#define PY_BSDDB_VERSION "4.4.6"
 static char *rcs_id = "$Id$";
 
 
@@ -1779,9 +1779,7 @@
         return NULL;
     CHECK_DB_NOT_CLOSED(self);
 
-    MYDB_BEGIN_ALLOW_THREADS;
     type = _DB_get_type(self);
-    MYDB_END_ALLOW_THREADS;
     if (type == -1)
         return NULL;
     return PyInt_FromLong(type);
@@ -2430,7 +2428,7 @@
 #if (DBVER >= 43)
     PyObject* txnobj = NULL;
     DB_TXN *txn = NULL;
-    static char* kwnames[] = { "txn", "flags", NULL };
+    static char* kwnames[] = { "flags", "txn", NULL };
 #else
     static char* kwnames[] = { "flags", NULL };
 #endif

Modified: python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c	Fri Dec 15 05:21:50 2006
@@ -2589,16 +2589,22 @@
 	PPROC address;
 	char *mangled_name;
 	int i;
-	StgDictObject *dict = PyType_stgdict((PyObject *)type);
+	StgDictObject *dict;
 
 	address = (PPROC)GetProcAddress(handle, name);
+#ifdef _WIN64
+	/* win64 has no stdcall calling conv, so it should
+	   also not have the name mangling of it.
+	*/
+	return address;
+#else
 	if (address)
 		return address;
-
 	if (((size_t)name & ~0xFFFF) == 0) {
 		return NULL;
 	}
 
+	dict = PyType_stgdict((PyObject *)type);
 	/* It should not happen that dict is NULL, but better be safe */
 	if (dict==NULL || dict->flags & FUNCFLAG_CDECL)
 		return address;
@@ -2617,6 +2623,7 @@
 			return address;
 	}
 	return NULL;
+#endif
 }
 #endif
 
@@ -4154,7 +4161,7 @@
 	{ NULL, NULL },
 };
 
-static int Simple_nonzero(CDataObject *self)
+static int Simple_bool(CDataObject *self)
 {
 	return memcmp(self->b_ptr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", self->b_size);
 }
@@ -4169,7 +4176,7 @@
 	0, /* nb_negative */
 	0, /* nb_positive */
 	0, /* nb_absolute */
-	(inquiry)Simple_nonzero, /* nb_nonzero */
+	(inquiry)Simple_bool, /* nb_bool */
 };
 
 #if (PY_VERSION_HEX < 0x02040000)
@@ -4594,7 +4601,7 @@
 };
 
 static int
-Pointer_nonzero(CDataObject *self)
+Pointer_bool(CDataObject *self)
 {
 	return *(void **)self->b_ptr != NULL;
 }
@@ -4609,7 +4616,7 @@
 	0, /* nb_negative */
 	0, /* nb_positive */
 	0, /* nb_absolute */
-	(inquiry)Pointer_nonzero, /* nb_nonzero */
+	(inquiry)Pointer_bool, /* nb_bool */
 };
 
 PyTypeObject Pointer_Type = {
@@ -4818,11 +4825,11 @@
 			if (obj->b_objects == NULL)
 				goto failed;
 		}
+		Py_XINCREF(obj->b_objects);
 		result->b_objects = obj->b_objects;
-		if (result->b_objects) {
+		if (result->b_objects && PyDict_Check(result->b_objects)) {
 			PyObject *index;
 			int rc;
-			Py_INCREF(obj->b_objects);
 			index = PyLong_FromVoidPtr((void *)src);
 			if (index == NULL)
 				goto failed;

Modified: python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c	Fri Dec 15 05:21:50 2006
@@ -25,6 +25,16 @@
 
 /* some functions handy for testing */
 
+EXPORT(int)myprintf(char *fmt, ...)
+{
+	int result;
+	va_list argptr;
+	va_start(argptr, fmt);
+	result = vprintf(fmt, argptr);
+	va_end(argptr);
+	return result;
+}
+
 EXPORT(char *)my_strtok(char *token, const char *delim)
 {
 	return strtok(token, delim);

Modified: python/branches/p3yk-noslice/Modules/_ctypes/callbacks.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/callbacks.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/callbacks.c	Fri Dec 15 05:21:50 2006
@@ -51,6 +51,7 @@
 	if (!empty_string) goto bad;
 	py_code = PyCode_New(
 		0,            /*int argcount,*/
+		0,            /*int kwonlyargcount,*/
 		0,            /*int nlocals,*/
 		0,            /*int stacksize,*/
 		0,            /*int flags,*/
@@ -293,14 +294,17 @@
 		p->restype = &ffi_type_void;
 	} else {
 		StgDictObject *dict = PyType_stgdict(restype);
-		if (dict == NULL)
-			goto error;
+		if (dict == NULL || dict->setfunc == NULL) {
+		  PyErr_SetString(PyExc_TypeError,
+				  "invalid result type for callback function");
+		  goto error;
+		}
 		p->setfunc = dict->setfunc;
 		p->restype = &dict->ffi_type_pointer;
 	}
 
 	cc = FFI_DEFAULT_ABI;
-#if defined(MS_WIN32) && !defined(_WIN32_WCE)
+#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64)
 	if (is_cdecl == 0)
 		cc = FFI_STDCALL;
 #endif

Modified: python/branches/p3yk-noslice/Modules/_ctypes/callproc.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/callproc.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/callproc.c	Fri Dec 15 05:21:50 2006
@@ -638,7 +638,7 @@
 	}
 	
 	cc = FFI_DEFAULT_ABI;
-#if defined(MS_WIN32) && !defined(_WIN32_WCE)
+#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE)
 	if ((flags & FUNCFLAG_CDECL) == 0)
 		cc = FFI_STDCALL;
 #endif
@@ -683,6 +683,14 @@
 		return -1;
 	}
 #endif
+#ifdef MS_WIN64
+	if (delta != 0) {
+		PyErr_Format(PyExc_RuntimeError,
+			     "ffi_call failed with code %d",
+			     delta);
+		return -1;
+	}
+#else
 	if (delta < 0) {
 		if (flags & FUNCFLAG_CDECL)
 			PyErr_Format(PyExc_ValueError,
@@ -704,6 +712,7 @@
 		return -1;
 	}
 #endif
+#endif
 	if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred())
 		return -1;
 	return 0;
@@ -979,7 +988,11 @@
 	}
 	for (i = 0; i < argcount; ++i) {
 		atypes[i] = args[i].ffi_type;
-		if (atypes[i]->type == FFI_TYPE_STRUCT)
+		if (atypes[i]->type == FFI_TYPE_STRUCT 
+#ifdef _WIN64
+		    && atypes[i]->size <= sizeof(void *)
+#endif
+		    )
 			avalues[i] = (void *)args[i].value.p;
 		else
 			avalues[i] = (void *)&args[i].value;
@@ -1099,7 +1112,11 @@
 	hMod = LoadLibrary(name);
 	if (!hMod)
 		return PyErr_SetFromWindowsErr(GetLastError());
+#ifdef _WIN64
+	return PyLong_FromVoidPtr(hMod);
+#else
 	return Py_BuildValue("i", hMod);
+#endif
 }
 
 static char free_library_doc[] =
@@ -1230,11 +1247,11 @@
 
 static PyObject *py_dl_close(PyObject *self, PyObject *args)
 {
-	void * handle;
+	int handle;
 
 	if (!PyArg_ParseTuple(args, "i:dlclose", &handle))
 		return NULL;
-	if (dlclose(handle)) {
+	if (dlclose((void*)handle)) {
 		PyErr_SetString(PyExc_OSError,
 				       ctypes_dlerror());
 		return NULL;
@@ -1246,12 +1263,12 @@
 static PyObject *py_dl_sym(PyObject *self, PyObject *args)
 {
 	char *name;
-	void *handle;
+	int handle;
 	void *ptr;
 
 	if (!PyArg_ParseTuple(args, "is:dlsym", &handle, &name))
 		return NULL;
-	ptr = ctypes_dlsym(handle, name);
+	ptr = ctypes_dlsym((void*)handle, name);
 	if (!ptr) {
 		PyErr_SetString(PyExc_OSError,
 				       ctypes_dlerror());
@@ -1269,7 +1286,7 @@
 static PyObject *
 call_function(PyObject *self, PyObject *args)
 {
-	PPROC func;
+	int func;
 	PyObject *arguments;
 	PyObject *result;
 
@@ -1279,7 +1296,7 @@
 			      &PyTuple_Type, &arguments))
 		return NULL;
 
-	result =  _CallProc(func,
+	result =  _CallProc((PPROC)func,
 			    arguments,
 #ifdef MS_WIN32
 			    NULL,
@@ -1300,7 +1317,7 @@
 static PyObject *
 call_cdeclfunction(PyObject *self, PyObject *args)
 {
-	PPROC func;
+	int func;
 	PyObject *arguments;
 	PyObject *result;
 
@@ -1310,7 +1327,7 @@
 			      &PyTuple_Type, &arguments))
 		return NULL;
 
-	result =  _CallProc(func,
+	result =  _CallProc((PPROC)func,
 			    arguments,
 #ifdef MS_WIN32
 			    NULL,
@@ -1493,7 +1510,7 @@
 #else
 			      "On:resize",
 #endif
-			      (PyObject *)&obj, &size))
+			      &obj, &size))
 		return NULL;
 
 	dict = PyObject_stgdict((PyObject *)obj);

Modified: python/branches/p3yk-noslice/Modules/_ctypes/cfield.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/cfield.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/cfield.c	Fri Dec 15 05:21:50 2006
@@ -1315,7 +1315,11 @@
 		*(char **)ptr = PyString_AS_STRING(str);
 		return str;
 	} else if (PyInt_Check(value) || PyLong_Check(value)) {
+#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
+		*(char **)ptr = (char *)PyInt_AsUnsignedLongLongMask(value);
+#else
 		*(char **)ptr = (char *)PyInt_AsUnsignedLongMask(value);
+#endif
 		_RET(value);
 	}
 	PyErr_Format(PyExc_TypeError,
@@ -1360,7 +1364,11 @@
 		if (!value)
 			return NULL;
 	} else if (PyInt_Check(value) || PyLong_Check(value)) {
+#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
+		*(wchar_t **)ptr = (wchar_t *)PyInt_AsUnsignedLongLongMask(value);
+#else
 		*(wchar_t **)ptr = (wchar_t *)PyInt_AsUnsignedLongMask(value);
+#endif
 		Py_INCREF(Py_None);
 		return Py_None;
 	} else if (!PyUnicode_Check(value)) {

Modified: python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c	Fri Dec 15 05:21:50 2006
@@ -1,4 +1,4 @@
-#ifdef __ppc__
+#if !(defined(__APPLE__) && !defined(__ppc__))
 /* -----------------------------------------------------------------------
    ffi.c - Copyright (c) 1998 Geoffrey Keating
 

Modified: python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/x86/sysv.S
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/x86/sysv.S	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/libffi/src/x86/sysv.S	Fri Dec 15 05:21:50 2006
@@ -376,3 +376,7 @@
 #endif
 
 #endif /* ifndef __x86_64__ */
+
+#ifdef __ELF__
+.section .note.GNU-stack,"",%progbits
+#endif

Modified: python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.c	Fri Dec 15 05:21:50 2006
@@ -34,6 +34,8 @@
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments */
 
+extern void Py_FatalError(char *msg);
+
 /*@-exportheader@*/
 void ffi_prep_args(char *stack, extended_cif *ecif)
 /*@=exportheader@*/
@@ -44,11 +46,10 @@
   register ffi_type **p_arg;
 
   argp = stack;
-
   if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
     {
       *(void **) argp = ecif->rvalue;
-      argp += 4;
+      argp += sizeof(void *);
     }
 
   p_argv = ecif->avalue;
@@ -60,8 +61,8 @@
       size_t z;
 
       /* Align if necessary */
-      if ((sizeof(int) - 1) & (unsigned) argp)
-	argp = (char *) ALIGN(argp, sizeof(int));
+      if ((sizeof(void *) - 1) & (size_t) argp)
+	argp = (char *) ALIGN(argp, sizeof(void *));
 
       z = (*p_arg)->size;
       if (z < sizeof(int))
@@ -108,7 +109,11 @@
       p_argv++;
       argp += z;
     }
-  
+
+  if (argp - stack > ecif->cif->bytes) 
+    {
+      Py_FatalError("FFI BUG: not enough stack space for arguments");
+    }
   return;
 }
 
@@ -128,6 +133,9 @@
       break;
 
     case FFI_TYPE_UINT64:
+#ifdef _WIN64
+    case FFI_TYPE_POINTER:
+#endif
       cif->flags = FFI_TYPE_SINT64;
       break;
 
@@ -139,6 +147,7 @@
   return FFI_OK;
 }
 
+#ifdef _WIN32
 /*@-declundef@*/
 /*@-exportheader@*/
 extern int
@@ -160,6 +169,16 @@
 		 void (*fn)());
 /*@=declundef@*/
 /*@=exportheader@*/
+#endif
+
+#ifdef _WIN64
+extern int
+ffi_call_AMD64(void (*)(char *, extended_cif *),
+		 /*@out@*/ extended_cif *,
+		 unsigned, unsigned,
+		 /*@out@*/ unsigned *,
+		 void (*fn)());
+#endif
 
 int
 ffi_call(/*@dependent@*/ ffi_cif *cif, 
@@ -188,6 +207,7 @@
   
   switch (cif->abi) 
     {
+#if !defined(_WIN64)
     case FFI_SYSV:
       /*@-usedef@*/
       return ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, 
@@ -201,6 +221,14 @@
 			      cif->flags, ecif.rvalue, fn);
       /*@=usedef@*/
       break;
+#else
+    case FFI_SYSV:
+      /*@-usedef@*/
+      return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes, 
+			   cif->flags, ecif.rvalue, fn);
+      /*@=usedef@*/
+      break;
+#endif
 
     default:
       FFI_ASSERT(0);
@@ -213,10 +241,14 @@
 /** private members **/
 
 static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
-					 void** args, ffi_cif* cif);
+					  void** args, ffi_cif* cif);
 /* This function is jumped to by the trampoline */
 
+#ifdef _WIN64
+void *
+#else
 static void __fastcall
+#endif
 ffi_closure_SYSV (ffi_closure *closure, int *argp)
 {
   // this is our return value storage
@@ -244,6 +276,7 @@
 
   rtype = cif->flags;
 
+#if defined(_WIN32) && !defined(_WIN64)
 #ifdef _MSC_VER
   /* now, do a generic return based on the value of rtype */
   if (rtype == FFI_TYPE_INT)
@@ -303,6 +336,15 @@
 	   : "eax", "edx");
     }
 #endif
+#endif
+
+#ifdef _WIN64
+  /* The result is returned in rax.  This does the right thing for
+     result types except for floats; we have to 'mov xmm0, rax' in the
+     caller to correct this.
+  */
+  return *(void **)resp;
+#endif
 }
 
 /*@-exportheader@*/
@@ -330,8 +372,8 @@
       size_t z;
 
       /* Align if necessary */
-      if ((sizeof(int) - 1) & (unsigned) argp) {
-	argp = (char *) ALIGN(argp, sizeof(int));
+      if ((sizeof(char *) - 1) & (size_t) argp) {
+	argp = (char *) ALIGN(argp, sizeof(char*));
       }
 
       z = (*p_arg)->size;
@@ -347,24 +389,8 @@
   return;
 }
 
-/* How to make a trampoline.  Derived from gcc/config/i386/i386.c. */
-
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,BYTES) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   unsigned int  __fun = (unsigned int)(FUN); \
-   unsigned int  __ctx = (unsigned int)(CTX); \
-   unsigned int  __dis = __fun - ((unsigned int) __tramp + 8 + 4); \
-   *(unsigned char*)  &__tramp[0] = 0xb9; \
-   *(unsigned int*)   &__tramp[1] = __ctx; /* mov ecx, __ctx */ \
-   *(unsigned char*)  &__tramp[5] = 0x8b; \
-   *(unsigned char*)  &__tramp[6] = 0xd4; /* mov edx, esp */ \
-   *(unsigned char*)  &__tramp[7] = 0xe8; \
-   *(unsigned int*)   &__tramp[8] = __dis; /* call __fun  */ \
-   *(unsigned char*)  &__tramp[12] = 0xC2; /* ret BYTES */ \
-   *(unsigned short*) &__tramp[13] = BYTES; \
- }
-
 /* the cif must already be prep'ed */
+extern void ffi_closure_OUTER();
 
 ffi_status
 ffi_prep_closure (ffi_closure* closure,
@@ -373,19 +399,78 @@
 		  void *user_data)
 {
   short bytes;
+  char *tramp;
+#ifdef _WIN64
+  int mask;
+#endif
   FFI_ASSERT (cif->abi == FFI_SYSV);
   
   if (cif->abi == FFI_SYSV)
     bytes = 0;
+#if !defined(_WIN64)
   else if (cif->abi == FFI_STDCALL)
     bytes = cif->bytes;
+#endif
   else
     return FFI_BAD_ABI;
 
-  FFI_INIT_TRAMPOLINE (&closure->tramp[0],
-		       &ffi_closure_SYSV,
-		       (void*)closure,
-		       bytes);
+  tramp = &closure->tramp[0];
+
+#define BYTES(text) memcpy(tramp, text, sizeof(text)), tramp += sizeof(text)-1
+#define POINTER(x) *(void**)tramp = (void*)(x), tramp += sizeof(void*)
+#define SHORT(x) *(short*)tramp = x, tramp += sizeof(short)
+#define INT(x) *(int*)tramp = x, tramp += sizeof(int)
+
+#ifdef _WIN64
+  if (cif->nargs >= 1 &&
+      (cif->arg_types[0]->type == FFI_TYPE_FLOAT
+       || cif->arg_types[0]->type == FFI_TYPE_DOUBLE))
+    mask |= 1;
+  if (cif->nargs >= 2 &&
+      (cif->arg_types[1]->type == FFI_TYPE_FLOAT
+       || cif->arg_types[1]->type == FFI_TYPE_DOUBLE))
+    mask |= 2;
+  if (cif->nargs >= 3 &&
+      (cif->arg_types[2]->type == FFI_TYPE_FLOAT
+       || cif->arg_types[2]->type == FFI_TYPE_DOUBLE))
+    mask |= 4;
+  if (cif->nargs >= 4 &&
+      (cif->arg_types[3]->type == FFI_TYPE_FLOAT
+       || cif->arg_types[3]->type == FFI_TYPE_DOUBLE))
+    mask |= 8;
+
+  /* 41 BB ----         mov         r11d,mask */
+  BYTES("\x41\xBB"); INT(mask);
+
+  /* 48 B8 --------     mov         rax, closure			*/
+  BYTES("\x48\xB8"); POINTER(closure);
+
+  /* 49 BA --------     mov         r10, ffi_closure_OUTER */
+  BYTES("\x49\xBA"); POINTER(ffi_closure_OUTER);
+
+  /* 41 FF E2           jmp         r10 */
+  BYTES("\x41\xFF\xE2");
+
+#else
+
+  /* mov ecx, closure */
+  BYTES("\xb9"); POINTER(closure);
+
+  /* mov edx, esp */
+  BYTES("\x8b\xd4");
+
+  /* call ffi_closure_SYSV */
+  BYTES("\xe8"); POINTER((char*)&ffi_closure_SYSV - (tramp + 4));
+
+  /* ret bytes */
+  BYTES("\xc2");
+  SHORT(bytes);
+  
+#endif
+
+  if (tramp - &closure->tramp[0] > FFI_TRAMPOLINE_SIZE)
+    Py_FatalError("FFI_TRAMPOLINE_SIZE too small in " __FILE__);
+
   closure->cif  = cif;
   closure->user_data = user_data;
   closure->fun  = fun;

Modified: python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.h
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.h	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffi.h	Fri Dec 15 05:21:50 2006
@@ -174,12 +174,10 @@
 
 /* ---- Definitions for the raw API -------------------------------------- */
 
-#ifndef FFI_SIZEOF_ARG
-# if LONG_MAX == 2147483647
-#  define FFI_SIZEOF_ARG        4
-# elif LONG_MAX == 9223372036854775807
-#  define FFI_SIZEOF_ARG        8
-# endif
+#ifdef _WIN64
+#define FFI_SIZEOF_ARG 8
+#else
+#define FFI_SIZEOF_ARG 4
 #endif
 
 typedef union {

Modified: python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffitarget.h
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffitarget.h	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/libffi_msvc/ffitarget.h	Fri Dec 15 05:21:50 2006
@@ -44,7 +44,9 @@
 
   /* ---- Intel x86 Win32 ---------- */
   FFI_SYSV,
+#ifndef _WIN64
   FFI_STDCALL,
+#endif
   /* TODO: Add fastcall support for the sake of completeness */
   FFI_DEFAULT_ABI = FFI_SYSV,
 
@@ -67,8 +69,8 @@
 
 #define FFI_CLOSURES 1
 
-#ifdef X86_64
-#define FFI_TRAMPOLINE_SIZE 24
+#ifdef _WIN64
+#define FFI_TRAMPOLINE_SIZE 29
 #define FFI_NATIVE_RAW_API 0
 #else
 #define FFI_TRAMPOLINE_SIZE 15

Modified: python/branches/p3yk-noslice/Modules/_ctypes/stgdict.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/stgdict.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/stgdict.c	Fri Dec 15 05:21:50 2006
@@ -173,11 +173,11 @@
 
 	for (i = 0; i < PySequence_Fast_GET_SIZE(fieldlist); ++i) {
 		PyObject *pair = PySequence_Fast_GET_ITEM(fieldlist, i); /* borrowed */
-		PyObject *fname, *ftype;
+		PyObject *fname, *ftype, *bits;
 		CFieldObject *fdescr;
 		CFieldObject *new_descr;
 		/* Convert to PyArg_UnpackTuple... */
-		if (!PyArg_ParseTuple(pair, "OO", &fname, &ftype)) {
+		if (!PyArg_ParseTuple(pair, "OO|O", &fname, &ftype, &bits)) {
 			Py_DECREF(fieldlist);
 			return -1;
 		}
@@ -335,14 +335,14 @@
 	stgdict = PyType_stgdict(type);
 	if (!stgdict)
 		return -1;
+	/* If this structure/union is already marked final we cannot assign
+	   _fields_ anymore. */
+
 	if (stgdict->flags & DICTFLAG_FINAL) {/* is final ? */
 		PyErr_SetString(PyExc_AttributeError,
 				"_fields_ is final");
 		return -1;
 	}
-	/* XXX This should probably be moved to a point when all this
-	   stuff is sucessfully finished. */
-	stgdict->flags |= DICTFLAG_FINAL;	/* set final */
 
 	if (stgdict->ffi_type_pointer.elements)
 		PyMem_Free(stgdict->ffi_type_pointer.elements);
@@ -476,5 +476,15 @@
 	stgdict->size = size;
 	stgdict->align = total_align;
 	stgdict->length = len;	/* ADD ffi_ofs? */
+
+	/* We did check that this flag was NOT set above, it must not
+	   have been set until now. */
+	if (stgdict->flags & DICTFLAG_FINAL) {
+		PyErr_SetString(PyExc_AttributeError,
+				"Structure or union cannot contain itself");
+		return -1;
+	}
+	stgdict->flags |= DICTFLAG_FINAL;
+
 	return MakeAnonFields(type);
 }

Modified: python/branches/p3yk-noslice/Modules/_cursesmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_cursesmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/_cursesmodule.c	Fri Dec 15 05:21:50 2006
@@ -2334,6 +2334,10 @@
 	}
 
 	result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9);
+	if (!result) {
+		PyErr_SetString(PyCursesError, "tparm() returned NULL");
+  		return NULL;
+	}
 
 	return PyString_FromString(result);
 }

Modified: python/branches/p3yk-noslice/Modules/_functoolsmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_functoolsmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/_functoolsmodule.c	Fri Dec 15 05:21:50 2006
@@ -242,12 +242,88 @@
 };
 
 
+/* reduce (used to be a builtin) ********************************************/
+
+static PyObject *
+functools_reduce(PyObject *self, PyObject *args)
+{
+	PyObject *seq, *func, *result = NULL, *it;
+
+	if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result))
+		return NULL;
+	if (result != NULL)
+		Py_INCREF(result);
+
+	it = PyObject_GetIter(seq);
+	if (it == NULL) {
+		PyErr_SetString(PyExc_TypeError,
+		    "reduce() arg 2 must support iteration");
+		Py_XDECREF(result);
+		return NULL;
+	}
+
+	if ((args = PyTuple_New(2)) == NULL)
+		goto Fail;
+
+	for (;;) {
+		PyObject *op2;
+
+		if (args->ob_refcnt > 1) {
+			Py_DECREF(args);
+			if ((args = PyTuple_New(2)) == NULL)
+				goto Fail;
+		}
+
+		op2 = PyIter_Next(it);
+		if (op2 == NULL) {
+			if (PyErr_Occurred())
+				goto Fail;
+ 			break;
+		}
+
+		if (result == NULL)
+			result = op2;
+		else {
+			PyTuple_SetItem(args, 0, result);
+			PyTuple_SetItem(args, 1, op2);
+			if ((result = PyEval_CallObject(func, args)) == NULL)
+				goto Fail;
+		}
+	}
+
+	Py_DECREF(args);
+
+	if (result == NULL)
+		PyErr_SetString(PyExc_TypeError,
+			   "reduce() of empty sequence with no initial value");
+
+	Py_DECREF(it);
+	return result;
+
+Fail:
+	Py_XDECREF(args);
+	Py_XDECREF(result);
+	Py_DECREF(it);
+	return NULL;
+}
+
+PyDoc_STRVAR(functools_reduce_doc,
+"reduce(function, sequence[, initial]) -> value\n\
+\n\
+Apply a function of two arguments cumulatively to the items of a sequence,\n\
+from left to right, so as to reduce the sequence to a single value.\n\
+For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n\
+((((1+2)+3)+4)+5).  If initial is present, it is placed before the items\n\
+of the sequence in the calculation, and serves as a default when the\n\
+sequence is empty.");
+
 /* module level code ********************************************************/
 
 PyDoc_STRVAR(module_doc,
 "Tools that operate on functions.");
 
 static PyMethodDef module_methods[] = {
+ 	{"reduce",	functools_reduce,     METH_VARARGS, functools_reduce_doc},
  	{NULL,		NULL}		/* sentinel */
 };
 

Modified: python/branches/p3yk-noslice/Modules/_sre.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_sre.c	(original)
+++ python/branches/p3yk-noslice/Modules/_sre.c	Fri Dec 15 05:21:50 2006
@@ -1166,9 +1166,10 @@
 
             /* install new repeat context */
             ctx->u.rep = (SRE_REPEAT*) PyObject_MALLOC(sizeof(*ctx->u.rep));
-            /* XXX(nnorwitz): anything else we need to do on error? */
-            if (!ctx->u.rep)
+            if (!ctx->u.rep) {
+                PyErr_NoMemory();
                 RETURN_FAILURE;
+            }
             ctx->u.rep->count = -1;
             ctx->u.rep->pattern = ctx->pattern;
             ctx->u.rep->prev = state->repeat;
@@ -1884,6 +1885,8 @@
     }
 
     TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
+    if (PyErr_Occurred())
+        return NULL;
 
     state_fini(&state);
 
@@ -1922,6 +1925,9 @@
 
     state_fini(&state);
 
+    if (PyErr_Occurred())
+        return NULL;
+
     return pattern_new_match(self, &state, status);
 }
 
@@ -2071,6 +2077,9 @@
 #endif
         }
 
+	if (PyErr_Occurred())
+	    goto error;
+
         if (status <= 0) {
             if (status == 0)
                 break;
@@ -2198,6 +2207,9 @@
 #endif
         }
 
+	if (PyErr_Occurred())
+	    goto error;
+
         if (status <= 0) {
             if (status == 0)
                 break;
@@ -2347,6 +2359,9 @@
 #endif
         }
 
+	if (PyErr_Occurred())
+	    goto error;
+
         if (status <= 0) {
             if (status == 0)
                 break;
@@ -3250,6 +3265,8 @@
         status = sre_umatch(state, PatternObject_GetCode(self->pattern));
 #endif
     }
+    if (PyErr_Occurred())
+        return NULL;
 
     match = pattern_new_match((PatternObject*) self->pattern,
                                state, status);
@@ -3281,6 +3298,8 @@
         status = sre_usearch(state, PatternObject_GetCode(self->pattern));
 #endif
     }
+    if (PyErr_Occurred())
+        return NULL;
 
     match = pattern_new_match((PatternObject*) self->pattern,
                                state, status);

Modified: python/branches/p3yk-noslice/Modules/_ssl.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ssl.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ssl.c	Fri Dec 15 05:21:50 2006
@@ -317,7 +317,7 @@
 
 	if (!PyArg_ParseTuple(args, "O!|zz:ssl",
 			      PySocketModule.Sock_Type,
-			      (PyObject*)&Sock,
+			      &Sock,
 			      &key_file, &cert_file))
 		return NULL;
 

Modified: python/branches/p3yk-noslice/Modules/_testcapimodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_testcapimodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/_testcapimodule.c	Fri Dec 15 05:21:50 2006
@@ -6,6 +6,8 @@
  */
 
 #include "Python.h"
+#include <float.h>
+#include "structmember.h"
 
 #ifdef WITH_THREAD
 #include "pythread.h"
@@ -35,13 +37,13 @@
    platforms have these hardcoded.  Better safe than sorry.
 */
 static PyObject*
-sizeof_error(const char* fatname, const char* typename,
+sizeof_error(const char* fatname, const char* typname,
         int expected, int got)
 {
 	char buf[1024];
 	PyOS_snprintf(buf, sizeof(buf),
 		"%.200s #define == %d but sizeof(%.200s) == %d",
-		fatname, expected, typename, got);
+		fatname, expected, typname, got);
 	PyErr_SetString(TestError, buf);
 	return (PyObject*)NULL;
 }
@@ -615,7 +617,7 @@
 {
 	PyObject *rc;
 	PyGILState_STATE s = PyGILState_Ensure();
-	rc = PyObject_CallFunction(callable, "");
+	rc = PyObject_CallFunction((PyObject *)callable, "");
 	Py_XDECREF(rc);
 	PyGILState_Release(s);
 }
@@ -665,6 +667,9 @@
 	PyThread_acquire_lock(thread_done, 1);  /* wait for thread to finish */
 	Py_END_ALLOW_THREADS
 
+	/* Release lock we acquired above.  This is required on HP-UX. */
+	PyThread_release_lock(thread_done);
+
 	PyThread_free_lock(thread_done);
 	Py_RETURN_NONE;
 }
@@ -756,6 +761,105 @@
 
 #define AddSym(d, n, f, v) {PyObject *o = f(v); PyDict_SetItemString(d, n, o); Py_DECREF(o);}
 
+typedef struct {
+	char byte_member;
+	unsigned char ubyte_member;
+	short short_member;
+	unsigned short ushort_member;
+	int int_member;
+	unsigned int uint_member;
+	long long_member;
+	unsigned long ulong_member;
+	float float_member;
+	double double_member;
+} all_structmembers;
+
+typedef struct {
+    PyObject_HEAD
+	all_structmembers structmembers;
+} test_structmembers;
+
+static struct PyMemberDef test_members[] = {
+	{"T_BYTE", T_BYTE, offsetof(test_structmembers, structmembers.byte_member), 0, NULL},
+	{"T_UBYTE", T_UBYTE, offsetof(test_structmembers, structmembers.ubyte_member), 0, NULL},
+	{"T_SHORT", T_SHORT, offsetof(test_structmembers, structmembers.short_member), 0, NULL},
+	{"T_USHORT", T_USHORT, offsetof(test_structmembers, structmembers.ushort_member), 0, NULL},
+	{"T_INT", T_INT, offsetof(test_structmembers, structmembers.int_member), 0, NULL},
+	{"T_UINT", T_UINT, offsetof(test_structmembers, structmembers.uint_member), 0, NULL},
+	{"T_LONG", T_LONG, offsetof(test_structmembers, structmembers.long_member), 0, NULL},
+	{"T_ULONG", T_ULONG, offsetof(test_structmembers, structmembers.ulong_member), 0, NULL},
+	{"T_FLOAT", T_FLOAT, offsetof(test_structmembers, structmembers.float_member), 0, NULL},
+	{"T_DOUBLE", T_DOUBLE, offsetof(test_structmembers, structmembers.double_member), 0, NULL},
+	{NULL}
+};
+
+
+static PyObject *test_structmembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs){
+	static char *keywords[]={"T_BYTE", "T_UBYTE", "T_SHORT", "T_USHORT", "T_INT", "T_UINT",
+		"T_LONG", "T_ULONG", "T_FLOAT", "T_DOUBLE", NULL};
+	test_structmembers *ob=PyObject_New(test_structmembers, type);
+	if (ob==NULL)
+		return NULL;
+	memset(&ob->structmembers, 0, sizeof(all_structmembers));
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|bBhHiIlkfd", keywords,
+		&ob->structmembers.byte_member, &ob->structmembers.ubyte_member,
+		&ob->structmembers.short_member, &ob->structmembers.ushort_member,
+		&ob->structmembers.int_member, &ob->structmembers.uint_member, 
+		&ob->structmembers.long_member, &ob->structmembers.ulong_member,
+		&ob->structmembers.float_member, &ob->structmembers.double_member)){
+		Py_DECREF(ob);
+		return NULL;
+		}
+	return (PyObject *)ob;
+}
+
+static void test_structmembers_free(PyObject *ob){
+	PyObject_FREE(ob);
+}
+
+static PyTypeObject test_structmembersType = {
+    PyObject_HEAD_INIT(NULL)
+    0,
+	"test_structmembersType",
+	sizeof(test_structmembers),	/* tp_basicsize */
+	0,				/* tp_itemsize */
+	test_structmembers_free,	/* destructor 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,
+	PyObject_GenericSetAttr,
+	0,				/* tp_as_buffer */
+	0,				/* tp_flags */
+	"Type containing all structmember types",
+	0,				/* traverseproc tp_traverse */
+	0,				/* tp_clear */
+	0,				/* tp_richcompare */
+	0,				/* tp_weaklistoffset */
+	0,				/* tp_iter */
+	0,				/* tp_iternext */
+	0,				/* tp_methods */
+	test_members,	/* tp_members */
+	0,
+	0,
+	0,
+	0,
+	0,
+	0,
+	0,
+	0,
+	test_structmembers_new,			/* tp_new */
+};
+
+
 PyMODINIT_FUNC
 init_testcapi(void)
 {
@@ -765,16 +869,28 @@
 	if (m == NULL)
 		return;
 
+	test_structmembersType.ob_type=&PyType_Type;
+	Py_INCREF(&test_structmembersType);
+	PyModule_AddObject(m, "test_structmembersType", (PyObject *)&test_structmembersType);
+
+	PyModule_AddObject(m, "CHAR_MAX", PyInt_FromLong(CHAR_MAX));
+	PyModule_AddObject(m, "CHAR_MIN", PyInt_FromLong(CHAR_MIN));
 	PyModule_AddObject(m, "UCHAR_MAX", PyInt_FromLong(UCHAR_MAX));
+	PyModule_AddObject(m, "SHRT_MAX", PyInt_FromLong(SHRT_MAX));
+	PyModule_AddObject(m, "SHRT_MIN", PyInt_FromLong(SHRT_MIN));
 	PyModule_AddObject(m, "USHRT_MAX", PyInt_FromLong(USHRT_MAX));
+	PyModule_AddObject(m, "INT_MAX",  PyLong_FromLong(INT_MAX));
+	PyModule_AddObject(m, "INT_MIN",  PyLong_FromLong(INT_MIN));
 	PyModule_AddObject(m, "UINT_MAX",  PyLong_FromUnsignedLong(UINT_MAX));
-	PyModule_AddObject(m, "ULONG_MAX", PyLong_FromUnsignedLong(ULONG_MAX));
-	PyModule_AddObject(m, "INT_MIN", PyInt_FromLong(INT_MIN));
-	PyModule_AddObject(m, "LONG_MIN", PyInt_FromLong(LONG_MIN));
-	PyModule_AddObject(m, "PY_SSIZE_T_MIN", PyInt_FromSsize_t(PY_SSIZE_T_MIN));
-	PyModule_AddObject(m, "INT_MAX", PyInt_FromLong(INT_MAX));
 	PyModule_AddObject(m, "LONG_MAX", PyInt_FromLong(LONG_MAX));
+	PyModule_AddObject(m, "LONG_MIN", PyInt_FromLong(LONG_MIN));
+	PyModule_AddObject(m, "ULONG_MAX", PyLong_FromUnsignedLong(ULONG_MAX));
+	PyModule_AddObject(m, "FLT_MAX", PyFloat_FromDouble(FLT_MAX));
+	PyModule_AddObject(m, "FLT_MIN", PyFloat_FromDouble(FLT_MIN));
+	PyModule_AddObject(m, "DBL_MAX", PyFloat_FromDouble(DBL_MAX));
+	PyModule_AddObject(m, "DBL_MIN", PyFloat_FromDouble(DBL_MIN));
 	PyModule_AddObject(m, "PY_SSIZE_T_MAX", PyInt_FromSsize_t(PY_SSIZE_T_MAX));
+	PyModule_AddObject(m, "PY_SSIZE_T_MIN", PyInt_FromSsize_t(PY_SSIZE_T_MIN));
 
 	TestError = PyErr_NewException("_testcapi.error", NULL, NULL);
 	Py_INCREF(TestError);

Modified: python/branches/p3yk-noslice/Modules/almodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/almodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/almodule.c	Fri Dec 15 05:21:50 2006
@@ -1686,7 +1686,7 @@
 {
 	int res, param;
 	ALparamInfo pinfo;
-	PyObject *v, *item;;
+	PyObject *v, *item;
 
 	if (!PyArg_ParseTuple(args, "ii:GetParamInfo", &res, &param))
 		return NULL;

Modified: python/branches/p3yk-noslice/Modules/arraymodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/arraymodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/arraymodule.c	Fri Dec 15 05:21:50 2006
@@ -1495,7 +1495,7 @@
 	 copy_doc},
 	{"count",	(PyCFunction)array_count,	METH_O,
 	 count_doc},
-	{"__deepcopy__",(PyCFunction)array_copy,	METH_NOARGS,
+	{"__deepcopy__",(PyCFunction)array_copy,	METH_O,
 	 copy_doc},
 	{"extend",      (PyCFunction)array_extend,	METH_O,
 	 extend_doc},

Modified: python/branches/p3yk-noslice/Modules/audioop.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/audioop.c	(original)
+++ python/branches/p3yk-noslice/Modules/audioop.c	Fri Dec 15 05:21:50 2006
@@ -472,8 +472,12 @@
         double aj_m1, aj_lm1;
         double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor;
 
+	/* Passing a short** for an 's' argument is correct only
+	   if the string contents is aligned for interpretation
+	   as short[]. Due to the definition of PyStringObject,
+	   this is currently (Python 2.6) the case. */
         if ( !PyArg_ParseTuple(args, "s#s#:findfit",
-	                       &cp1, &len1, &cp2, &len2) )
+	                       (char**)&cp1, &len1, (char**)&cp2, &len2) )
                 return 0;
         if ( len1 & 1 || len2 & 1 ) {
                 PyErr_SetString(AudioopError, "Strings should be even-sized");
@@ -530,7 +534,7 @@
         double sum_ri_2, sum_aij_ri, result;
 
         if ( !PyArg_ParseTuple(args, "s#s#:findfactor",
-	                       &cp1, &len1, &cp2, &len2) )
+	                       (char**)&cp1, &len1, (char**)&cp2, &len2) )
                 return 0;
         if ( len1 & 1 || len2 & 1 ) {
                 PyErr_SetString(AudioopError, "Strings should be even-sized");
@@ -562,7 +566,8 @@
         double aj_m1, aj_lm1;
         double result, best_result;
 
-        if ( !PyArg_ParseTuple(args, "s#i:findmax", &cp1, &len1, &len2) )
+        if ( !PyArg_ParseTuple(args, "s#i:findmax", 
+			       (char**)&cp1, &len1, &len2) )
                 return 0;
         if ( len1 & 1 ) {
                 PyErr_SetString(AudioopError, "Strings should be even-sized");

Modified: python/branches/p3yk-noslice/Modules/binascii.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/binascii.c	(original)
+++ python/branches/p3yk-noslice/Modules/binascii.c	Fri Dec 15 05:21:50 2006
@@ -1057,8 +1057,7 @@
 			in++;
 			if (in >= datalen) break;
 			/* Soft line breaks */
-			if ((data[in] == '\n') || (data[in] == '\r') ||
-			    (data[in] == ' ') || (data[in] == '\t')) {
+			if ((data[in] == '\n') || (data[in] == '\r')) {
 				if (data[in] != '\n') {
 					while (in < datalen && data[in] != '\n') in++;
 				}

Modified: python/branches/p3yk-noslice/Modules/bz2module.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/bz2module.c	(original)
+++ python/branches/p3yk-noslice/Modules/bz2module.c	Fri Dec 15 05:21:50 2006
@@ -1016,12 +1016,12 @@
 		case MODE_CLOSED:
 			PyErr_SetString(PyExc_ValueError,
 					"I/O operation on closed file");
-			goto cleanup;;
+			goto cleanup;
 
 		default:
 			PyErr_SetString(PyExc_IOError,
 					"seek works only while reading");
-			goto cleanup;;
+			goto cleanup;
 	}
 
 	if (where == 2) {

Modified: python/branches/p3yk-noslice/Modules/cPickle.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/cPickle.c	(original)
+++ python/branches/p3yk-noslice/Modules/cPickle.c	Fri Dec 15 05:21:50 2006
@@ -1024,7 +1024,7 @@
 static int
 save_long(Picklerobject *self, PyObject *args)
 {
-	int size;
+	Py_ssize_t size;
 	int res = -1;
 	PyObject *repr = NULL;
 
@@ -1066,7 +1066,7 @@
 		 * byte at the start, and cut it back later if possible.
 		 */
 		nbytes = (nbits >> 3) + 1;
-		if ((int)nbytes < 0 || (size_t)(int)nbytes != nbytes) {
+		if (nbytes > INT_MAX) {
 			PyErr_SetString(PyExc_OverflowError, "long too large "
 				"to pickle");
 			goto finally;
@@ -1208,12 +1208,14 @@
 			c_str[1] = size;
 			len = 2;
 		}
-		else {
+		else if (size <= INT_MAX) {
 			c_str[0] = BINSTRING;
 			for (i = 1; i < 5; i++)
 				c_str[i] = (int)(size >> ((i - 1) * 8));
 			len = 5;
 		}
+		else
+			return -1;    /* string too large */
 
 		if (self->write_func(self, c_str, len) < 0)
 			return -1;
@@ -1286,7 +1288,7 @@
 static int
 save_unicode(Picklerobject *self, PyObject *args, int doput)
 {
-	int size, len;
+	Py_ssize_t size, len;
 	PyObject *repr=0;
 
 	if (!PyUnicode_Check(args))
@@ -1325,6 +1327,8 @@
 
 		if ((size = PyString_Size(repr)) < 0)
 			goto err;
+		if (size > INT_MAX)
+			return -1;   /* string too large */
 
 		c_str[0] = BINUNICODE;
 		for (i = 1; i < 5; i++)

Modified: python/branches/p3yk-noslice/Modules/cStringIO.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/cStringIO.c	(original)
+++ python/branches/p3yk-noslice/Modules/cStringIO.c	Fri Dec 15 05:21:50 2006
@@ -289,7 +289,17 @@
 	
         if (!IO__opencheck(self)) return NULL;
         if (!PyArg_ParseTuple(args, "|n:truncate", &pos)) return NULL;
-        if (pos < 0) pos = self->pos;
+
+	if (PyTuple_Size(args) == 0) {
+		/* No argument passed, truncate to current position */
+		pos = self->pos;
+	}
+
+        if (pos < 0) {
+		errno = EINVAL;
+		PyErr_SetFromErrno(PyExc_IOError);
+		return NULL;
+	}
 
         if (self->string_size > pos) self->string_size = pos;
         self->pos = self->string_size;
@@ -657,11 +667,9 @@
   char *buf;
   Py_ssize_t size;
 
-  if (PyObject_AsReadBuffer(s, (const void **)&buf, &size)) {
-      PyErr_Format(PyExc_TypeError, "expected read buffer, %.200s found",
-		   s->ob_type->tp_name);
+  if (PyObject_AsCharBuffer(s, (const char **)&buf, &size) != 0)
       return NULL;
-  }
+
   self = PyObject_New(Iobject, &Itype);
   if (!self) return NULL;
   Py_INCREF(s);

Modified: python/branches/p3yk-noslice/Modules/cgen.py
==============================================================================
--- python/branches/p3yk-noslice/Modules/cgen.py	(original)
+++ python/branches/p3yk-noslice/Modules/cgen.py	Fri Dec 15 05:21:50 2006
@@ -148,7 +148,7 @@
     #       N*argN
     #       N*retval
     #
-    if rest[:1] <> '[' or rest[-1:] <> ']':
+    if rest[:1] != '[' or rest[-1:] != ']':
         raise arg_error, ('subscript expected', rest)
     sub = rest[1:-1]
     #
@@ -167,9 +167,9 @@
             raise arg_error, ('\'*\' expected', sub)
     if sub == 'retval':
         # size is retval -- must be a reply argument
-        if mode <> 'r':
+        if mode != 'r':
             raise arg_error, ('non-r mode with [retval]', mode)
-    elif not isnum(sub) and (sub[:3] <> 'arg' or not isnum(sub[3:])):
+    elif not isnum(sub) and (sub[:3] != 'arg' or not isnum(sub[3:])):
         raise arg_error, ('bad subscript', sub)
     #
     return type, mode, num, sub
@@ -218,7 +218,7 @@
     #
     # Declare return value if any
     #
-    if type <> 'void':
+    if type != 'void':
         print '\t' + type, 'retval;'
     #
     # Declare arguments
@@ -283,7 +283,7 @@
             print '(!geti' + xtype + 'arraysize(args,',
             print repr(n_in_args) + ',',
             print repr(in_pos[j]) + ',',
-            if xtype <> a_type:
+            if xtype != a_type:
                 print '('+xtype+' *)',
             print '&arg' + repr(i+1) + '))'
             print '\t\treturn NULL;'
@@ -311,21 +311,21 @@
                 if a_factor and a_sub: print '*',
                 if a_sub: print a_sub,
                 print ',',
-                if (a_sub and a_factor) or xtype <> a_type:
+                if (a_sub and a_factor) or xtype != a_type:
                     print '('+xtype+' *)',
                 print 'arg' + repr(i+1) + '))'
             else: # Get a simple variable
                 print '(!geti' + xtype + 'arg(args,',
                 print repr(n_in_args) + ',',
                 print repr(in_pos[i]) + ',',
-                if xtype <> a_type:
+                if xtype != a_type:
                     print '('+xtype+' *)',
                 print '&arg' + repr(i+1) + '))'
             print '\t\treturn NULL;'
     #
     # Begin of function call
     #
-    if type <> 'void':
+    if type != 'void':
         print '\tretval =', func + '(',
     else:
         print '\t' + func + '(',
@@ -356,7 +356,7 @@
         #
         # Multiple return values -- construct a tuple
         #
-        if type <> 'void':
+        if type != 'void':
             n_out_args = n_out_args + 1
         if n_out_args == 1:
             for i in range(len(database)):
@@ -372,7 +372,7 @@
             print n_out_args, ');'
             print '\t  if (v == NULL) return NULL;'
             i_out = 0
-            if type <> 'void':
+            if type != 'void':
                 print '\t  PyTuple_SetItem(v,',
                 print repr(i_out) + ',',
                 print mkobject(type, 'retval') + ');'
@@ -489,7 +489,7 @@
     elif len(words) < 2:
         err('Line', lno, ': no funcname :', line)
     else:
-        if len(words) % 2 <> 0:
+        if len(words) % 2 != 0:
             err('Line', lno, ': odd argument list :', words[2:])
         else:
             database = []

Modified: python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_cn.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_cn.c	(original)
+++ python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_cn.c	Fri Dec 15 05:21:50 2006
@@ -15,14 +15,26 @@
 #undef hz
 #endif
 
-#define GBK_PREDECODE(dc1, dc2, assi) \
+/* GBK and GB2312 map differently in few codepoints that are listed below:
+ *
+ *		gb2312				gbk
+ * A1A4		U+30FB KATAKANA MIDDLE DOT	U+00B7 MIDDLE DOT
+ * A1AA		U+2015 HORIZONTAL BAR		U+2014 EM DASH
+ * A844		undefined			U+2015 HORIZONTAL BAR
+ */
+
+#define GBK_DECODE(dc1, dc2, assi) \
 	if ((dc1) == 0xa1 && (dc2) == 0xaa) (assi) = 0x2014; \
 	else if ((dc1) == 0xa8 && (dc2) == 0x44) (assi) = 0x2015; \
-	else if ((dc1) == 0xa1 && (dc2) == 0xa4) (assi) = 0x00b7;
-#define GBK_PREENCODE(code, assi) \
+	else if ((dc1) == 0xa1 && (dc2) == 0xa4) (assi) = 0x00b7; \
+	else TRYMAP_DEC(gb2312, assi, dc1 ^ 0x80, dc2 ^ 0x80); \
+	else TRYMAP_DEC(gbkext, assi, dc1, dc2);
+
+#define GBK_ENCODE(code, assi) \
 	if ((code) == 0x2014) (assi) = 0xa1aa; \
 	else if ((code) == 0x2015) (assi) = 0xa844; \
-	else if ((code) == 0x00b7) (assi) = 0xa1a4;
+	else if ((code) == 0x00b7) (assi) = 0xa1a4; \
+	else if ((code) != 0x30fb && TRYMAP_ENC_COND(gbcommon, assi, code));
 
 /*
  * GB2312 codec
@@ -99,8 +111,7 @@
 
 		REQUIRE_OUTBUF(2)
 
-		GBK_PREENCODE(c, code)
-		else TRYMAP_ENC(gbcommon, code, c);
+		GBK_ENCODE(c, code)
 		else return 1;
 
 		OUT1((code >> 8) | 0x80)
@@ -129,9 +140,7 @@
 
 		REQUIRE_INBUF(2)
 
-		GBK_PREDECODE(c, IN2, **outbuf)
-		else TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, IN2 ^ 0x80);
-		else TRYMAP_DEC(gbkext, **outbuf, c, IN2);
+		GBK_DECODE(c, IN2, **outbuf)
 		else return 2;
 
 		NEXT(2, 1)
@@ -187,9 +196,7 @@
 
 		REQUIRE_OUTBUF(2)
 
-		GBK_PREENCODE(c, code)
-		else TRYMAP_ENC(gbcommon, code, c);
-		else TRYMAP_ENC(gb18030ext, code, c);
+		GBK_ENCODE(c, code)
 		else {
 			const struct _gb18030_to_unibmp_ranges *utrrange;
 
@@ -287,9 +294,7 @@
 			return 4;
 		}
 
-		GBK_PREDECODE(c, c2, **outbuf)
-		else TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, c2 ^ 0x80);
-		else TRYMAP_DEC(gbkext, **outbuf, c, c2);
+		GBK_DECODE(c, c2, **outbuf)
 		else TRYMAP_DEC(gb18030ext, **outbuf, c, c2);
 		else return 2;
 

Modified: python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_iso2022.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_iso2022.c	(original)
+++ python/branches/p3yk-noslice/Modules/cjkcodecs/_codecs_iso2022.c	Fri Dec 15 05:21:50 2006
@@ -592,9 +592,11 @@
 {
 	DBCHAR coded;
 	assert(*length == 1);
-	TRYMAP_ENC(cp949, coded, *data)
-		if (!(coded & 0x8000))
-			return coded;
+	if (*data < 0x10000) {
+		TRYMAP_ENC(cp949, coded, *data)
+			if (!(coded & 0x8000))
+				return coded;
+	}
 	return MAP_UNMAPPABLE;
 }
 
@@ -628,11 +630,13 @@
 {
 	DBCHAR coded;
 	assert(*length == 1);
-	if (*data == 0xff3c) /* F/W REVERSE SOLIDUS */
-		return 0x2140;
-	else TRYMAP_ENC(jisxcommon, coded, *data) {
-		if (!(coded & 0x8000))
-			return coded;
+	if (*data < 0x10000) {
+		if (*data == 0xff3c) /* F/W REVERSE SOLIDUS */
+			return 0x2140;
+		else TRYMAP_ENC(jisxcommon, coded, *data) {
+			if (!(coded & 0x8000))
+				return coded;
+		}
 	}
 	return MAP_UNMAPPABLE;
 }
@@ -665,9 +669,11 @@
 {
 	DBCHAR coded;
 	assert(*length == 1);
-	TRYMAP_ENC(jisxcommon, coded, *data) {
-		if (coded & 0x8000)
-			return coded & 0x7fff;
+	if (*data < 0x10000) {
+		TRYMAP_ENC(jisxcommon, coded, *data) {
+			if (coded & 0x8000)
+				return coded & 0x7fff;
+		}
 	}
 	return MAP_UNMAPPABLE;
 }
@@ -854,7 +860,7 @@
 	if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
 		return coded;
 	else if (coded & 0x8000)
-		return coded;
+		return coded & 0x7fff;
 	else
 		return MAP_UNMAPPABLE;
 }
@@ -901,7 +907,7 @@
 	if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
 		return coded;
 	else if (coded & 0x8000)
-		return coded;
+		return coded & 0x7fff;
 	else
 		return MAP_UNMAPPABLE;
 }
@@ -970,9 +976,11 @@
 {
 	DBCHAR coded;
 	assert(*length == 1);
-	TRYMAP_ENC(gbcommon, coded, *data) {
-		if (!(coded & 0x8000))
-			return coded;
+	if (*data < 0x10000) {
+		TRYMAP_ENC(gbcommon, coded, *data) {
+			if (!(coded & 0x8000))
+				return coded;
+		}
 	}
 	return MAP_UNMAPPABLE;
 }
@@ -992,7 +1000,10 @@
 
 /*-*- registry tables -*-*/
 
-#define REGISTRY_KSX1001	{ CHARSET_KSX1001, 1, 2,		\
+#define REGISTRY_KSX1001_G0	{ CHARSET_KSX1001, 0, 2,		\
+				  ksx1001_init,				\
+				  ksx1001_decoder, ksx1001_encoder }
+#define REGISTRY_KSX1001_G1	{ CHARSET_KSX1001, 1, 2,		\
 				  ksx1001_init,				\
 				  ksx1001_decoder, ksx1001_encoder }
 #define REGISTRY_JISX0201_R	{ CHARSET_JISX0201_R, 0, 1,		\
@@ -1034,7 +1045,7 @@
 				  jisx0213_init,			\
 				  jisx0213_2004_2_decoder,		\
 				  jisx0213_2004_2_encoder }
-#define REGISTRY_GB2312		{ CHARSET_GB2312, 1, 2,			\
+#define REGISTRY_GB2312		{ CHARSET_GB2312, 0, 2,			\
 				  gb2312_init,				\
 				  gb2312_decoder, gb2312_encoder }
 #define REGISTRY_CNS11643_1	{ CHARSET_CNS11643_1, 1, 2,		\
@@ -1054,7 +1065,7 @@
 	};
 
 static const struct iso2022_designation iso2022_kr_designations[] = {
-	REGISTRY_KSX1001, REGISTRY_SENTINEL
+	REGISTRY_KSX1001_G1, REGISTRY_SENTINEL
 };
 CONFIGDEF(kr, 0)
 
@@ -1071,7 +1082,7 @@
 CONFIGDEF(jp_1, NO_SHIFT | USE_JISX0208_EXT)
 
 static const struct iso2022_designation iso2022_jp_2_designations[] = {
-	REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_KSX1001,
+	REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_KSX1001_G0,
 	REGISTRY_GB2312, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
 	REGISTRY_ISO8859_1, REGISTRY_ISO8859_7, REGISTRY_SENTINEL
 };

Modified: python/branches/p3yk-noslice/Modules/cjkcodecs/cjkcodecs.h
==============================================================================
--- python/branches/p3yk-noslice/Modules/cjkcodecs/cjkcodecs.h	(original)
+++ python/branches/p3yk-noslice/Modules/cjkcodecs/cjkcodecs.h	Fri Dec 15 05:21:50 2006
@@ -159,29 +159,32 @@
 #endif
 
 #define _TRYMAP_ENC(m, assi, val)				\
-	if ((m)->map != NULL && (val) >= (m)->bottom &&		\
+	((m)->map != NULL && (val) >= (m)->bottom &&		\
 	    (val)<= (m)->top && ((assi) = (m)->map[(val) -	\
 	    (m)->bottom]) != NOCHAR)
-#define TRYMAP_ENC(charset, assi, uni)				\
+#define TRYMAP_ENC_COND(charset, assi, uni)			\
 	_TRYMAP_ENC(&charset##_encmap[(uni) >> 8], assi, (uni) & 0xff)
+#define TRYMAP_ENC(charset, assi, uni)				\
+	if TRYMAP_ENC_COND(charset, assi, uni)
+
 #define _TRYMAP_DEC(m, assi, val)				\
-	if ((m)->map != NULL && (val) >= (m)->bottom &&		\
+	((m)->map != NULL && (val) >= (m)->bottom &&		\
 	    (val)<= (m)->top && ((assi) = (m)->map[(val) -	\
 	    (m)->bottom]) != UNIINV)
 #define TRYMAP_DEC(charset, assi, c1, c2)			\
-	_TRYMAP_DEC(&charset##_decmap[c1], assi, c2)
+	if _TRYMAP_DEC(&charset##_decmap[c1], assi, c2)
 
 #define _TRYMAP_ENC_MPLANE(m, assplane, asshi, asslo, val)	\
-	if ((m)->map != NULL && (val) >= (m)->bottom &&		\
+	((m)->map != NULL && (val) >= (m)->bottom &&		\
 	    (val)<= (m)->top &&					\
 	    ((assplane) = (m)->map[((val) - (m)->bottom)*3]) != 0 && \
 	    (((asshi) = (m)->map[((val) - (m)->bottom)*3 + 1]), 1) && \
 	    (((asslo) = (m)->map[((val) - (m)->bottom)*3 + 2]), 1))
 #define TRYMAP_ENC_MPLANE(charset, assplane, asshi, asslo, uni)	\
-	_TRYMAP_ENC_MPLANE(&charset##_encmap[(uni) >> 8], \
+	if _TRYMAP_ENC_MPLANE(&charset##_encmap[(uni) >> 8], \
 			   assplane, asshi, asslo, (uni) & 0xff)
 #define TRYMAP_DEC_MPLANE(charset, assi, plane, c1, c2)		\
-	_TRYMAP_DEC(&charset##_decmap[plane][c1], assi, c2)
+	if _TRYMAP_DEC(&charset##_decmap[plane][c1], assi, c2)
 
 #if Py_UNICODE_SIZE == 2
 #define DECODE_SURROGATE(c)					\

Modified: python/branches/p3yk-noslice/Modules/datetimemodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/datetimemodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/datetimemodule.c	Fri Dec 15 05:21:50 2006
@@ -1149,9 +1149,9 @@
 
 	PyObject *newfmt = NULL;	/* py string, the output format */
 	char *pnew;	/* pointer to available byte in output format */
-	char totalnew;	/* number bytes total in output format buffer,
+	int totalnew;	/* number bytes total in output format buffer,
 			   exclusive of trailing \0 */
-	char usednew;	/* number bytes used so far in output format buffer */
+	int usednew;	/* number bytes used so far in output format buffer */
 
 	char *ptoappend; /* pointer to string to append to output buffer */
 	int ntoappend;	/* # of bytes to append to output buffer */
@@ -1387,7 +1387,7 @@
  * Miscellaneous helpers.
  */
 
-/* For obscure reasons, we need to use tp_richcompare instead of tp_compare.
+/* For various reasons, we need to use tp_richcompare instead of tp_compare.
  * The comparisons here all most naturally compute a cmp()-like result.
  * This little helper turns that into a bool result for rich comparisons.
  */
@@ -1705,31 +1705,23 @@
 	return result;
 }
 
-/* This is more natural as a tp_compare, but doesn't work then:  for whatever
- * reason, Python's try_3way_compare ignores tp_compare unless
- * PyInstance_Check returns true, but these aren't old-style classes.
- */
 static PyObject *
-delta_richcompare(PyDateTime_Delta *self, PyObject *other, int op)
+delta_richcompare(PyObject *self, PyObject *other, int op)
 {
-	int diff = 42;	/* nonsense */
-
 	if (PyDelta_Check(other)) {
-		diff = GET_TD_DAYS(self) - GET_TD_DAYS(other);
+		int diff = GET_TD_DAYS(self) - GET_TD_DAYS(other);
 		if (diff == 0) {
 			diff = GET_TD_SECONDS(self) - GET_TD_SECONDS(other);
 			if (diff == 0)
 				diff = GET_TD_MICROSECONDS(self) -
 				       GET_TD_MICROSECONDS(other);
 		}
+		return diff_to_bool(diff, op);
+	}
+	else {
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
 	}
-	else if (op == Py_EQ || op == Py_NE)
-		diff = 1;	/* any non-zero value will do */
-
-	else /* stop this from falling back to address comparison */
-		return cmperror((PyObject *)self, other);
-
-	return diff_to_bool(diff, op);
 }
 
 static PyObject *delta_getstate(PyDateTime_Delta *self);
@@ -1966,7 +1958,7 @@
 }
 
 static int
-delta_nonzero(PyDateTime_Delta *self)
+delta_bool(PyDateTime_Delta *self)
 {
 	return (GET_TD_DAYS(self) != 0
 		|| GET_TD_SECONDS(self) != 0
@@ -2091,7 +2083,7 @@
 	(unaryfunc)delta_negative,		/* nb_negative */
 	(unaryfunc)delta_positive,		/* nb_positive */
 	(unaryfunc)delta_abs,			/* nb_absolute */
-	(inquiry)delta_nonzero,			/* nb_nonzero */
+	(inquiry)delta_bool,			/* nb_bool */
 	0,					/*nb_invert*/
 	0,					/*nb_lshift*/
 	0,					/*nb_rshift*/
@@ -2145,7 +2137,7 @@
 	delta_doc,					/* tp_doc */
 	0,						/* tp_traverse */
 	0,						/* tp_clear */
-	(richcmpfunc)delta_richcompare,			/* tp_richcompare */
+	delta_richcompare,				/* tp_richcompare */
 	0,						/* tp_weaklistoffset */
 	0,						/* tp_iter */
 	0,						/* tp_iternext */
@@ -2499,31 +2491,19 @@
 
 /* Miscellaneous methods. */
 
-/* This is more natural as a tp_compare, but doesn't work then:  for whatever
- * reason, Python's try_3way_compare ignores tp_compare unless
- * PyInstance_Check returns true, but these aren't old-style classes.
- */
 static PyObject *
-date_richcompare(PyDateTime_Date *self, PyObject *other, int op)
+date_richcompare(PyObject *self, PyObject *other, int op)
 {
-	int diff = 42;	/* nonsense */
-
-	if (PyDate_Check(other))
-		diff = memcmp(self->data, ((PyDateTime_Date *)other)->data,
-			      _PyDateTime_DATE_DATASIZE);
-
-	else if (PyObject_HasAttrString(other, "timetuple")) {
-		/* A hook for other kinds of date objects. */
+	if (PyDate_Check(other)) {
+		int diff = memcmp(((PyDateTime_Date *)self)->data,
+				  ((PyDateTime_Date *)other)->data,
+				  _PyDateTime_DATE_DATASIZE);
+		return diff_to_bool(diff, op);
+	}
+	else {
 		Py_INCREF(Py_NotImplemented);
 		return Py_NotImplemented;
 	}
-	else if (op == Py_EQ || op == Py_NE)
-		diff = 1;	/* any non-zero value will do */
-
-	else /* stop this from falling back to address comparison */
-		return cmperror((PyObject *)self, other);
-
-	return diff_to_bool(diff, op);
 }
 
 static PyObject *
@@ -2673,7 +2653,7 @@
 	0,						/* nb_negative */
 	0,						/* nb_positive */
 	0,						/* nb_absolute */
-	0,						/* nb_nonzero */
+	0,						/* nb_bool */
 };
 
 static PyTypeObject PyDateTime_DateType = {
@@ -2701,7 +2681,7 @@
 	date_doc,					/* tp_doc */
 	0,						/* tp_traverse */
 	0,						/* tp_clear */
-	(richcmpfunc)date_richcompare,			/* tp_richcompare */
+	date_richcompare,				/* tp_richcompare */
 	0,						/* tp_weaklistoffset */
 	0,						/* tp_iter */
 	0,						/* tp_iternext */
@@ -3223,28 +3203,19 @@
  * Miscellaneous methods.
  */
 
-/* This is more natural as a tp_compare, but doesn't work then:  for whatever
- * reason, Python's try_3way_compare ignores tp_compare unless
- * PyInstance_Check returns true, but these aren't old-style classes.
- */
 static PyObject *
-time_richcompare(PyDateTime_Time *self, PyObject *other, int op)
+time_richcompare(PyObject *self, PyObject *other, int op)
 {
 	int diff;
 	naivety n1, n2;
 	int offset1, offset2;
 
 	if (! PyTime_Check(other)) {
-		if (op == Py_EQ || op == Py_NE) {
-			PyObject *result = op == Py_EQ ? Py_False : Py_True;
-			Py_INCREF(result);
-			return result;
-		}
-		/* Stop this from falling back to address comparison. */
-		return cmperror((PyObject *)self, other);
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
 	}
-	if (classify_two_utcoffsets((PyObject *)self, &offset1, &n1, Py_None,
-				     other, &offset2, &n2, Py_None) < 0)
+	if (classify_two_utcoffsets(self, &offset1, &n1, Py_None,
+				    other, &offset2, &n2, Py_None) < 0)
 		return NULL;
 	assert(n1 != OFFSET_UNKNOWN && n2 != OFFSET_UNKNOWN);
 	/* If they're both naive, or both aware and have the same offsets,
@@ -3252,7 +3223,8 @@
 	 * offset2 == 0 at this point.
 	 */
 	if (n1 == n2 && offset1 == offset2) {
-		diff = memcmp(self->data, ((PyDateTime_Time *)other)->data,
+		diff = memcmp(((PyDateTime_Time *)self)->data,
+			      ((PyDateTime_Time *)other)->data,
 			      _PyDateTime_TIME_DATASIZE);
 		return diff_to_bool(diff, op);
 	}
@@ -3352,7 +3324,7 @@
 }
 
 static int
-time_nonzero(PyDateTime_Time *self)
+time_bool(PyDateTime_Time *self)
 {
 	int offset;
 	int none;
@@ -3446,7 +3418,7 @@
 	0,					/* nb_negative */
 	0,					/* nb_positive */
 	0,					/* nb_absolute */
-	(inquiry)time_nonzero,			/* nb_nonzero */
+	(inquiry)time_bool,			/* nb_bool */
 };
 
 static PyTypeObject PyDateTime_TimeType = {
@@ -3474,7 +3446,7 @@
 	time_doc,				/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	(richcmpfunc)time_richcompare,		/* tp_richcompare */
+	time_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */
@@ -4115,46 +4087,34 @@
 
 /* Miscellaneous methods. */
 
-/* This is more natural as a tp_compare, but doesn't work then:  for whatever
- * reason, Python's try_3way_compare ignores tp_compare unless
- * PyInstance_Check returns true, but these aren't old-style classes.
- */
 static PyObject *
-datetime_richcompare(PyDateTime_DateTime *self, PyObject *other, int op)
+datetime_richcompare(PyObject *self, PyObject *other, int op)
 {
 	int diff;
 	naivety n1, n2;
 	int offset1, offset2;
 
 	if (! PyDateTime_Check(other)) {
-		/* If other has a "timetuple" attr, that's an advertised
-		 * hook for other classes to ask to get comparison control.
-		 * However, date instances have a timetuple attr, and we
-		 * don't want to allow that comparison.  Because datetime
-		 * is a subclass of date, when mixing date and datetime
-		 * in a comparison, Python gives datetime the first shot
-		 * (it's the more specific subtype).  So we can stop that
-		 * combination here reliably.
-		 */
-		if (PyObject_HasAttrString(other, "timetuple") &&
-		    ! PyDate_Check(other)) {
-			/* A hook for other kinds of datetime objects. */
-			Py_INCREF(Py_NotImplemented);
-			return Py_NotImplemented;
-		}
-		if (op == Py_EQ || op == Py_NE) {
-			PyObject *result = op == Py_EQ ? Py_False : Py_True;
-			Py_INCREF(result);
-			return result;
-		}
-		/* Stop this from falling back to address comparison. */
-		return cmperror((PyObject *)self, other);
-	}
-
-	if (classify_two_utcoffsets((PyObject *)self, &offset1, &n1,
-				    (PyObject *)self,
-				     other, &offset2, &n2,
-				     other) < 0)
+		if (PyDate_Check(other)) {
+			/* Prevent invocation of date_richcompare.  We want to
+			   return NotImplemented here to give the other object
+			   a chance.  But since DateTime is a subclass of
+			   Date, if the other object is a Date, it would
+			   compute an ordering based on the date part alone,
+			   and we don't want that.  So force unequal or
+			   uncomparable here in that case. */
+			if (op == Py_EQ)
+				Py_RETURN_FALSE;
+			if (op == Py_NE)
+				Py_RETURN_TRUE;
+			return cmperror(self, other);
+		}
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
+	}
+
+	if (classify_two_utcoffsets(self, &offset1, &n1, self,
+				    other, &offset2, &n2, other) < 0)
 		return NULL;
 	assert(n1 != OFFSET_UNKNOWN && n2 != OFFSET_UNKNOWN);
  	/* If they're both naive, or both aware and have the same offsets,
@@ -4162,7 +4122,8 @@
 	 * offset2 == 0 at this point.
 	 */
 	if (n1 == n2 && offset1 == offset2) {
-		diff = memcmp(self->data, ((PyDateTime_DateTime *)other)->data,
+		diff = memcmp(((PyDateTime_DateTime *)self)->data,
+			      ((PyDateTime_DateTime *)other)->data,
 			      _PyDateTime_DATETIME_DATASIZE);
 		return diff_to_bool(diff, op);
 	}
@@ -4540,7 +4501,7 @@
 	0,					/* nb_negative */
 	0,					/* nb_positive */
 	0,					/* nb_absolute */
-	0,					/* nb_nonzero */
+	0,					/* nb_bool */
 };
 
 static PyTypeObject PyDateTime_DateTimeType = {
@@ -4568,7 +4529,7 @@
 	datetime_doc,				/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	(richcmpfunc)datetime_richcompare,	/* tp_richcompare */
+	datetime_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */

Modified: python/branches/p3yk-noslice/Modules/dbmmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/dbmmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/dbmmodule.c	Fri Dec 15 05:21:50 2006
@@ -246,11 +246,13 @@
 {
 	datum key, val;
 	PyObject *defvalue = Py_None;
+	char *tmp_ptr;
 	int tmp_size;
 
 	if (!PyArg_ParseTuple(args, "s#|O:get",
-                              &key.dptr, &tmp_size, &defvalue))
+                              &tmp_ptr, &tmp_size, &defvalue))
 		return NULL;
+	key.dptr = tmp_ptr;
 	key.dsize = tmp_size;
         check_dbmobject_open(dp);
 	val = dbm_fetch(dp->di_dbm, key);
@@ -267,11 +269,13 @@
 {
 	datum key, val;
 	PyObject *defvalue = NULL;
+	char *tmp_ptr;
 	int tmp_size;
 
 	if (!PyArg_ParseTuple(args, "s#|S:setdefault",
-                              &key.dptr, &tmp_size, &defvalue))
+                              &tmp_ptr, &tmp_size, &defvalue))
 		return NULL;
+	key.dptr = tmp_ptr;
 	key.dsize = tmp_size;
         check_dbmobject_open(dp);
 	val = dbm_fetch(dp->di_dbm, key);

Modified: python/branches/p3yk-noslice/Modules/gcmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/gcmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/gcmodule.c	Fri Dec 15 05:21:50 2006
@@ -1153,6 +1153,7 @@
 "disable() -- Disable automatic garbage collection.\n"
 "isenabled() -- Returns true if automatic collection is enabled.\n"
 "collect() -- Do a full collection right now.\n"
+"get_count() -- Return the current collection counts.\n"
 "set_debug() -- Set debugging flags.\n"
 "get_debug() -- Get debugging flags.\n"
 "set_threshold() -- Set the collection thresholds.\n"

Modified: python/branches/p3yk-noslice/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/itertoolsmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/itertoolsmodule.c	Fri Dec 15 05:21:50 2006
@@ -618,11 +618,15 @@
 static PyObject *
 tee(PyObject *self, PyObject *args)
 {
-	int i, n=2;
+	Py_ssize_t i, n=2;
 	PyObject *it, *iterable, *copyable, *result;
 
-	if (!PyArg_ParseTuple(args, "O|i", &iterable, &n))
+	if (!PyArg_ParseTuple(args, "O|n", &iterable, &n))
 		return NULL;
+	if (n < 0) {
+		PyErr_SetString(PyExc_ValueError, "n must be >= 0");
+		return NULL;
+	}
 	result = PyTuple_New(n);
 	if (result == NULL)
 		return NULL;
@@ -2068,7 +2072,7 @@
 static PyObject *
 count_next(countobject *lz)
 {
-	return PyInt_FromSize_t(lz->cnt++);
+	return PyInt_FromSsize_t(lz->cnt++);
 }
 
 static PyObject *

Modified: python/branches/p3yk-noslice/Modules/linuxaudiodev.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/linuxaudiodev.c	(original)
+++ python/branches/p3yk-noslice/Modules/linuxaudiodev.c	Fri Dec 15 05:21:50 2006
@@ -28,7 +28,9 @@
 #if defined(linux)
 #include <linux/soundcard.h>
 
+#ifndef HAVE_STDINT_H
 typedef unsigned long uint32_t;
+#endif
 
 #elif defined(__FreeBSD__)
 #include <machine/soundcard.h>

Modified: python/branches/p3yk-noslice/Modules/main.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/main.c	(original)
+++ python/branches/p3yk-noslice/Modules/main.c	Fri Dec 15 05:21:50 2006
@@ -59,31 +59,32 @@
 static char *usage_1 = "\
 Options and arguments (and corresponding environment variables):\n\
 -c cmd : program passed in as string (terminates option list)\n\
--d     : debug output from parser (also PYTHONDEBUG=x)\n\
+-d     : debug output from parser; also PYTHONDEBUG=x\n\
 -E     : ignore environment variables (such as PYTHONPATH)\n\
 -h     : print this help message and exit (also --help)\n\
--i     : inspect interactively after running script, (also PYTHONINSPECT=x)\n\
-         and force prompts, even if stdin does not appear to be a terminal\n\
+-i     : inspect interactively after running script; forces a prompt even\n\
+         if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\
 ";
 static char *usage_2 = "\
 -m mod : run library module as a script (terminates option list)\n\
--O     : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n\
+-O     : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
 -OO    : remove doc-strings in addition to the -O optimizations\n\
 -S     : don't imply 'import site' on initialization\n\
 -t     : issue warnings about inconsistent tab usage (-tt: issue errors)\n\
--u     : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\
+-u     : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x\n\
 ";
 static char *usage_3 = "\
          see man page for details on internal buffering relating to '-u'\n\
--v     : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\
+-v     : verbose (trace import statements); also PYTHONVERBOSE=x\n\
+         can be supplied multiple times to increase verbosity\n\
 -V     : print the Python version number and exit (also --version)\n\
--W arg : warning control (arg is action:message:category:module:lineno)\n\
+-W arg : warning control; arg is action:message:category:module:lineno\n\
 -x     : skip first line of source, allowing use of non-Unix forms of #!cmd\n\
 file   : program read from script file\n\
 -      : program read from stdin (default; interactive mode if a tty)\n\
 ";
 static char *usage_4 = "\
-arg ...: arguments passed to program in sys.argv[1:]\n\
+arg ...: arguments passed to program in sys.argv[1:]\n\n\
 Other environment variables:\n\
 PYTHONSTARTUP: file executed on interactive startup (no default)\n\
 PYTHONPATH   : '%c'-separated list of directories prefixed to the\n\

Modified: python/branches/p3yk-noslice/Modules/mathmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/mathmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/mathmodule.c	Fri Dec 15 05:21:50 2006
@@ -48,10 +48,10 @@
 }
 
 static PyObject *
-math_1(PyObject *args, double (*func) (double), char *argsfmt)
+math_1(PyObject *arg, double (*func) (double))
 {
-	double x;
-	if (!  PyArg_ParseTuple(args, argsfmt, &x))
+	double x = PyFloat_AsDouble(arg);
+	if (x == -1.0 && PyErr_Occurred())
 		return NULL;
 	errno = 0;
 	PyFPE_START_PROTECT("in math_1", return 0)
@@ -65,10 +65,15 @@
 }
 
 static PyObject *
-math_2(PyObject *args, double (*func) (double, double), char *argsfmt)
+math_2(PyObject *args, double (*func) (double, double), char *funcname)
 {
+	PyObject *ox, *oy;
 	double x, y;
-	if (! PyArg_ParseTuple(args, argsfmt, &x, &y))
+	if (! PyArg_UnpackTuple(args, funcname, 2, 2, &ox, &oy))
+		return NULL;
+	x = PyFloat_AsDouble(ox);
+	y = PyFloat_AsDouble(oy);
+	if ((x == -1.0 || y == -1.0) && PyErr_Occurred())
 		return NULL;
 	errno = 0;
 	PyFPE_START_PROTECT("in math_2", return 0)
@@ -83,13 +88,13 @@
 
 #define FUNC1(funcname, func, docstring) \
 	static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
-		return math_1(args, func, "d:" #funcname); \
+		return math_1(args, func); \
 	}\
         PyDoc_STRVAR(math_##funcname##_doc, docstring);
 
 #define FUNC2(funcname, func, docstring) \
 	static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
-		return math_2(args, func, "dd:" #funcname); \
+		return math_2(args, func, #funcname); \
 	}\
         PyDoc_STRVAR(math_##funcname##_doc, docstring);
 
@@ -135,11 +140,11 @@
       "tanh(x)\n\nReturn the hyperbolic tangent of x.")
 
 static PyObject *
-math_frexp(PyObject *self, PyObject *args)
+math_frexp(PyObject *self, PyObject *arg)
 {
-	double x;
 	int i;
-	if (! PyArg_ParseTuple(args, "d:frexp", &x))
+	double x = PyFloat_AsDouble(arg);
+	if (x == -1.0 && PyErr_Occurred())
 		return NULL;
 	errno = 0;
 	x = frexp(x, &i);
@@ -179,10 +184,10 @@
 "ldexp(x, i) -> x * (2**i)");
 
 static PyObject *
-math_modf(PyObject *self, PyObject *args)
+math_modf(PyObject *self, PyObject *arg)
 {
-	double x, y;
-	if (! PyArg_ParseTuple(args, "d:modf", &x))
+	double y, x = PyFloat_AsDouble(arg);
+	if (x == -1.0 && PyErr_Occurred())
 		return NULL;
 	errno = 0;
 	x = modf(x, &y);
@@ -208,7 +213,7 @@
 */
 
 static PyObject*
-loghelper(PyObject* args, double (*func)(double), char *format, PyObject *arg)
+loghelper(PyObject* arg, double (*func)(double), char *funcname)
 {
 	/* If it is long, do it ourselves. */
 	if (PyLong_Check(arg)) {
@@ -229,7 +234,7 @@
 	}
 
 	/* Else let libm handle it by itself. */
-	return math_1(args, func, format);
+	return math_1(arg, func);
 }
 
 static PyObject *
@@ -239,28 +244,15 @@
 	PyObject *base = NULL;
 	PyObject *num, *den;
 	PyObject *ans;
-	PyObject *newargs;
 
 	if (!PyArg_UnpackTuple(args, "log", 1, 2, &arg, &base))
 		return NULL;
-	if (base == NULL)
-		return loghelper(args, log, "d:log", arg);
 
-	newargs = PyTuple_Pack(1, arg);
-	if (newargs == NULL)
-		return NULL;
-	num = loghelper(newargs, log, "d:log", arg);
-	Py_DECREF(newargs);
-	if (num == NULL)
-		return NULL;
+	num = loghelper(arg, log, "log");
+	if (num == NULL || base == NULL)
+		return num;
 
-	newargs = PyTuple_Pack(1, base);
-	if (newargs == NULL) {
-		Py_DECREF(num);
-		return NULL;
-	}
-	den = loghelper(newargs, log, "d:log", base);
-	Py_DECREF(newargs);
+	den = loghelper(base, log, "log");
 	if (den == NULL) {
 		Py_DECREF(num);
 		return NULL;
@@ -277,25 +269,23 @@
 If the base not specified, returns the natural logarithm (base e) of x.");
 
 static PyObject *
-math_log10(PyObject *self, PyObject *args)
+math_log10(PyObject *self, PyObject *arg)
 {
-	PyObject *arg;
-
-	if (!PyArg_UnpackTuple(args, "log10", 1, 1, &arg))
-		return NULL;
-	return loghelper(args, log10, "d:log10", arg);
+	return loghelper(arg, log10, "log10");
 }
 
 PyDoc_STRVAR(math_log10_doc,
 "log10(x) -> the base 10 logarithm of x.");
 
+/* XXX(nnorwitz): Should we use the platform M_PI or something more accurate
+   like: 3.14159265358979323846264338327950288 */
 static const double degToRad = 3.141592653589793238462643383 / 180.0;
 
 static PyObject *
-math_degrees(PyObject *self, PyObject *args)
+math_degrees(PyObject *self, PyObject *arg)
 {
-	double x;
-	if (! PyArg_ParseTuple(args, "d:degrees", &x))
+	double x = PyFloat_AsDouble(arg);
+	if (x == -1.0 && PyErr_Occurred())
 		return NULL;
 	return PyFloat_FromDouble(x / degToRad);
 }
@@ -304,10 +294,10 @@
 "degrees(x) -> converts angle x from radians to degrees");
 
 static PyObject *
-math_radians(PyObject *self, PyObject *args)
+math_radians(PyObject *self, PyObject *arg)
 {
-	double x;
-	if (! PyArg_ParseTuple(args, "d:radians", &x))
+	double x = PyFloat_AsDouble(arg);
+	if (x == -1.0 && PyErr_Occurred())
 		return NULL;
 	return PyFloat_FromDouble(x * degToRad);
 }
@@ -316,31 +306,31 @@
 "radians(x) -> converts angle x from degrees to radians");
 
 static PyMethodDef math_methods[] = {
-	{"acos",	math_acos,	METH_VARARGS,	math_acos_doc},
-	{"asin",	math_asin,	METH_VARARGS,	math_asin_doc},
-	{"atan",	math_atan,	METH_VARARGS,	math_atan_doc},
+	{"acos",	math_acos,	METH_O,		math_acos_doc},
+	{"asin",	math_asin,	METH_O,		math_asin_doc},
+	{"atan",	math_atan,	METH_O,		math_atan_doc},
 	{"atan2",	math_atan2,	METH_VARARGS,	math_atan2_doc},
-	{"ceil",	math_ceil,	METH_VARARGS,	math_ceil_doc},
-	{"cos",		math_cos,	METH_VARARGS,	math_cos_doc},
-	{"cosh",	math_cosh,	METH_VARARGS,	math_cosh_doc},
-	{"degrees",	math_degrees,	METH_VARARGS,	math_degrees_doc},
-	{"exp",		math_exp,	METH_VARARGS,	math_exp_doc},
-	{"fabs",	math_fabs,	METH_VARARGS,	math_fabs_doc},
-	{"floor",	math_floor,	METH_VARARGS,	math_floor_doc},
+	{"ceil",	math_ceil,	METH_O,		math_ceil_doc},
+	{"cos",		math_cos,	METH_O,		math_cos_doc},
+	{"cosh",	math_cosh,	METH_O,		math_cosh_doc},
+	{"degrees",	math_degrees,	METH_O,		math_degrees_doc},
+	{"exp",		math_exp,	METH_O,		math_exp_doc},
+	{"fabs",	math_fabs,	METH_O,		math_fabs_doc},
+	{"floor",	math_floor,	METH_O,		math_floor_doc},
 	{"fmod",	math_fmod,	METH_VARARGS,	math_fmod_doc},
-	{"frexp",	math_frexp,	METH_VARARGS,	math_frexp_doc},
+	{"frexp",	math_frexp,	METH_O,		math_frexp_doc},
 	{"hypot",	math_hypot,	METH_VARARGS,	math_hypot_doc},
 	{"ldexp",	math_ldexp,	METH_VARARGS,	math_ldexp_doc},
 	{"log",		math_log,	METH_VARARGS,	math_log_doc},
-	{"log10",	math_log10,	METH_VARARGS,	math_log10_doc},
-	{"modf",	math_modf,	METH_VARARGS,	math_modf_doc},
+	{"log10",	math_log10,	METH_O,		math_log10_doc},
+	{"modf",	math_modf,	METH_O,		math_modf_doc},
 	{"pow",		math_pow,	METH_VARARGS,	math_pow_doc},
-	{"radians",	math_radians,	METH_VARARGS,	math_radians_doc},
-	{"sin",		math_sin,	METH_VARARGS,	math_sin_doc},
-	{"sinh",	math_sinh,	METH_VARARGS,	math_sinh_doc},
-	{"sqrt",	math_sqrt,	METH_VARARGS,	math_sqrt_doc},
-	{"tan",		math_tan,	METH_VARARGS,	math_tan_doc},
-	{"tanh",	math_tanh,	METH_VARARGS,	math_tanh_doc},
+	{"radians",	math_radians,	METH_O,		math_radians_doc},
+	{"sin",		math_sin,	METH_O,		math_sin_doc},
+	{"sinh",	math_sinh,	METH_O,		math_sinh_doc},
+	{"sqrt",	math_sqrt,	METH_O,		math_sqrt_doc},
+	{"tan",		math_tan,	METH_O,		math_tan_doc},
+	{"tanh",	math_tanh,	METH_O,		math_tanh_doc},
 	{NULL,		NULL}		/* sentinel */
 };
 
@@ -358,6 +348,8 @@
 	if (m == NULL)
 		goto finally;
 	d = PyModule_GetDict(m);
+	if (d == NULL)
+		goto finally;
 
         if (!(v = PyFloat_FromDouble(atan(1.0) * 4.0)))
                 goto finally;

Modified: python/branches/p3yk-noslice/Modules/mmapmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/mmapmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/mmapmodule.c	Fri Dec 15 05:21:50 2006
@@ -470,7 +470,7 @@
 mmap_tell_method(mmap_object *self, PyObject *unused)
 {
 	CHECK_VALID(NULL);
-	return PyInt_FromLong((long) self->pos);
+	return PyInt_FromSize_t(self->pos);
 }
 
 static PyObject *

Modified: python/branches/p3yk-noslice/Modules/ossaudiodev.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/ossaudiodev.c	(original)
+++ python/branches/p3yk-noslice/Modules/ossaudiodev.c	Fri Dec 15 05:21:50 2006
@@ -34,7 +34,9 @@
 
 #if defined(linux)
 
+#ifndef HAVE_STDINT_H
 typedef unsigned long uint32_t;
+#endif
 
 #elif defined(__FreeBSD__)
 

Modified: python/branches/p3yk-noslice/Modules/parsermodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/parsermodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/parsermodule.c	Fri Dec 15 05:21:50 2006
@@ -74,7 +74,8 @@
 node2tuple(node *n,                     /* node to convert               */
            SeqMaker mkseq,              /* create sequence               */
            SeqInserter addelem,         /* func. to add elem. in seq.    */
-           int lineno)                  /* include line numbers?         */
+           int lineno,                  /* include line numbers?         */
+           int col_offset)              /* include column offsets?       */
 {
     if (n == NULL) {
         Py_INCREF(Py_None);
@@ -95,7 +96,7 @@
         }
         (void) addelem(v, 0, w);
         for (i = 0; i < NCH(n); i++) {
-            w = node2tuple(CHILD(n, i), mkseq, addelem, lineno);
+            w = node2tuple(CHILD(n, i), mkseq, addelem, lineno, col_offset);
             if (w == NULL) {
                 Py_DECREF(v);
                 return ((PyObject*) NULL);
@@ -108,12 +109,14 @@
         return (v);
     }
     else if (ISTERMINAL(TYPE(n))) {
-        PyObject *result = mkseq(2 + lineno);
+        PyObject *result = mkseq(2 + lineno + col_offset);
         if (result != NULL) {
             (void) addelem(result, 0, PyInt_FromLong(TYPE(n)));
             (void) addelem(result, 1, PyString_FromString(STR(n)));
             if (lineno == 1)
                 (void) addelem(result, 2, PyInt_FromLong(n->n_lineno));
+            if (col_offset == 1)
+                (void) addelem(result, 3, PyInt_FromLong(n->n_col_offset));
         }
         return (result);
     }
@@ -289,29 +292,35 @@
 parser_st2tuple(PyST_Object *self, PyObject *args, PyObject *kw)
 {
     PyObject *line_option = 0;
+    PyObject *col_option = 0;
     PyObject *res = 0;
     int ok;
 
-    static char *keywords[] = {"ast", "line_info", NULL};
+    static char *keywords[] = {"ast", "line_info", "col_info", NULL};
 
     if (self == NULL) {
-        ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O:st2tuple", keywords,
-                                         &PyST_Type, &self, &line_option);
+        ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|OO:st2tuple", keywords,
+                                         &PyST_Type, &self, &line_option,
+                                         &col_option);
     }
     else
-        ok = PyArg_ParseTupleAndKeywords(args, kw, "|O:totuple", &keywords[1],
-                                         &line_option);
+        ok = PyArg_ParseTupleAndKeywords(args, kw, "|OO:totuple", &keywords[1],
+                                         &line_option, &col_option);
     if (ok != 0) {
         int lineno = 0;
+        int col_offset = 0;
         if (line_option != NULL) {
             lineno = (PyObject_IsTrue(line_option) != 0) ? 1 : 0;
         }
+        if (col_option != NULL) {
+            col_offset = (PyObject_IsTrue(col_option) != 0) ? 1 : 0;
+        }
         /*
          *  Convert ST into a tuple representation.  Use Guido's function,
          *  since it's known to work already.
          */
         res = node2tuple(((PyST_Object*)self)->st_node,
-                         PyTuple_New, PyTuple_SetItem, lineno);
+                         PyTuple_New, PyTuple_SetItem, lineno, col_offset);
     }
     return (res);
 }
@@ -327,28 +336,34 @@
 parser_st2list(PyST_Object *self, PyObject *args, PyObject *kw)
 {
     PyObject *line_option = 0;
+    PyObject *col_option = 0;
     PyObject *res = 0;
     int ok;
 
-    static char *keywords[] = {"ast", "line_info", NULL};
+    static char *keywords[] = {"ast", "line_info", "col_info", NULL};
 
     if (self == NULL)
-        ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O:st2list", keywords,
-                                         &PyST_Type, &self, &line_option);
+        ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|OO:st2list", keywords,
+                                         &PyST_Type, &self, &line_option,
+                                         &col_option);
     else
-        ok = PyArg_ParseTupleAndKeywords(args, kw, "|O:tolist", &keywords[1],
-                                         &line_option);
+        ok = PyArg_ParseTupleAndKeywords(args, kw, "|OO:tolist", &keywords[1],
+                                         &line_option, &col_option);
     if (ok) {
         int lineno = 0;
+        int col_offset = 0;
         if (line_option != 0) {
             lineno = PyObject_IsTrue(line_option) ? 1 : 0;
         }
+        if (col_option != NULL) {
+            col_offset = (PyObject_IsTrue(col_option) != 0) ? 1 : 0;
+        }
         /*
          *  Convert ST into a tuple representation.  Use Guido's function,
          *  since it's known to work already.
          */
         res = node2tuple(self->st_node,
-                         PyList_New, PyList_SetItem, lineno);
+                         PyList_New, PyList_SetItem, lineno, col_offset);
     }
     return (res);
 }
@@ -848,7 +863,7 @@
 VALIDATER(import_name);         VALIDATER(import_from);
 VALIDATER(global_stmt);         VALIDATER(list_if);
 VALIDATER(assert_stmt);         VALIDATER(list_for);
-VALIDATER(exec_stmt);           VALIDATER(compound_stmt);
+VALIDATER(compound_stmt);
 VALIDATER(while);               VALIDATER(for);
 VALIDATER(try);                 VALIDATER(except_clause);
 VALIDATER(test);                VALIDATER(and_test);
@@ -860,7 +875,7 @@
 VALIDATER(atom);                VALIDATER(lambdef);
 VALIDATER(trailer);             VALIDATER(subscript);
 VALIDATER(subscriptlist);       VALIDATER(sliceop);
-VALIDATER(exprlist);            VALIDATER(dictmaker);
+VALIDATER(exprlist);            VALIDATER(dictsetmaker);
 VALIDATER(arglist);             VALIDATER(argument);
 VALIDATER(listmaker);           VALIDATER(yield_stmt);
 VALIDATER(testlist1);           VALIDATER(gen_for);
@@ -1105,13 +1120,13 @@
 }
 
 
-/* '*' NAME [',' '**' NAME] | '**' NAME
+/* '*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME
  */
 static int
 validate_varargslist_trailer(node *tree, int start)
 {
     int nch = NCH(tree);
-    int res = 0;
+    int res = 0, i;
     int sym;
 
     if (nch <= start) {
@@ -1121,15 +1136,40 @@
     sym = TYPE(CHILD(tree, start));
     if (sym == STAR) {
         /*
-         *  ('*' NAME [',' '**' NAME]
+         * '*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME
          */
         if (nch-start == 2)
             res = validate_name(CHILD(tree, start+1), NULL);
-        else if (nch-start == 5)
+        else if (nch-start == 5 && TYPE(CHILD(tree, start+2)) == COMMA)
             res = (validate_name(CHILD(tree, start+1), NULL)
                    && validate_comma(CHILD(tree, start+2))
                    && validate_doublestar(CHILD(tree, start+3))
                    && validate_name(CHILD(tree, start+4), NULL));
+        else {
+            /* skip over [NAME] (',' NAME ['=' test])*  */
+            i = start + 1;
+	    if (TYPE(CHILD(tree, i)) == NAME) { /* skip over [NAME] */
+		i += 1;
+	    }
+            while (res && i+1 < nch) { /* validate  (',' NAME ['=' test])* */
+                res = validate_comma(CHILD(tree, i));
+                if (TYPE(CHILD(tree, i+1)) == DOUBLESTAR) 
+                    break;
+                res = res && validate_name(CHILD(tree, i+1), NULL);
+                if (res && i+2 < nch && TYPE(CHILD(tree, i+2)) == EQUAL) {
+                    res = res && (i+3 < nch) 
+                          && validate_test(CHILD(tree, i+3));
+                    i += 4;
+                }
+                else {
+                    i += 2;
+                }
+            }
+            /* [',' '**' NAME] */
+            if (res && i+1 < nch && TYPE(CHILD(tree, i+1)) == DOUBLESTAR) {
+                res = validate_name(CHILD(tree, i+2), NULL);
+            }
+        }
     }
     else if (sym == DOUBLESTAR) {
         /*
@@ -1148,9 +1188,8 @@
  *
  *  varargslist:
  *      (fpdef ['=' test] ',')*
- *           ('*' NAME [',' '**' NAME]
- *         | '**' NAME)
- *    | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+ *      ('*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME)
+ *      | fpdef ['=' test] (',' fpdef ['=' test])* [',']
  *
  */
 static int
@@ -1169,7 +1208,7 @@
     sym = TYPE(CHILD(tree, 0));
     if (sym == STAR || sym == DOUBLESTAR)
         /* whole thing matches:
-         *      '*' NAME [',' '**' NAME] | '**' NAME
+         *    '*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME
          */
         res = validate_varargslist_trailer(tree, 0);
     else if (sym == fpdef) {
@@ -1201,7 +1240,7 @@
                         break;
                 }
             }
-            /* ... '*' NAME [',' '**' NAME] | '**' NAME
+            /* .. ('*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME)
              * i --^^^
              */
             if (res)
@@ -1465,8 +1504,7 @@
               || (ntype == flow_stmt)
               || (ntype == import_stmt)
               || (ntype == global_stmt)
-              || (ntype == assert_stmt)
-              || (ntype == exec_stmt))
+              || (ntype == assert_stmt))
             res = validate_node(CHILD(tree, 0));
         else {
             res = 0;
@@ -1888,32 +1926,6 @@
 }
 
 
-/*  exec_stmt:
- *
- *  'exec' expr ['in' test [',' test]]
- */
-static int
-validate_exec_stmt(node *tree)
-{
-    int nch = NCH(tree);
-    int res = (validate_ntype(tree, exec_stmt)
-               && ((nch == 2) || (nch == 4) || (nch == 6))
-               && validate_name(CHILD(tree, 0), "exec")
-               && validate_expr(CHILD(tree, 1)));
-
-    if (!res && !PyErr_Occurred())
-        err_string("illegal exec statement");
-    if (res && (nch > 2))
-        res = (validate_name(CHILD(tree, 2), "in")
-               && validate_test(CHILD(tree, 3)));
-    if (res && (nch == 6))
-        res = (validate_comma(CHILD(tree, 4))
-               && validate_test(CHILD(tree, 5)));
-
-    return (res);
-}
-
-
 /*  assert_stmt:
  *
  *  'assert' test [',' test]
@@ -2402,12 +2414,7 @@
                    && validate_ntype(CHILD(tree, nch - 1), RBRACE));
 
             if (res && (nch == 3))
-                res = validate_dictmaker(CHILD(tree, 1));
-            break;
-          case BACKQUOTE:
-            res = ((nch == 3)
-                   && validate_testlist1(CHILD(tree, 1))
-                   && validate_ntype(CHILD(tree, 2), BACKQUOTE));
+                res = validate_dictsetmaker(CHILD(tree, 1));
             break;
           case NAME:
           case NUMBER:
@@ -2417,6 +2424,11 @@
             for (pos = 1; res && (pos < nch); ++pos)
                 res = validate_ntype(CHILD(tree, pos), STRING);
             break;
+	  case DOT:
+	    res = (nch == 3 &&
+	           validate_ntype(CHILD(tree, 1), DOT) &&
+		   validate_ntype(CHILD(tree, 2), DOT));
+	    break;
           default:
             res = 0;
             break;
@@ -2843,10 +2855,10 @@
 
 
 static int
-validate_dictmaker(node *tree)
+validate_dictsetmaker(node *tree)
 {
     int nch = NCH(tree);
-    int res = (validate_ntype(tree, dictmaker)
+    int res = (validate_ntype(tree, dictsetmaker)
                && (nch >= 3)
                && validate_test(CHILD(tree, 0))
                && validate_colon(CHILD(tree, 1))
@@ -2919,7 +2931,7 @@
           case small_stmt:
             /*
              *  expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt
-             *  | import_stmt | global_stmt | exec_stmt | assert_stmt
+             *  | import_stmt | global_stmt | assert_stmt
              */
             res = validate_small_stmt(tree);
             break;
@@ -2989,9 +3001,6 @@
           case global_stmt:
             res = validate_global_stmt(tree);
             break;
-          case exec_stmt:
-            res = validate_exec_stmt(tree);
-            break;
           case assert_stmt:
             res = validate_assert_stmt(tree);
             break;

Modified: python/branches/p3yk-noslice/Modules/posixmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/posixmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/posixmodule.c	Fri Dec 15 05:21:50 2006
@@ -792,7 +792,7 @@
 	/* XXX endianness */
 	__int64 out;
 	out = time_in + secs_between_epochs;
-	out = out * 10000000 + nsec_in;
+	out = out * 10000000 + nsec_in / 100;
 	memcpy(out_ptr, &out, sizeof(out));
 }
 
@@ -828,6 +828,106 @@
 	return 0;
 }
 
+/* Emulate GetFileAttributesEx[AW] on Windows 95 */
+static int checked = 0;
+static BOOL (CALLBACK *gfaxa)(LPCSTR, GET_FILEEX_INFO_LEVELS, LPVOID);
+static BOOL (CALLBACK *gfaxw)(LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID);
+static void
+check_gfax()
+{
+	HINSTANCE hKernel32;
+	if (checked)
+	    return;
+	checked = 1;
+	hKernel32 = GetModuleHandle("KERNEL32");
+	*(FARPROC*)&gfaxa = GetProcAddress(hKernel32, "GetFileAttributesExA");
+	*(FARPROC*)&gfaxw = GetProcAddress(hKernel32, "GetFileAttributesExW");
+}
+
+static BOOL WINAPI
+Py_GetFileAttributesExA(LPCSTR pszFile, 
+		       GET_FILEEX_INFO_LEVELS level,
+                       LPVOID pv)
+{
+	BOOL result;
+	HANDLE hFindFile;
+	WIN32_FIND_DATAA FileData;
+	LPWIN32_FILE_ATTRIBUTE_DATA pfad = pv;
+	/* First try to use the system's implementation, if that is
+	   available and either succeeds to gives an error other than
+	   that it isn't implemented. */
+	check_gfax();
+	if (gfaxa) {
+		result = gfaxa(pszFile, level, pv);
+		if (result || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+			return result;
+	}
+	/* It's either not present, or not implemented.
+	   Emulate using FindFirstFile. */
+	if (level != GetFileExInfoStandard) {
+		SetLastError(ERROR_INVALID_PARAMETER);
+		return FALSE;
+	}
+	/* Use GetFileAttributes to validate that the file name
+	   does not contain wildcards (which FindFirstFile would
+	   accept). */
+	if (GetFileAttributesA(pszFile) == 0xFFFFFFFF)
+		return FALSE;
+	hFindFile = FindFirstFileA(pszFile, &FileData);
+	if (hFindFile == INVALID_HANDLE_VALUE)
+		return FALSE;
+	FindClose(hFindFile);
+	pfad->dwFileAttributes = FileData.dwFileAttributes;
+	pfad->ftCreationTime   = FileData.ftCreationTime;
+	pfad->ftLastAccessTime = FileData.ftLastAccessTime;
+	pfad->ftLastWriteTime  = FileData.ftLastWriteTime;
+	pfad->nFileSizeHigh    = FileData.nFileSizeHigh;
+	pfad->nFileSizeLow     = FileData.nFileSizeLow;
+	return TRUE;
+}
+
+static BOOL WINAPI
+Py_GetFileAttributesExW(LPCWSTR pszFile, 
+		       GET_FILEEX_INFO_LEVELS level,
+                       LPVOID pv)
+{
+	BOOL result;
+	HANDLE hFindFile;
+	WIN32_FIND_DATAW FileData;
+	LPWIN32_FILE_ATTRIBUTE_DATA pfad = pv;
+	/* First try to use the system's implementation, if that is
+	   available and either succeeds to gives an error other than
+	   that it isn't implemented. */
+	check_gfax();
+	if (gfaxa) {
+		result = gfaxw(pszFile, level, pv);
+		if (result || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+			return result;
+	}
+	/* It's either not present, or not implemented.
+	   Emulate using FindFirstFile. */
+	if (level != GetFileExInfoStandard) {
+		SetLastError(ERROR_INVALID_PARAMETER);
+		return FALSE;
+	}
+	/* Use GetFileAttributes to validate that the file name
+	   does not contain wildcards (which FindFirstFile would
+	   accept). */
+	if (GetFileAttributesW(pszFile) == 0xFFFFFFFF)
+		return FALSE;
+	hFindFile = FindFirstFileW(pszFile, &FileData);
+	if (hFindFile == INVALID_HANDLE_VALUE)
+		return FALSE;
+	FindClose(hFindFile);
+	pfad->dwFileAttributes = FileData.dwFileAttributes;
+	pfad->ftCreationTime   = FileData.ftCreationTime;
+	pfad->ftLastAccessTime = FileData.ftLastAccessTime;
+	pfad->ftLastWriteTime  = FileData.ftLastWriteTime;
+	pfad->nFileSizeHigh    = FileData.nFileSizeHigh;
+	pfad->nFileSizeLow     = FileData.nFileSizeLow;
+	return TRUE;
+}
+
 static int 
 win32_stat(const char* path, struct win32_stat *result)
 {
@@ -835,7 +935,7 @@
 	int code;
 	char *dot;
 	/* XXX not supported on Win95 and NT 3.x */
-	if (!GetFileAttributesExA(path, GetFileExInfoStandard, &info)) {
+	if (!Py_GetFileAttributesExA(path, GetFileExInfoStandard, &info)) {
 		/* Protocol violation: we explicitly clear errno, instead of
 		   setting it to a POSIX error. Callers should use GetLastError. */
 		errno = 0;
@@ -863,7 +963,7 @@
 	const wchar_t *dot;
 	WIN32_FILE_ATTRIBUTE_DATA info;
 	/* XXX not supported on Win95 and NT 3.x */
-	if (!GetFileAttributesExW(path, GetFileExInfoStandard, &info)) {
+	if (!Py_GetFileAttributesExW(path, GetFileExInfoStandard, &info)) {
 		/* Protocol violation: we explicitly clear errno, instead of
 		   setting it to a POSIX error. Callers should use GetLastError. */
 		errno = 0;
@@ -2458,7 +2558,8 @@
 			wpath = PyUnicode_AS_UNICODE(obwpath);
 			Py_BEGIN_ALLOW_THREADS
 			hFile = CreateFileW(wpath, FILE_WRITE_ATTRIBUTES, 0,
-					    NULL, OPEN_EXISTING, 0, NULL);
+					    NULL, OPEN_EXISTING,
+					    FILE_FLAG_BACKUP_SEMANTICS, NULL);
 			Py_END_ALLOW_THREADS
 			if (hFile == INVALID_HANDLE_VALUE)
 				return win32_error_unicode("utime", wpath);
@@ -2473,7 +2574,8 @@
 			return NULL;
 		Py_BEGIN_ALLOW_THREADS
 		hFile = CreateFileA(apath, FILE_WRITE_ATTRIBUTES, 0,
-				    NULL, OPEN_EXISTING, 0, NULL);
+				    NULL, OPEN_EXISTING,
+				    FILE_FLAG_BACKUP_SEMANTICS, NULL);
 		Py_END_ALLOW_THREADS
 		if (hFile == INVALID_HANDLE_VALUE) {
 			win32_error("utime", apath);
@@ -2501,11 +2603,11 @@
 		if (extract_time(PyTuple_GET_ITEM(arg, 0),
 				 &atimesec, &ausec) == -1)
 			goto done;
-		time_t_to_FILE_TIME(atimesec, ausec, &atime);
+		time_t_to_FILE_TIME(atimesec, 1000*ausec, &atime);
 		if (extract_time(PyTuple_GET_ITEM(arg, 1),
 				 &mtimesec, &musec) == -1)
 			goto done;
-		time_t_to_FILE_TIME(mtimesec, musec, &mtime);
+		time_t_to_FILE_TIME(mtimesec, 1000*musec, &mtime);
 	}
 	if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
 		/* Avoid putting the file name into the error here,
@@ -5585,17 +5687,53 @@
 static PyObject *
 posix_readlink(PyObject *self, PyObject *args)
 {
+	PyObject* v;
 	char buf[MAXPATHLEN];
 	char *path;
 	int n;
-	if (!PyArg_ParseTuple(args, "s:readlink", &path))
+#ifdef Py_USING_UNICODE
+	int arg_is_unicode = 0;
+#endif
+
+	if (!PyArg_ParseTuple(args, "et:readlink", 
+				Py_FileSystemDefaultEncoding, &path))
 		return NULL;
+#ifdef Py_USING_UNICODE
+	v = PySequence_GetItem(args, 0);
+	if (v == NULL) return NULL;
+
+	if (PyUnicode_Check(v)) {
+		arg_is_unicode = 1;
+	}
+	Py_DECREF(v);
+#endif
+
 	Py_BEGIN_ALLOW_THREADS
 	n = readlink(path, buf, (int) sizeof buf);
 	Py_END_ALLOW_THREADS
 	if (n < 0)
 		return posix_error_with_filename(path);
-	return PyString_FromStringAndSize(buf, n);
+
+	v = PyString_FromStringAndSize(buf, n);
+#ifdef Py_USING_UNICODE
+	if (arg_is_unicode) {
+		PyObject *w;
+
+		w = PyUnicode_FromEncodedObject(v,
+				Py_FileSystemDefaultEncoding,
+				"strict");
+		if (w != NULL) {
+			Py_DECREF(v);
+			v = w;
+		}
+		else {
+			/* fall back to the original byte string, as
+			   discussed in patch #683592 */
+			PyErr_Clear();
+		}
+	}
+#endif
+	return v;
 }
 #endif /* HAVE_READLINK */
 
@@ -7877,7 +8015,7 @@
 
 		pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(
 						hAdvAPI32, "CryptGenRandom");
-		if (pCryptAcquireContext == NULL)
+		if (pCryptGenRandom == NULL)
 			return PyErr_Format(PyExc_NotImplementedError,
 					    "CryptGenRandom not found");
 
@@ -8617,3 +8755,4 @@
 }
 #endif
 
+

Modified: python/branches/p3yk-noslice/Modules/pyexpat.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/pyexpat.c	(original)
+++ python/branches/p3yk-noslice/Modules/pyexpat.c	Fri Dec 15 05:21:50 2006
@@ -279,6 +279,7 @@
         filename = PyString_FromString(__FILE__);
         handler_info[slot].tb_code =
             PyCode_New(0,		/* argcount */
+                       0,       /* kwonlyargcount */
                        0,		/* nlocals */
                        0,		/* stacksize */
                        0,		/* flags */

Modified: python/branches/p3yk-noslice/Modules/readline.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/readline.c	(original)
+++ python/branches/p3yk-noslice/Modules/readline.c	Fri Dec 15 05:21:50 2006
@@ -768,10 +768,16 @@
 
 		while (!has_input)
 		{	struct timeval timeout = {0, 100000}; /* 0.1 seconds */
+
+			/* [Bug #1552726] Only limit the pause if an input hook has been 
+			   defined.  */
+		 	struct timeval *timeoutp = NULL;
+			if (PyOS_InputHook) 
+				timeoutp = &timeout;
 			FD_SET(fileno(rl_instream), &selectset);
 			/* select resets selectset if no input was available */
 			has_input = select(fileno(rl_instream) + 1, &selectset,
-					   NULL, NULL, &timeout);
+					   NULL, NULL, timeoutp);
 			if(PyOS_InputHook) PyOS_InputHook();
 		}
 

Modified: python/branches/p3yk-noslice/Modules/resource.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/resource.c	(original)
+++ python/branches/p3yk-noslice/Modules/resource.c	Fri Dec 15 05:21:50 2006
@@ -298,6 +298,10 @@
 	PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK);
 #endif
 
+#ifdef RLIMIT_SBSIZE
+	PyModule_AddIntConstant(m, "RLIMIT_SBSIZE", RLIMIT_SBSIZE);
+#endif
+
 #ifdef RUSAGE_SELF
 	PyModule_AddIntConstant(m, "RUSAGE_SELF", RUSAGE_SELF);
 #endif

Modified: python/branches/p3yk-noslice/Modules/socketmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/socketmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/socketmodule.c	Fri Dec 15 05:21:50 2006
@@ -364,19 +364,16 @@
 #define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
 #define sockaddr_l2 sockaddr_l2cap
 #define sockaddr_rc sockaddr_rfcomm
-#define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr)
 #define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb)
 #define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb)
 #elif defined(__NetBSD__)
 #define sockaddr_l2 sockaddr_bt
 #define sockaddr_rc sockaddr_bt
 #define sockaddr_sco sockaddr_bt
-#define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr)
 #define _BT_L2_MEMB(sa, memb) ((sa)->bt_##memb)
 #define _BT_RC_MEMB(sa, memb) ((sa)->bt_##memb)
 #define _BT_SCO_MEMB(sa, memb) ((sa)->bt_##memb)
 #else
-#define _BT_SOCKADDR_MEMB(s, proto) (&((s)->sock_addr).bt_##proto)
 #define _BT_L2_MEMB(sa, memb) ((sa)->l2_##memb)
 #define _BT_RC_MEMB(sa, memb) ((sa)->rc_##memb)
 #define _BT_SCO_MEMB(sa, memb) ((sa)->sco_##memb)
@@ -388,6 +385,8 @@
 #define SEGMENT_SIZE (32 * 1024 -1)
 #endif
 
+#define	SAS2SA(x)	((struct sockaddr *)(x))
+
 /*
  * Constants for getnameinfo()
  */
@@ -1174,7 +1173,7 @@
 
 static int
 getsockaddrarg(PySocketSockObject *s, PyObject *args,
-	       struct sockaddr **addr_ret, int *len_ret)
+	       struct sockaddr *addr_ret, int *len_ret)
 {
 	switch (s->sock_family) {
 
@@ -1184,9 +1183,10 @@
 		struct sockaddr_un* addr;
 		char *path;
 		int len;
-		addr = (struct sockaddr_un*)&(s->sock_addr).un;
 		if (!PyArg_Parse(args, "t#", &path, &len))
 			return 0;
+
+		addr = (struct sockaddr_un*)addr_ret;
 #ifdef linux
 		if (len > 0 && path[0] == 0) {
 			/* Linux abstract namespace extension */
@@ -1209,7 +1209,6 @@
 		}
 		addr->sun_family = s->sock_family;
 		memcpy(addr->sun_path, path, len);
-		*addr_ret = (struct sockaddr *) addr;
 #if defined(PYOS_OS2)
 		*len_ret = sizeof(*addr);
 #else
@@ -1224,7 +1223,7 @@
 	{
 		struct sockaddr_nl* addr;
 		int pid, groups;
-		addr = (struct sockaddr_nl *)&(s->sock_addr).nl;
+		addr = (struct sockaddr_nl *)addr_ret;
 		if (!PyTuple_Check(args)) {
 			PyErr_Format(
 				PyExc_TypeError,
@@ -1238,7 +1237,6 @@
 		addr->nl_family = AF_NETLINK;
 		addr->nl_pid = pid;
 		addr->nl_groups = groups;
-		*addr_ret = (struct sockaddr *) addr;
 		*len_ret = sizeof(*addr);
 		return 1;
 	}
@@ -1249,7 +1247,6 @@
 		struct sockaddr_in* addr;
 		char *host;
 		int port, result;
- 		addr=(struct sockaddr_in*)&(s->sock_addr).in;
 		if (!PyTuple_Check(args)) {
 			PyErr_Format(
 				PyExc_TypeError,
@@ -1261,6 +1258,7 @@
 		if (!PyArg_ParseTuple(args, "eti:getsockaddrarg",
 				      "idna", &host, &port))
 			return 0;
+		addr=(struct sockaddr_in*)addr_ret;
                 result = setipaddr(host, (struct sockaddr *)addr,
                                    sizeof(*addr),  AF_INET);
                 PyMem_Free(host);
@@ -1268,7 +1266,6 @@
 			return 0;
 		addr->sin_family = AF_INET;
 		addr->sin_port = htons((short)port);
-		*addr_ret = (struct sockaddr *) addr;
 		*len_ret = sizeof *addr;
 		return 1;
 	}
@@ -1279,7 +1276,6 @@
 		struct sockaddr_in6* addr;
 		char *host;
 		int port, flowinfo, scope_id, result;
- 		addr = (struct sockaddr_in6*)&(s->sock_addr).in6;
 		flowinfo = scope_id = 0;
 		if (!PyTuple_Check(args)) {
 			PyErr_Format(
@@ -1294,6 +1290,7 @@
 				      &scope_id)) {
 			return 0;
 		}
+		addr = (struct sockaddr_in6*)addr_ret;
                 result = setipaddr(host, (struct sockaddr *)addr,
                                    sizeof(*addr), AF_INET6);
                 PyMem_Free(host);
@@ -1303,7 +1300,6 @@
 		addr->sin6_port = htons((short)port);
 		addr->sin6_flowinfo = flowinfo;
 		addr->sin6_scope_id = scope_id;
-		*addr_ret = (struct sockaddr *) addr;
 		*len_ret = sizeof *addr;
 		return 1;
 	}
@@ -1315,9 +1311,10 @@
 		switch (s->sock_proto) {
 		case BTPROTO_L2CAP:
 		{
-			struct sockaddr_l2 *addr = (struct sockaddr_l2 *) _BT_SOCKADDR_MEMB(s, l2);
+			struct sockaddr_l2 *addr;
 			char *straddr;
 
+			addr = (struct sockaddr_l2 *)addr_ret;
 			_BT_L2_MEMB(addr, family) = AF_BLUETOOTH;
 			if (!PyArg_ParseTuple(args, "si", &straddr,
 					      &_BT_L2_MEMB(addr, psm))) {
@@ -1328,15 +1325,15 @@
 			if (setbdaddr(straddr, &_BT_L2_MEMB(addr, bdaddr)) < 0)
 				return 0;
 
-			*addr_ret = (struct sockaddr *) addr;
 			*len_ret = sizeof *addr;
 			return 1;
 		}
 		case BTPROTO_RFCOMM:
 		{
-			struct sockaddr_rc *addr = (struct sockaddr_rc *) _BT_SOCKADDR_MEMB(s, rc);
+			struct sockaddr_rc *addr;
 			char *straddr;
 
+			addr = (struct sockaddr_rc *)addr_ret;
 			_BT_RC_MEMB(addr, family) = AF_BLUETOOTH;
 			if (!PyArg_ParseTuple(args, "si", &straddr,
 					      &_BT_RC_MEMB(addr, channel))) {
@@ -1347,16 +1344,16 @@
 			if (setbdaddr(straddr, &_BT_RC_MEMB(addr, bdaddr)) < 0)
 				return 0;
 
-			*addr_ret = (struct sockaddr *) addr;
 			*len_ret = sizeof *addr;
 			return 1;
 		}
 #if !defined(__FreeBSD__)
 		case BTPROTO_SCO:
 		{
-			struct sockaddr_sco *addr = (struct sockaddr_sco *) _BT_SOCKADDR_MEMB(s, sco);
+			struct sockaddr_sco *addr;
 			char *straddr;
 
+			addr = (struct sockaddr_sco *)addr_ret;
 			_BT_SCO_MEMB(addr, family) = AF_BLUETOOTH;
 			straddr = PyString_AsString(args);
 			if (straddr == NULL) {
@@ -1367,7 +1364,6 @@
 			if (setbdaddr(straddr, &_BT_SCO_MEMB(addr, bdaddr)) < 0)
 				return 0;
 
-			*addr_ret = (struct sockaddr *) addr;
 			*len_ret = sizeof *addr;
 			return 1;
 		}
@@ -1409,22 +1405,21 @@
 		        s->errorhandler();
 			return 0;
 		}
-		addr = &(s->sock_addr.ll);
-		addr->sll_family = AF_PACKET;
-		addr->sll_protocol = htons((short)protoNumber);
-		addr->sll_ifindex = ifr.ifr_ifindex;
-		addr->sll_pkttype = pkttype;
-		addr->sll_hatype = hatype;
 		if (halen > 8) {
 		  PyErr_SetString(PyExc_ValueError,
 				  "Hardware address must be 8 bytes or less");
 		  return 0;
 		}
+		addr = (struct sockaddr_ll*)addr_ret;
+		addr->sll_family = AF_PACKET;
+		addr->sll_protocol = htons((short)protoNumber);
+		addr->sll_ifindex = ifr.ifr_ifindex;
+		addr->sll_pkttype = pkttype;
+		addr->sll_hatype = hatype;
 		if (halen != 0) {
 		  memcpy(&addr->sll_addr, haddr, halen);
 		}
 		addr->sll_halen = halen;
-		*addr_ret = (struct sockaddr *) addr;
 		*len_ret = sizeof *addr;
 		return 1;
 	}
@@ -1551,8 +1546,7 @@
 	Py_BEGIN_ALLOW_THREADS
 	timeout = internal_select(s, 0);
 	if (!timeout)
-		newfd = accept(s->sock_fd, (struct sockaddr *) &addrbuf,
-			       &addrlen);
+		newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
 	Py_END_ALLOW_THREADS
 
 	if (timeout == 1) {
@@ -1578,7 +1572,7 @@
 		SOCKETCLOSE(newfd);
 		goto finally;
 	}
-	addr = makesockaddr(s->sock_fd, (struct sockaddr *) &addrbuf,
+	addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
 			    addrlen, s->sock_proto);
 	if (addr == NULL)
 		goto finally;
@@ -1819,14 +1813,14 @@
 static PyObject *
 sock_bind(PySocketSockObject *s, PyObject *addro)
 {
-	struct sockaddr *addr;
+	sock_addr_t addrbuf;
 	int addrlen;
 	int res;
 
-	if (!getsockaddrarg(s, addro, &addr, &addrlen))
+	if (!getsockaddrarg(s, addro, SAS2SA(&addrbuf), &addrlen))
 		return NULL;
 	Py_BEGIN_ALLOW_THREADS
-	res = bind(s->sock_fd, addr, addrlen);
+	res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen);
 	Py_END_ALLOW_THREADS
 	if (res < 0)
 		return s->errorhandler();
@@ -1952,16 +1946,16 @@
 static PyObject *
 sock_connect(PySocketSockObject *s, PyObject *addro)
 {
-	struct sockaddr *addr;
+	sock_addr_t addrbuf;
 	int addrlen;
 	int res;
 	int timeout;
 
-	if (!getsockaddrarg(s, addro, &addr, &addrlen))
+	if (!getsockaddrarg(s, addro, SAS2SA(&addrbuf), &addrlen))
 		return NULL;
 
 	Py_BEGIN_ALLOW_THREADS
-	res = internal_connect(s, addr, addrlen, &timeout);
+	res = internal_connect(s, SAS2SA(&addrbuf), addrlen, &timeout);
 	Py_END_ALLOW_THREADS
 
 	if (timeout == 1) {
@@ -1986,16 +1980,16 @@
 static PyObject *
 sock_connect_ex(PySocketSockObject *s, PyObject *addro)
 {
-	struct sockaddr *addr;
+	sock_addr_t addrbuf;
 	int addrlen;
 	int res;
 	int timeout;
 
-	if (!getsockaddrarg(s, addro, &addr, &addrlen))
+	if (!getsockaddrarg(s, addro, SAS2SA(&addrbuf), &addrlen))
 		return NULL;
 
 	Py_BEGIN_ALLOW_THREADS
-	res = internal_connect(s, addr, addrlen, &timeout);
+	res = internal_connect(s, SAS2SA(&addrbuf), addrlen, &timeout);
 	Py_END_ALLOW_THREADS
 
 	/* Signals are not errors (though they may raise exceptions).  Adapted
@@ -2075,11 +2069,11 @@
 		return NULL;
 	memset(&addrbuf, 0, addrlen);
 	Py_BEGIN_ALLOW_THREADS
-	res = getsockname(s->sock_fd, (struct sockaddr *) &addrbuf, &addrlen);
+	res = getsockname(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
 	Py_END_ALLOW_THREADS
 	if (res < 0)
 		return s->errorhandler();
-	return makesockaddr(s->sock_fd, (struct sockaddr *) &addrbuf, addrlen,
+	return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
 			    s->sock_proto);
 }
 
@@ -2104,11 +2098,11 @@
 		return NULL;
 	memset(&addrbuf, 0, addrlen);
 	Py_BEGIN_ALLOW_THREADS
-	res = getpeername(s->sock_fd, (struct sockaddr *) &addrbuf, &addrlen);
+	res = getpeername(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
 	Py_END_ALLOW_THREADS
 	if (res < 0)
 		return s->errorhandler();
-	return makesockaddr(s->sock_fd, (struct sockaddr *) &addrbuf, addrlen,
+	return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
 			    s->sock_proto);
 }
 
@@ -2443,14 +2437,14 @@
 #ifndef MS_WINDOWS
 #if defined(PYOS_OS2) && !defined(PYCC_GCC)
 		n = recvfrom(s->sock_fd, cbuf, len, flags,
-			     (struct sockaddr *) &addrbuf, &addrlen);
+			     SAS2SA(&addrbuf), &addrlen);
 #else
 		n = recvfrom(s->sock_fd, cbuf, len, flags,
 			     (void *) &addrbuf, &addrlen);
 #endif
 #else
 		n = recvfrom(s->sock_fd, cbuf, len, flags,
-			     (struct sockaddr *) &addrbuf, &addrlen);
+			     SAS2SA(&addrbuf), &addrlen);
 #endif
 	}
 	Py_END_ALLOW_THREADS
@@ -2464,7 +2458,7 @@
                 return -1;
 	}
 
-	if (!(*addr = makesockaddr(s->sock_fd, (struct sockaddr *) &addrbuf,
+	if (!(*addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
 				   addrlen, s->sock_proto)))
 		return -1;
 
@@ -2664,7 +2658,7 @@
 {
 	PyObject *addro;
 	char *buf;
-	struct sockaddr *addr;
+	sock_addr_t addrbuf;
 	int addrlen, len, n = -1, flags, timeout;
 
 	flags = 0;
@@ -2675,16 +2669,16 @@
 			return NULL;
 	}
 
-	if (!getsockaddrarg(s, addro, &addr, &addrlen))
-		return NULL;
-
 	if (!IS_SELECTABLE(s))
 		return select_error();
 
+	if (!getsockaddrarg(s, addro, SAS2SA(&addrbuf), &addrlen))
+		return NULL;
+
 	Py_BEGIN_ALLOW_THREADS
 	timeout = internal_select(s, 1);
 	if (!timeout)
-		n = sendto(s->sock_fd, buf, len, flags, addr, addrlen);
+		n = sendto(s->sock_fd, buf, len, flags, SAS2SA(&addrbuf), addrlen);
 	Py_END_ALLOW_THREADS
 
 	if (timeout == 1) {
@@ -2973,10 +2967,9 @@
 
 	if (!PyArg_ParseTuple(args, "s:gethostbyname", &name))
 		return NULL;
-	if (setipaddr(name, (struct sockaddr *)&addrbuf,  sizeof(addrbuf), AF_INET) < 0)
+	if (setipaddr(name, SAS2SA(&addrbuf),  sizeof(addrbuf), AF_INET) < 0)
 		return NULL;
-	return makeipaddr((struct sockaddr *)&addrbuf,
-		sizeof(struct sockaddr_in));
+	return makeipaddr(SAS2SA(&addrbuf), sizeof(struct sockaddr_in));
 }
 
 PyDoc_STRVAR(gethostbyname_doc,

Modified: python/branches/p3yk-noslice/Modules/socketmodule.h
==============================================================================
--- python/branches/p3yk-noslice/Modules/socketmodule.h	(original)
+++ python/branches/p3yk-noslice/Modules/socketmodule.h	Fri Dec 15 05:21:50 2006
@@ -114,7 +114,6 @@
 	int sock_family;	/* Address family, e.g., AF_INET */
 	int sock_type;		/* Socket type, e.g., SOCK_STREAM */
 	int sock_proto;		/* Protocol type, usually 0 */
-	sock_addr_t sock_addr;	/* Socket address */
 	PyObject *(*errorhandler)(void); /* Error handler; checks
 					    errno, returns NULL and
 					    sets a Python exception */

Modified: python/branches/p3yk-noslice/Modules/symtablemodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/symtablemodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/symtablemodule.c	Fri Dec 15 05:21:50 2006
@@ -73,8 +73,7 @@
 	PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock);
 
 	PyModule_AddIntConstant(m, "OPT_IMPORT_STAR", OPT_IMPORT_STAR);
-	PyModule_AddIntConstant(m, "OPT_EXEC", OPT_EXEC);
-	PyModule_AddIntConstant(m, "OPT_BARE_EXEC", OPT_BARE_EXEC);
+	PyModule_AddIntConstant(m, "OPT_TOPLEVEL", OPT_TOPLEVEL);
 
 	PyModule_AddIntConstant(m, "LOCAL", LOCAL);
 	PyModule_AddIntConstant(m, "GLOBAL_EXPLICIT", GLOBAL_EXPLICIT);

Modified: python/branches/p3yk-noslice/Modules/threadmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/threadmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/threadmodule.c	Fri Dec 15 05:21:50 2006
@@ -25,6 +25,7 @@
 static void
 lock_dealloc(lockobject *self)
 {
+	assert(self->lock_lock);
 	/* Unlock the lock so it's safe to free it */
 	PyThread_acquire_lock(self->lock_lock, 0);
 	PyThread_release_lock(self->lock_lock);
@@ -696,6 +697,8 @@
 	/* Initialize types: */
 	if (PyType_Ready(&localtype) < 0)
 		return;
+	if (PyType_Ready(&Locktype) < 0)
+		return;
 
 	/* Create the module and add the functions */
 	m = Py_InitModule3("thread", thread_methods, thread_doc);

Modified: python/branches/p3yk-noslice/Modules/unicodedata.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/unicodedata.c	(original)
+++ python/branches/p3yk-noslice/Modules/unicodedata.c	Fri Dec 15 05:21:50 2006
@@ -75,7 +75,7 @@
         {NULL}
 };
 
-// forward declaration
+/* forward declaration */
 static PyTypeObject UCD_Type;
 
 static PyObject*

Modified: python/branches/p3yk-noslice/Objects/abstract.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/abstract.c	(original)
+++ python/branches/p3yk-noslice/Objects/abstract.c	Fri Dec 15 05:21:50 2006
@@ -1491,20 +1491,18 @@
 		if (cmp > 0) {
 			switch (operation) {
 			case PY_ITERSEARCH_COUNT:
-				++n;
-				if (n <= 0) {
-					/* XXX(nnorwitz): int means ssize_t */
+				if (n == PY_SSIZE_T_MAX) {
 					PyErr_SetString(PyExc_OverflowError,
-				                "count exceeds C int size");
+					       "count exceeds C integer size");
 					goto Fail;
 				}
+				++n;
 				break;
 
 			case PY_ITERSEARCH_INDEX:
 				if (wrapped) {
-					/* XXX(nnorwitz): int means ssize_t */
 					PyErr_SetString(PyExc_OverflowError,
-			                	"index exceeds C int size");
+					       "index exceeds C integer size");
 					goto Fail;
 				}
 				goto Done;
@@ -1519,9 +1517,9 @@
 		}
 
 		if (operation == PY_ITERSEARCH_INDEX) {
-			++n;
-			if (n <= 0)
+			if (n == PY_SSIZE_T_MAX)
 				wrapped = 1;
+			++n;
 		}
 	}
 

Modified: python/branches/p3yk-noslice/Objects/boolobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/boolobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/boolobject.c	Fri Dec 15 05:21:50 2006
@@ -112,7 +112,7 @@
 	0,			/* nb_negative */
 	0,			/* nb_positive */
 	0,			/* nb_absolute */
-	0,			/* nb_nonzero */
+	0,			/* nb_bool */
 	0,			/* nb_invert */
 	0,			/* nb_lshift */
 	0,			/* nb_rshift */

Modified: python/branches/p3yk-noslice/Objects/bufferobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/bufferobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/bufferobject.c	Fri Dec 15 05:21:50 2006
@@ -252,23 +252,65 @@
 }
 
 static int
-buffer_compare(PyBufferObject *self, PyBufferObject *other)
+get_bufx(PyObject *obj, void **ptr, Py_ssize_t *size)
 {
-	void *p1, *p2;
-	Py_ssize_t len_self, len_other, min_len;
-	int cmp;
+	PyBufferProcs *bp;
 
-	if (!get_buf(self, &p1, &len_self, ANY_BUFFER))
-		return -1;
-	if (!get_buf(other, &p2, &len_other, ANY_BUFFER))
-		return -1;
-	min_len = (len_self < len_other) ? len_self : len_other;
-	if (min_len > 0) {
-		cmp = memcmp(p1, p2, min_len);
-		if (cmp != 0)
-			return cmp < 0 ? -1 : 1;
+	if (PyBuffer_Check(obj)) {
+		if (!get_buf((PyBufferObject *)obj, ptr, size, ANY_BUFFER)) {
+			PyErr_Clear();
+			return 0;
+		}
+		else
+			return 1;
+	}
+	bp = obj->ob_type->tp_as_buffer;
+	if (bp == NULL ||
+	    bp->bf_getreadbuffer == NULL ||
+	    bp->bf_getsegcount == NULL)
+		return 0;
+	if ((*bp->bf_getsegcount)(obj, NULL) != 1)
+		return 0;
+	*size = (*bp->bf_getreadbuffer)(obj, 0, ptr);
+	if (*size < 0) {
+		PyErr_Clear();
+		return 0;
 	}
-	return (len_self < len_other) ? -1 : (len_self > len_other) ? 1 : 0;
+	return 1;
+}
+
+static PyObject *
+buffer_richcompare(PyObject *self, PyObject *other, int op)
+{
+	void *p1, *p2;
+	Py_ssize_t len1, len2, min_len;
+	int cmp, ok;
+
+	ok = 1;
+	if (!get_bufx(self, &p1, &len1))
+		ok = 0;
+	if (!get_bufx(other, &p2, &len2))
+		ok = 0;
+	if (!ok) {
+		/* If we can't get the buffers,
+		   == and != are still defined
+		   (and the objects are unequal) */
+		PyObject *result;
+		if (op == Py_EQ)
+			result = Py_False;
+		else if (op == Py_NE)
+			result = Py_True;
+		else
+			result = Py_NotImplemented;
+		Py_INCREF(result);
+		return result;
+	}
+	min_len = (len1 < len2) ? len1 : len2;
+	cmp = memcmp(p1, p2, min_len);
+	if (cmp == 0)
+		cmp = (len1 < len2) ? -1 :
+		      (len1 > len2) ? 1 : 0;
+	return Py_CmpToRich(op, cmp);
 }
 
 static PyObject *
@@ -821,7 +863,7 @@
 	0,					/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)buffer_compare,		/* tp_compare */
+	0,					/* tp_compare */
 	(reprfunc)buffer_repr,			/* tp_repr */
 	0,					/* tp_as_number */
 	&buffer_as_sequence,			/* tp_as_sequence */
@@ -836,7 +878,7 @@
 	buffer_doc,				/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	buffer_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */

Modified: python/branches/p3yk-noslice/Objects/bytesobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/bytesobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/bytesobject.c	Fri Dec 15 05:21:50 2006
@@ -365,6 +365,8 @@
 
     if (lo < 0)
         lo = 0;
+    if (hi < lo)
+        hi = lo;
     if (hi > self->ob_size)
         hi = self->ob_size;
 

Modified: python/branches/p3yk-noslice/Objects/cellobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/cellobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/cellobject.c	Fri Dec 15 05:21:50 2006
@@ -49,18 +49,6 @@
 	PyObject_GC_Del(op);
 }
 
-static int
-cell_compare(PyCellObject *a, PyCellObject *b)
-{
-	if (a->ob_ref == NULL) {
-		if (b->ob_ref == NULL)
-			return 0;
-		return -1;
-	} else if (b->ob_ref == NULL)
-		return 1;
-	return PyObject_Compare(a->ob_ref, b->ob_ref);
-}
-
 static PyObject *
 cell_repr(PyCellObject *op)
 {
@@ -108,7 +96,7 @@
 	0,                                      /* tp_print */
 	0,	                                /* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)cell_compare,			/* tp_compare */
+	0,					/* tp_compare */
 	(reprfunc)cell_repr,			/* tp_repr */
 	0,					/* tp_as_number */
 	0,			                /* tp_as_sequence */

Modified: python/branches/p3yk-noslice/Objects/classobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/classobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/classobject.c	Fri Dec 15 05:21:50 2006
@@ -80,7 +80,7 @@
 
 #define OFF(x) offsetof(PyMethodObject, x)
 
-static PyMemberDef instancemethod_memberlist[] = {
+static PyMemberDef method_memberlist[] = {
 	{"im_class",	T_OBJECT,	OFF(im_class),	READONLY|RESTRICTED,
 	 "the class associated with a method"},
 	{"im_func",	T_OBJECT,	OFF(im_func),	READONLY|RESTRICTED,
@@ -96,7 +96,7 @@
    should only be used for the class, not for instances */
 
 static PyObject *
-instancemethod_get_doc(PyMethodObject *im, void *context)
+method_get_doc(PyMethodObject *im, void *context)
 {
 	static PyObject *docstr;
 	if (docstr == NULL) {
@@ -107,13 +107,13 @@
 	return PyObject_GetAttr(im->im_func, docstr);
 }
 
-static PyGetSetDef instancemethod_getset[] = {
-	{"__doc__", (getter)instancemethod_get_doc, NULL, NULL},
+static PyGetSetDef method_getset[] = {
+	{"__doc__", (getter)method_get_doc, NULL, NULL},
 	{0}
 };
 
 static PyObject *
-instancemethod_getattro(PyObject *obj, PyObject *name)
+method_getattro(PyObject *obj, PyObject *name)
 {
 	PyMethodObject *im = (PyMethodObject *)obj;
 	PyTypeObject *tp = obj->ob_type;
@@ -140,19 +140,21 @@
 	return PyObject_GetAttr(im->im_func, name);
 }
 
-PyDoc_STRVAR(instancemethod_doc,
-"instancemethod(function, instance, class)\n\
+PyDoc_STRVAR(method_doc,
+"method(function, instance, class)\n\
 \n\
 Create an instance method object.");
 
 static PyObject *
-instancemethod_new(PyTypeObject* type, PyObject* args, PyObject *kw)
+method_new(PyTypeObject* type, PyObject* args, PyObject *kw)
 {
 	PyObject *func;
 	PyObject *self;
 	PyObject *classObj = NULL;
 
-	if (!PyArg_UnpackTuple(args, "instancemethod", 2, 3,
+	if (!_PyArg_NoKeywords("instancemethod", kw))
+		return NULL;
+	if (!PyArg_UnpackTuple(args, "method", 2, 3,
 			      &func, &self, &classObj))
 		return NULL;
 	if (!PyCallable_Check(func)) {
@@ -172,7 +174,7 @@
 }
 
 static void
-instancemethod_dealloc(register PyMethodObject *im)
+method_dealloc(register PyMethodObject *im)
 {
 	_PyObject_GC_UNTRACK(im);
 	if (im->im_weakreflist != NULL)
@@ -184,24 +186,42 @@
 	free_list = im;
 }
 
-static int
-instancemethod_compare(PyMethodObject *a, PyMethodObject *b)
+static PyObject *
+method_richcompare(PyObject *self, PyObject *other, int op)
 {
-	int cmp;
-	cmp = PyObject_Compare(a->im_func, b->im_func);
-	if (cmp)
-		return cmp;
-
-	if (a->im_self == b->im_self)
-		return 0;
-	if (a->im_self == NULL || b->im_self == NULL)
-		return (a->im_self < b->im_self) ? -1 : 1;
+	PyMethodObject *a, *b;
+	PyObject *res;
+	int eq;
+
+	if ((op != Py_EQ && op != Py_NE) ||
+	    !PyMethod_Check(self) ||
+	    !PyMethod_Check(other))
+	{
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
+	}
+	a = (PyMethodObject *)self;
+	b = (PyMethodObject *)other;
+	eq = PyObject_RichCompareBool(a->im_func, b->im_func, Py_EQ);
+	if (eq == 1) {
+		if (a->im_self == NULL || b->im_self == NULL)
+			eq = a->im_self == b->im_self;
+		else
+			eq = PyObject_RichCompareBool(a->im_self, b->im_self,
+						      Py_EQ);
+	}
+	if (eq < 0)
+		return NULL;
+	if (op == Py_EQ)
+		res = eq ? Py_True : Py_False;
 	else
-		return PyObject_Compare(a->im_self, b->im_self);
+		res = eq ? Py_False : Py_True;
+	Py_INCREF(res);
+	return res;
 }
 
 static PyObject *
-instancemethod_repr(PyMethodObject *a)
+method_repr(PyMethodObject *a)
 {
 	PyObject *self = a->im_self;
 	PyObject *func = a->im_func;
@@ -261,7 +281,7 @@
 }
 
 static long
-instancemethod_hash(PyMethodObject *a)
+method_hash(PyMethodObject *a)
 {
 	long x, y;
 	if (a->im_self == NULL)
@@ -280,7 +300,7 @@
 }
 
 static int
-instancemethod_traverse(PyMethodObject *im, visitproc visit, void *arg)
+method_traverse(PyMethodObject *im, visitproc visit, void *arg)
 {
 	Py_VISIT(im->im_func);
 	Py_VISIT(im->im_self);
@@ -333,7 +353,7 @@
 }
 
 static PyObject *
-instancemethod_call(PyObject *func, PyObject *arg, PyObject *kw)
+method_call(PyObject *func, PyObject *arg, PyObject *kw)
 {
 	PyObject *self = PyMethod_GET_SELF(func);
 	PyObject *klass = PyMethod_GET_CLASS(func);
@@ -392,7 +412,7 @@
 }
 
 static PyObject *
-instancemethod_descr_get(PyObject *meth, PyObject *obj, PyObject *cls)
+method_descr_get(PyObject *meth, PyObject *obj, PyObject *cls)
 {
 	/* Don't rebind an already bound method, or an unbound method
 	   of a class that's not a base class of cls. */
@@ -420,43 +440,43 @@
 PyTypeObject PyMethod_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,
-	"instancemethod",
+	"method",
 	sizeof(PyMethodObject),
 	0,
-	(destructor)instancemethod_dealloc,	/* tp_dealloc */
+	(destructor)method_dealloc,		/* tp_dealloc */
 	0,					/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)instancemethod_compare,	/* tp_compare */
-	(reprfunc)instancemethod_repr,		/* tp_repr */
+	0,					/* tp_compare */
+	(reprfunc)method_repr,			/* tp_repr */
 	0,					/* tp_as_number */
 	0,					/* tp_as_sequence */
 	0,					/* tp_as_mapping */
-	(hashfunc)instancemethod_hash,		/* tp_hash */
-	instancemethod_call,			/* tp_call */
+	(hashfunc)method_hash,			/* tp_hash */
+	method_call,				/* tp_call */
 	0,					/* tp_str */
-	instancemethod_getattro,		/* tp_getattro */
+	method_getattro,			/* tp_getattro */
 	PyObject_GenericSetAttr,		/* tp_setattro */
 	0,					/* tp_as_buffer */
 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
-	instancemethod_doc,			/* tp_doc */
-	(traverseproc)instancemethod_traverse,	/* tp_traverse */
+	method_doc,				/* tp_doc */
+	(traverseproc)method_traverse,		/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	method_richcompare,			/* tp_richcompare */
  	offsetof(PyMethodObject, im_weakreflist), /* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */
 	0,					/* tp_methods */
-	instancemethod_memberlist,		/* tp_members */
-	instancemethod_getset,			/* tp_getset */
+	method_memberlist,			/* tp_members */
+	method_getset,				/* tp_getset */
 	0,					/* tp_base */
 	0,					/* tp_dict */
-	instancemethod_descr_get,		/* tp_descr_get */
+	method_descr_get,			/* tp_descr_get */
 	0,					/* tp_descr_set */
 	0,					/* tp_dictoffset */
 	0,					/* tp_init */
 	0,					/* tp_alloc */
-	instancemethod_new,			/* tp_new */
+	method_new,				/* tp_new */
 };
 
 /* Clear out the free list */

Modified: python/branches/p3yk-noslice/Objects/codeobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/codeobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/codeobject.c	Fri Dec 15 05:21:50 2006
@@ -41,7 +41,8 @@
 
 
 PyCodeObject *
-PyCode_New(int argcount, int nlocals, int stacksize, int flags,
+PyCode_New(int argcount, int kwonlyargcount,
+	   int nlocals, int stacksize, int flags,
 	   PyObject *code, PyObject *consts, PyObject *names,
 	   PyObject *varnames, PyObject *freevars, PyObject *cellvars,
 	   PyObject *filename, PyObject *name, int firstlineno,
@@ -80,6 +81,7 @@
 	co = PyObject_NEW(PyCodeObject, &PyCode_Type);
 	if (co != NULL) {
 		co->co_argcount = argcount;
+		co->co_kwonlyargcount = kwonlyargcount;
 		co->co_nlocals = nlocals;
 		co->co_stacksize = stacksize;
 		co->co_flags = flags;
@@ -112,6 +114,7 @@
 
 static PyMemberDef code_memberlist[] = {
 	{"co_argcount",	T_INT,		OFF(co_argcount),	READONLY},
+	{"co_kwonlyargcount",	T_INT,	OFF(co_kwonlyargcount),	READONLY},
 	{"co_nlocals",	T_INT,		OFF(co_nlocals),	READONLY},
 	{"co_stacksize",T_INT,		OFF(co_stacksize),	READONLY},
 	{"co_flags",	T_INT,		OFF(co_flags),		READONLY},
@@ -182,6 +185,7 @@
 code_new(PyTypeObject *type, PyObject *args, PyObject *kw)
 {
 	int argcount;
+	int kwonlyargcount;
 	int nlocals;
 	int stacksize;
 	int flags;
@@ -197,8 +201,9 @@
 	int firstlineno;
 	PyObject *lnotab;
 
-	if (!PyArg_ParseTuple(args, "iiiiSO!O!O!SSiS|O!O!:code",
-			      &argcount, &nlocals, &stacksize, &flags,
+	if (!PyArg_ParseTuple(args, "iiiiiSO!O!O!SSiS|O!O!:code",
+			      &argcount, &kwonlyargcount,
+				  &nlocals, &stacksize, &flags,
 			      &code,
 			      &PyTuple_Type, &consts,
 			      &PyTuple_Type, &names,
@@ -216,6 +221,12 @@
 		goto cleanup;
 	}
 
+	if (kwonlyargcount < 0) {
+		PyErr_SetString(
+			PyExc_ValueError,
+			"code: kwonlyargcount must not be negative");
+		goto cleanup;
+	}
 	if (nlocals < 0) {
 		PyErr_SetString(
 			PyExc_ValueError,
@@ -242,7 +253,8 @@
 	if (ourcellvars == NULL)
 		goto cleanup;
 
-	co = (PyObject *)PyCode_New(argcount, nlocals, stacksize, flags,
+	co = (PyObject *)PyCode_New(argcount, kwonlyargcount,
+				    nlocals, stacksize, flags,
 				    code, consts, ournames, ourvarnames,
 				    ourfreevars, ourcellvars, filename,
 				    name, firstlineno, lnotab);
@@ -291,40 +303,65 @@
 	return PyString_FromString(buf);
 }
 
-static int
-code_compare(PyCodeObject *co, PyCodeObject *cp)
+static PyObject *
+code_richcompare(PyObject *self, PyObject *other, int op)
 {
-	int cmp;
-	cmp = PyObject_Compare(co->co_name, cp->co_name);
-	if (cmp) return cmp;
-	cmp = co->co_argcount - cp->co_argcount;
-	if (cmp) goto normalize;
-	cmp = co->co_nlocals - cp->co_nlocals;
-	if (cmp) goto normalize;
-	cmp = co->co_flags - cp->co_flags;
-	if (cmp) goto normalize;
-	cmp = co->co_firstlineno - cp->co_firstlineno;
-	if (cmp) goto normalize;
-	cmp = PyObject_Compare(co->co_code, cp->co_code);
-	if (cmp) return cmp;
-	cmp = PyObject_Compare(co->co_consts, cp->co_consts);
-	if (cmp) return cmp;
-	cmp = PyObject_Compare(co->co_names, cp->co_names);
-	if (cmp) return cmp;
-	cmp = PyObject_Compare(co->co_varnames, cp->co_varnames);
-	if (cmp) return cmp;
-	cmp = PyObject_Compare(co->co_freevars, cp->co_freevars);
-	if (cmp) return cmp;
-	cmp = PyObject_Compare(co->co_cellvars, cp->co_cellvars);
-	return cmp;
-
- normalize:
-	if (cmp > 0)
-		return 1;
-	else if (cmp < 0)
-		return -1;
+	PyCodeObject *co, *cp;
+	int eq;
+	PyObject *res;
+
+	if ((op != Py_EQ && op != Py_NE) ||
+	    !PyCode_Check(self) ||
+	    !PyCode_Check(other)) {
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
+	}
+
+	co = (PyCodeObject *)self;
+	cp = (PyCodeObject *)other;
+
+	eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Py_EQ);
+	if (eq <= 0) goto unequal;
+	eq = co->co_argcount == cp->co_argcount;
+	if (!eq) goto unequal;
+	eq = co->co_kwonlyargcount == cp->co_kwonlyargcount;
+	if (!eq) goto unequal;
+	eq = co->co_nlocals == cp->co_nlocals;
+	if (!eq) goto unequal;
+	eq = co->co_flags == cp->co_flags;
+	if (!eq) goto unequal;
+	eq = co->co_firstlineno == cp->co_firstlineno;
+	if (!eq) goto unequal;
+	eq = PyObject_RichCompareBool(co->co_code, cp->co_code, Py_EQ);
+	if (eq <= 0) goto unequal;
+	eq = PyObject_RichCompareBool(co->co_consts, cp->co_consts, Py_EQ);
+	if (eq <= 0) goto unequal;
+	eq = PyObject_RichCompareBool(co->co_names, cp->co_names, Py_EQ);
+	if (eq <= 0) goto unequal;
+	eq = PyObject_RichCompareBool(co->co_varnames, cp->co_varnames, Py_EQ);
+	if (eq <= 0) goto unequal;
+	eq = PyObject_RichCompareBool(co->co_freevars, cp->co_freevars, Py_EQ);
+	if (eq <= 0) goto unequal;
+	eq = PyObject_RichCompareBool(co->co_cellvars, cp->co_cellvars, Py_EQ);
+	if (eq <= 0) goto unequal;
+
+	if (op == Py_EQ)
+		res = Py_True;
+	else
+		res = Py_False;
+	goto done;
+
+  unequal:
+	if (eq < 0)
+		return NULL;
+	if (op == Py_NE)
+		res = Py_True;
 	else
-		return 0;
+		res = Py_False;
+
+  done:
+	Py_INCREF(res);
+	return res;
 }
 
 static long
@@ -346,7 +383,8 @@
 	h6 = PyObject_Hash(co->co_cellvars);
 	if (h6 == -1) return -1;
 	h = h0 ^ h1 ^ h2 ^ h3 ^ h4 ^ h5 ^ h6 ^
-		co->co_argcount ^ co->co_nlocals ^ co->co_flags;
+		co->co_argcount ^ co->co_kwonlyargcount ^
+		co->co_nlocals ^ co->co_flags;
 	if (h == -1) h = -2;
 	return h;
 }
@@ -363,7 +401,7 @@
 	0,				/* tp_print */
 	0, 				/* tp_getattr */
 	0,				/* tp_setattr */
-	(cmpfunc)code_compare, 		/* tp_compare */
+	0,		 		/* tp_compare */
 	(reprfunc)code_repr,		/* tp_repr */
 	0,				/* tp_as_number */
 	0,				/* tp_as_sequence */
@@ -378,7 +416,7 @@
 	code_doc,			/* tp_doc */
 	0,				/* tp_traverse */
 	0,				/* tp_clear */
-	0,				/* tp_richcompare */
+	code_richcompare,		/* tp_richcompare */
 	0,				/* tp_weaklistoffset */
 	0,				/* tp_iter */
 	0,				/* tp_iternext */

Modified: python/branches/p3yk-noslice/Objects/complexobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/complexobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/complexobject.c	Fri Dec 15 05:21:50 2006
@@ -568,7 +568,7 @@
 }
 
 static int
-complex_nonzero(PyComplexObject *v)
+complex_bool(PyComplexObject *v)
 {
 	return v->cval.real != 0.0 || v->cval.imag != 0.0;
 }
@@ -938,7 +938,7 @@
 	(unaryfunc)complex_neg,			/* nb_negative */
 	(unaryfunc)complex_pos,			/* nb_positive */
 	(unaryfunc)complex_abs,			/* nb_absolute */
-	(inquiry)complex_nonzero,		/* nb_nonzero */
+	(inquiry)complex_bool,			/* nb_bool */
 	0,					/* nb_invert */
 	0,					/* nb_lshift */
 	0,					/* nb_rshift */

Modified: python/branches/p3yk-noslice/Objects/dictobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/dictobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/dictobject.c	Fri Dec 15 05:21:50 2006
@@ -12,6 +12,20 @@
 typedef PyDictEntry dictentry;
 typedef PyDictObject dictobject;
 
+/* Set a key error with the specified argument, wrapping it in a
+ * tuple automatically so that tuple keys are not unpacked as the
+ * exception arguments. */
+static void
+set_key_error(PyObject *arg)
+{
+	PyObject *tup;
+	tup = PyTuple_Pack(1, arg);
+	if (!tup)
+		return; /* caller will expect error to be set anyway */
+	PyErr_SetObject(PyExc_KeyError, tup);
+	Py_DECREF(tup);
+}
+
 /* Define this out if you don't want conversion statistics on exit. */
 #undef SHOW_CONVERSION_COUNTS
 
@@ -24,11 +38,11 @@
 important hash functions (for strings and ints) are very regular in common
 cases:
 
->>> map(hash, (0, 1, 2, 3))
-[0, 1, 2, 3]
->>> map(hash, ("namea", "nameb", "namec", "named"))
-[-1658398457, -1658398460, -1658398459, -1658398462]
->>>
+  >>> map(hash, (0, 1, 2, 3))
+  [0, 1, 2, 3]
+  >>> map(hash, ("namea", "nameb", "namec", "named"))
+  [-1658398457, -1658398460, -1658398459, -1658398462]
+  >>>
 
 This isn't necessarily bad!  To the contrary, in a table of size 2**i, taking
 the low-order i bits as the initial table index is extremely fast, and there
@@ -39,9 +53,9 @@
 OTOH, when collisions occur, the tendency to fill contiguous slices of the
 hash table makes a good collision resolution strategy crucial.  Taking only
 the last i bits of the hash code is also vulnerable:  for example, consider
-[i << 16 for i in range(20000)] as a set of keys.  Since ints are their own
-hash codes, and this fits in a dict of size 2**15, the last 15 bits of every
-hash code are all 0:  they *all* map to the same table index.
+the list [i << 16 for i in range(20000)] as a set of keys.  Since ints are 
+their own hash codes, and this fits in a dict of size 2**15, the last 15 bits
+ of every hash code are all 0:  they *all* map to the same table index.
 
 But catering to unusual cases should not slow the usual ones, so we just take
 the last i bits anyway.  It's up to collision resolution to do the rest.  If
@@ -97,19 +111,19 @@
 best" in minimizing total collisions across experiments Tim Peters ran (on
 both normal and pathological cases), but 4 and 6 weren't significantly worse.
 
-Historical:  Reimer Behrends contributed the idea of using a polynomial-based
+Historical: Reimer Behrends contributed the idea of using a polynomial-based
 approach, using repeated multiplication by x in GF(2**n) where an irreducible
 polynomial for each table size was chosen such that x was a primitive root.
 Christian Tismer later extended that to use division by x instead, as an
 efficient way to get the high bits of the hash code into play.  This scheme
-also gave excellent collision statistics, but was more expensive:  two
-if-tests were required inside the loop; computing "the next" index took about
-the same number of operations but without as much potential parallelism
-(e.g., computing 5*j can go on at the same time as computing 1+perturb in the
-above, and then shifting perturb can be done while the table index is being
-masked); and the dictobject struct required a member to hold the table's
-polynomial.  In Tim's experiments the current scheme ran faster, produced
-equally good collision statistics, needed less code & used less memory.
+also gave excellent collision statistics, but was more expensive: two if-tests
+were required inside the loop; computing "the next" index took about the same
+number of operations but without as much potential parallelism (e.g.,
+computing 5*j can go on at the same time as computing 1+perturb in the above,
+and then shifting perturb can be done while the table index is being masked);
+and the dictobject struct required a member to hold the table's polynomial.
+In Tim's experiments the current scheme ran faster, produced equally good
+collision statistics, needed less code & used less memory.
 
 Theoretical Python 2.5 headache:  hash codes are only C "long", but
 sizeof(Py_ssize_t) > sizeof(long) may be possible.  In that case, and if a
@@ -223,9 +237,9 @@
 
 All arithmetic on hash should ignore overflow.
 
-(The details in this version are due to Tim Peters, building on many past
+The details in this version are due to Tim Peters, building on many past
 contributions by Reimer Behrends, Jyrki Alakuijala, Vladimir Marangozov and
-Christian Tismer).
+Christian Tismer.
 
 lookdict() is general-purpose, and may return NULL if (and only if) a
 comparison raises an exception (this was new in Python 2.5).
@@ -307,6 +321,8 @@
 		else if (ep->me_key == dummy && freeslot == NULL)
 			freeslot = ep;
 	}
+	assert(0);	/* NOT REACHED */
+	return 0;
 }
 
 /*
@@ -366,6 +382,8 @@
 		if (ep->me_key == dummy && freeslot == NULL)
 			freeslot = ep;
 	}
+	assert(0);	/* NOT REACHED */
+	return 0;
 }
 
 /*
@@ -582,6 +600,36 @@
 	return ep->me_value;
 }
 
+/* Variant of PyDict_GetItem() that doesn't suppress exceptions.
+   This returns NULL *with* an exception set if an exception occurred.
+   It returns NULL *without* an exception set if the key wasn't present.
+*/
+PyObject *
+PyDict_GetItemWithError(PyObject *op, PyObject *key)
+{
+	long hash;
+	dictobject *mp = (dictobject *)op;
+	dictentry *ep;
+
+	if (!PyDict_Check(op)) {
+		PyErr_BadInternalCall();
+		return NULL;
+	}
+	if (!PyString_CheckExact(key) ||
+	    (hash = ((PyStringObject *) key)->ob_shash) == -1)
+	{
+		hash = PyObject_Hash(key);
+		if (hash == -1) {
+			return NULL;
+		}
+	}
+
+	ep = (mp->ma_lookup)(mp, key, hash);
+	if (ep == NULL)
+		return NULL;
+	return ep->me_value;
+}
+
 /* CAUTION: PyDict_SetItem() must guarantee that it won't resize the
  * dictionary if it's merely replacing the value for an existing key.
  * This means that it's safe to loop over a dictionary with PyDict_Next()
@@ -661,7 +709,7 @@
 	if (ep == NULL)
 		return -1;
 	if (ep->me_value == NULL) {
-		PyErr_SetObject(PyExc_KeyError, key);
+		set_key_error(key);
 		return -1;
 	}
 	old_key = ep->me_key;
@@ -970,7 +1018,7 @@
 				return PyObject_CallFunctionObjArgs(missing,
 					(PyObject *)mp, key, NULL);
 		}
-		PyErr_SetObject(PyExc_KeyError, key);
+		set_key_error(key);
 		return NULL;
 	}
 	else
@@ -1432,136 +1480,6 @@
 	return dict_items((dictobject *)mp);
 }
 
-/* Subroutine which returns the smallest key in a for which b's value
-   is different or absent.  The value is returned too, through the
-   pval argument.  Both are NULL if no key in a is found for which b's status
-   differs.  The refcounts on (and only on) non-NULL *pval and function return
-   values must be decremented by the caller (characterize() increments them
-   to ensure that mutating comparison and PyDict_GetItem calls can't delete
-   them before the caller is done looking at them). */
-
-static PyObject *
-characterize(dictobject *a, dictobject *b, PyObject **pval)
-{
-	PyObject *akey = NULL; /* smallest key in a s.t. a[akey] != b[akey] */
-	PyObject *aval = NULL; /* a[akey] */
-	Py_ssize_t i;
-	int cmp;
-
-	for (i = 0; i <= a->ma_mask; i++) {
-		PyObject *thiskey, *thisaval, *thisbval;
-		if (a->ma_table[i].me_value == NULL)
-			continue;
-		thiskey = a->ma_table[i].me_key;
-		Py_INCREF(thiskey);  /* keep alive across compares */
-		if (akey != NULL) {
-			cmp = PyObject_RichCompareBool(akey, thiskey, Py_LT);
-			if (cmp < 0) {
-				Py_DECREF(thiskey);
-				goto Fail;
-			}
-			if (cmp > 0 ||
-			    i > a->ma_mask ||
-			    a->ma_table[i].me_value == NULL)
-			{
-				/* Not the *smallest* a key; or maybe it is
-				 * but the compare shrunk the dict so we can't
-				 * find its associated value anymore; or
-				 * maybe it is but the compare deleted the
-				 * a[thiskey] entry.
-				 */
-				Py_DECREF(thiskey);
-				continue;
-			}
-		}
-
-		/* Compare a[thiskey] to b[thiskey]; cmp <- true iff equal. */
-		thisaval = a->ma_table[i].me_value;
-		assert(thisaval);
-		Py_INCREF(thisaval);   /* keep alive */
-		thisbval = PyDict_GetItem((PyObject *)b, thiskey);
-		if (thisbval == NULL)
-			cmp = 0;
-		else {
-			/* both dicts have thiskey:  same values? */
-			cmp = PyObject_RichCompareBool(
-						thisaval, thisbval, Py_EQ);
-			if (cmp < 0) {
-		    		Py_DECREF(thiskey);
-		    		Py_DECREF(thisaval);
-		    		goto Fail;
-			}
-		}
-		if (cmp == 0) {
-			/* New winner. */
-			Py_XDECREF(akey);
-			Py_XDECREF(aval);
-			akey = thiskey;
-			aval = thisaval;
-		}
-		else {
-			Py_DECREF(thiskey);
-			Py_DECREF(thisaval);
-		}
-	}
-	*pval = aval;
-	return akey;
-
-Fail:
-	Py_XDECREF(akey);
-	Py_XDECREF(aval);
-	*pval = NULL;
-	return NULL;
-}
-
-static int
-dict_compare(dictobject *a, dictobject *b)
-{
-	PyObject *adiff, *bdiff, *aval, *bval;
-	int res;
-
-	/* Compare lengths first */
-	if (a->ma_used < b->ma_used)
-		return -1;	/* a is shorter */
-	else if (a->ma_used > b->ma_used)
-		return 1;	/* b is shorter */
-
-	/* Same length -- check all keys */
-	bdiff = bval = NULL;
-	adiff = characterize(a, b, &aval);
-	if (adiff == NULL) {
-		assert(!aval);
-		/* Either an error, or a is a subset with the same length so
-		 * must be equal.
-		 */
-		res = PyErr_Occurred() ? -1 : 0;
-		goto Finished;
-	}
-	bdiff = characterize(b, a, &bval);
-	if (bdiff == NULL && PyErr_Occurred()) {
-		assert(!bval);
-		res = -1;
-		goto Finished;
-	}
-	res = 0;
-	if (bdiff) {
-		/* bdiff == NULL "should be" impossible now, but perhaps
-		 * the last comparison done by the characterize() on a had
-		 * the side effect of making the dicts equal!
-		 */
-		res = PyObject_Compare(adiff, bdiff);
-	}
-	if (res == 0 && bval != NULL)
-		res = PyObject_Compare(aval, bval);
-
-Finished:
-	Py_XDECREF(adiff);
-	Py_XDECREF(bdiff);
-	Py_XDECREF(aval);
-	Py_XDECREF(bval);
-	return res;
-}
-
 /* Return 1 if dicts equal, 0 if not, -1 if error.
  * Gets out as soon as any difference is detected.
  * Uses only Py_EQ comparison.
@@ -1585,9 +1503,14 @@
 			/* temporarily bump aval's refcount to ensure it stays
 			   alive until we're done with it */
 			Py_INCREF(aval);
-			bval = PyDict_GetItem((PyObject *)b, key);
+			/* ditto for key */
+			Py_INCREF(key);
+			bval = PyDict_GetItemWithError((PyObject *)b, key);
+			Py_DECREF(key);
 			if (bval == NULL) {
 				Py_DECREF(aval);
+				if (PyErr_Occurred())
+					return -1;
 				return 0;
 			}
 			cmp = PyObject_RichCompareBool(aval, bval, Py_EQ);
@@ -1739,7 +1662,7 @@
 			Py_INCREF(deflt);
 			return deflt;
 		}
-		PyErr_SetObject(PyExc_KeyError, key);
+		set_key_error(key);
 		return NULL;
 	}
 	old_key = ep->me_key;
@@ -2028,7 +1951,7 @@
 	(printfunc)dict_print,			/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)dict_compare,			/* tp_compare */
+	0,					/* tp_compare */
 	(reprfunc)dict_repr,			/* tp_repr */
 	0,					/* tp_as_number */
 	&dict_as_sequence,			/* tp_as_sequence */

Modified: python/branches/p3yk-noslice/Objects/exceptions.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/exceptions.c	(original)
+++ python/branches/p3yk-noslice/Objects/exceptions.c	Fri Dec 15 05:21:50 2006
@@ -81,6 +81,7 @@
 static void
 BaseException_dealloc(PyBaseExceptionObject *self)
 {
+    _PyObject_GC_UNTRACK(self);
     BaseException_clear(self);
     self->ob_type->tp_free((PyObject *)self);
 }
@@ -174,27 +175,10 @@
     Py_RETURN_NONE;
 }
 
-#ifdef Py_USING_UNICODE
-/* while this method generates fairly uninspired output, it a least
- * guarantees that we can display exceptions that have unicode attributes
- */
-static PyObject *
-BaseException_unicode(PyBaseExceptionObject *self)
-{
-    if (PyTuple_GET_SIZE(self->args) == 0)
-        return PyUnicode_FromUnicode(NULL, 0);
-    if (PyTuple_GET_SIZE(self->args) == 1)
-        return PyObject_Unicode(PyTuple_GET_ITEM(self->args, 0));
-    return PyObject_Unicode(self->args);
-}
-#endif /* Py_USING_UNICODE */
 
 static PyMethodDef BaseException_methods[] = {
    {"__reduce__", (PyCFunction)BaseException_reduce, METH_NOARGS },
    {"__setstate__", (PyCFunction)BaseException_setstate, METH_O },
-#ifdef Py_USING_UNICODE
-   {"__unicode__", (PyCFunction)BaseException_unicode, METH_NOARGS },
-#endif
    {NULL, NULL, 0, NULL},
 };
 
@@ -206,12 +190,19 @@
     return PySequence_GetItem(self->args, index);
 }
 
+static PyObject *
+BaseException_getslice(PyBaseExceptionObject *self,
+			Py_ssize_t start, Py_ssize_t stop)
+{
+    return PySequence_GetSlice(self->args, start, stop);
+}
+
 static PySequenceMethods BaseException_as_sequence = {
     0,                      /* sq_length; */
     0,                      /* sq_concat; */
     0,                      /* sq_repeat; */
     (ssizeargfunc)BaseException_getitem,  /* sq_item; */
-    0,                      /* sq_slice; */
+    (ssizessizeargfunc)BaseException_getslice,  /* sq_slice; */
     0,                      /* sq_ass_item; */
     0,                      /* sq_ass_slice; */
     0,                      /* sq_contains; */
@@ -456,6 +447,7 @@
 static void
 SystemExit_dealloc(PySystemExitObject *self)
 {
+    _PyObject_GC_UNTRACK(self);
     SystemExit_clear(self);
     self->ob_type->tp_free((PyObject *)self);
 }
@@ -518,7 +510,7 @@
     if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
         return -1;
 
-    if (PyTuple_GET_SIZE(args) <= 1) {
+    if (PyTuple_GET_SIZE(args) <= 1 || PyTuple_GET_SIZE(args) > 3) {
         return 0;
     }
 
@@ -562,6 +554,7 @@
 static void
 EnvironmentError_dealloc(PyEnvironmentErrorObject *self)
 {
+    _PyObject_GC_UNTRACK(self);
     EnvironmentError_clear(self);
     self->ob_type->tp_free((PyObject *)self);
 }
@@ -760,6 +753,7 @@
 static void
 WindowsError_dealloc(PyWindowsErrorObject *self)
 {
+    _PyObject_GC_UNTRACK(self);
     WindowsError_clear(self);
     self->ob_type->tp_free((PyObject *)self);
 }
@@ -834,9 +828,9 @@
             return NULL;
         }
 
-        if (self->myerrno) {
-            Py_INCREF(self->myerrno);
-            PyTuple_SET_ITEM(tuple, 0, self->myerrno);
+        if (self->winerror) {
+            Py_INCREF(self->winerror);
+            PyTuple_SET_ITEM(tuple, 0, self->winerror);
         }
         else {
             Py_INCREF(Py_None);
@@ -858,7 +852,7 @@
         Py_DECREF(fmt);
         Py_DECREF(tuple);
     }
-    else if (self->myerrno && self->strerror) {
+    else if (self->winerror && self->strerror) {
         PyObject *fmt;
         PyObject *tuple;
 
@@ -872,9 +866,9 @@
             return NULL;
         }
 
-        if (self->myerrno) {
-            Py_INCREF(self->myerrno);
-            PyTuple_SET_ITEM(tuple, 0, self->myerrno);
+        if (self->winerror) {
+            Py_INCREF(self->winerror);
+            PyTuple_SET_ITEM(tuple, 0, self->winerror);
         }
         else {
             Py_INCREF(Py_None);
@@ -1035,6 +1029,7 @@
 static void
 SyntaxError_dealloc(PySyntaxErrorObject *self)
 {
+    _PyObject_GC_UNTRACK(self);
     SyntaxError_clear(self);
     self->ob_type->tp_free((PyObject *)self);
 }
@@ -1551,6 +1546,7 @@
 static void
 UnicodeError_dealloc(PyUnicodeErrorObject *self)
 {
+    _PyObject_GC_UNTRACK(self);
     UnicodeError_clear(self);
     self->ob_type->tp_free((PyObject *)self);
 }
@@ -1637,7 +1633,7 @@
 static PyTypeObject _PyExc_UnicodeEncodeError = {
     PyObject_HEAD_INIT(NULL)
     0,
-    "UnicodeEncodeError",
+    EXC_MODULE_NAME "UnicodeEncodeError",
     sizeof(PyUnicodeErrorObject), 0,
     (destructor)UnicodeError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     (reprfunc)UnicodeEncodeError_str, 0, 0, 0,
@@ -1812,7 +1808,7 @@
     (destructor)UnicodeError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     (reprfunc)UnicodeTranslateError_str, 0, 0, 0,
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
-    PyDoc_STR("Unicode decoding error."), (traverseproc)UnicodeError_traverse,
+    PyDoc_STR("Unicode translation error."), (traverseproc)UnicodeError_traverse,
     (inquiry)UnicodeError_clear, 0, 0, 0, 0, 0, UnicodeError_members,
     0, &_PyExc_UnicodeError, 0, 0, 0, offsetof(PyUnicodeErrorObject, dict),
     (initproc)UnicodeTranslateError_init, 0, BaseException_new,

Modified: python/branches/p3yk-noslice/Objects/fileobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/fileobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/fileobject.c	Fri Dec 15 05:21:50 2006
@@ -540,7 +540,7 @@
 	int whence;
 	int ret;
 	Py_off_t offset;
-	PyObject *offobj;
+	PyObject *offobj, *off_index;
 
 	if (f->f_fp == NULL)
 		return err_closed();
@@ -548,12 +548,25 @@
 	whence = 0;
 	if (!PyArg_ParseTuple(args, "O|i:seek", &offobj, &whence))
 		return NULL;
+	off_index = PyNumber_Index(offobj);
+	if (!off_index) {
+		if (!PyFloat_Check(offobj))
+			return NULL;
+		/* Deprecated in 2.6 */
+		PyErr_Clear();
+		if (PyErr_Warn(PyExc_DeprecationWarning,
+			       "integer argument expected, got float"))
+			return NULL;
+		off_index = offobj;
+		Py_INCREF(offobj);
+	}
 #if !defined(HAVE_LARGEFILE_SUPPORT)
-	offset = PyInt_AsLong(offobj);
+	offset = PyInt_AsLong(off_index);
 #else
-	offset = PyLong_Check(offobj) ?
-		PyLong_AsLongLong(offobj) : PyInt_AsLong(offobj);
+	offset = PyLong_Check(off_index) ?
+		PyLong_AsLongLong(off_index) : PyInt_AsLong(off_index);
 #endif
+	Py_DECREF(off_index);
 	if (PyErr_Occurred())
 		return NULL;
 
@@ -927,7 +940,7 @@
 		ndone += nnow;
 		ntodo -= nnow;
 	}
-	return PyInt_FromLong((long)ndone);
+	return PyInt_FromSsize_t(ndone);
 }
 
 /**************************************************************************
@@ -1006,6 +1019,7 @@
 	size_t nfree;	/* # of free buffer slots; pvend-pvfree */
 	size_t total_v_size;  /* total # of slots in buffer */
 	size_t increment;	/* amount to increment the buffer */
+	size_t prev_v_size;
 
 	/* Optimize for normal case:  avoid _PyString_Resize if at all
 	 * possible via first reading into stack buffer "buf".
@@ -1120,8 +1134,11 @@
 		/* expand buffer and try again */
 		assert(*(pvend-1) == '\0');
 		increment = total_v_size >> 2;	/* mild exponential growth */
+		prev_v_size = total_v_size;
 		total_v_size += increment;
-		if (total_v_size > PY_SSIZE_T_MAX) {
+		/* check for overflow */
+		if (total_v_size <= prev_v_size ||
+		    total_v_size > PY_SSIZE_T_MAX) {
 			PyErr_SetString(PyExc_OverflowError,
 			    "line is longer than a Python string can hold");
 			Py_DECREF(v);
@@ -1130,7 +1147,7 @@
 		if (_PyString_Resize(&v, (int)total_v_size) < 0)
 			return NULL;
 		/* overwrite the trailing null byte */
-		pvfree = BUF(v) + (total_v_size - increment - 1);
+		pvfree = BUF(v) + (prev_v_size - 1);
 	}
 	if (BUF(v) + total_v_size != p)
 		_PyString_Resize(&v, p - BUF(v));
@@ -2014,7 +2031,7 @@
                 if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|si:file", 
                                                  kwlist, &o_name, &mode, 
                                                  &bufsize))
-                        return -1;
+                        goto Error;
 
 		if (fill_file_fields(foself, NULL, o_name, mode,
 				     fclose) == NULL)

Modified: python/branches/p3yk-noslice/Objects/floatobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/floatobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/floatobject.c	Fri Dec 15 05:21:50 2006
@@ -837,7 +837,7 @@
 }
 
 static int
-float_nonzero(PyFloatObject *v)
+float_bool(PyFloatObject *v)
 {
 	return v->ob_fval != 0.0;
 }
@@ -1087,7 +1087,7 @@
 	(unaryfunc)float_neg, /*nb_negative*/
 	(unaryfunc)float_pos, /*nb_positive*/
 	(unaryfunc)float_abs, /*nb_absolute*/
-	(inquiry)float_nonzero, /*nb_nonzero*/
+	(inquiry)float_bool, /*nb_bool*/
 	0,		/*nb_invert*/
 	0,		/*nb_lshift*/
 	0,		/*nb_rshift*/

Modified: python/branches/p3yk-noslice/Objects/funcobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/funcobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/funcobject.c	Fri Dec 15 05:21:50 2006
@@ -24,6 +24,7 @@
 		op->func_name = ((PyCodeObject *)code)->co_name;
 		Py_INCREF(op->func_name);
 		op->func_defaults = NULL; /* No default arguments */
+		op->func_kwdefaults = NULL; /* No keyword only defaults */
 		op->func_closure = NULL;
 		consts = ((PyCodeObject *)code)->co_consts;
 		if (PyTuple_Size(consts) >= 1) {
@@ -122,6 +123,38 @@
 }
 
 PyObject *
+PyFunction_GetKwDefaults(PyObject *op)
+{
+	if (!PyFunction_Check(op)) {
+		PyErr_BadInternalCall();
+		return NULL;
+	}
+	return ((PyFunctionObject *) op) -> func_kwdefaults;
+}
+
+int
+PyFunction_SetKwDefaults(PyObject *op, PyObject *defaults)
+{
+	if (!PyFunction_Check(op)) {
+		PyErr_BadInternalCall();
+		return -1;
+	}
+	if (defaults == Py_None)
+		defaults = NULL;
+	else if (defaults && PyDict_Check(defaults)) {
+		Py_INCREF(defaults);
+	}
+	else {
+		PyErr_SetString(PyExc_SystemError,
+				"non-dict keyword only default args");
+		return -1;
+	}
+	Py_XDECREF(((PyFunctionObject *)op) -> func_kwdefaults);
+	((PyFunctionObject *) op) -> func_kwdefaults = defaults;
+	return 0;
+}
+
+PyObject *
 PyFunction_GetClosure(PyObject *op)
 {
 	if (!PyFunction_Check(op)) {
@@ -325,10 +358,49 @@
 	return 0;
 }
 
+static PyObject *
+func_get_kwdefaults(PyFunctionObject *op)
+{
+	if (restricted())
+		return NULL;
+	if (op->func_kwdefaults == NULL) {
+		Py_INCREF(Py_None);
+		return Py_None;
+	}
+	Py_INCREF(op->func_kwdefaults);
+	return op->func_kwdefaults;
+}
+
+static int
+func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
+{
+	PyObject *tmp;
+    
+	if (restricted())
+		return -1;
+
+	if (value == Py_None)
+		value = NULL;
+	/* Legal to del f.func_defaults.
+	 * Can only set func_kwdefaults to NULL or a dict. */
+	if (value != NULL && !PyDict_Check(value)) {
+		PyErr_SetString(PyExc_TypeError,
+			"func_kwdefaults must be set to a dict object");
+		return -1;
+	}
+	tmp = op->func_kwdefaults;
+	Py_XINCREF(value);
+	op->func_kwdefaults = value;
+	Py_XDECREF(tmp);
+	return 0;
+}
+
 static PyGetSetDef func_getsetlist[] = {
         {"func_code", (getter)func_get_code, (setter)func_set_code},
         {"func_defaults", (getter)func_get_defaults,
 	 (setter)func_set_defaults},
+	{"func_kwdefaults", (getter)func_get_kwdefaults,
+	 (setter)func_set_kwdefaults},
 	{"func_dict", (getter)func_get_dict, (setter)func_set_dict},
 	{"__dict__", (getter)func_get_dict, (setter)func_set_dict},
 	{"func_name", (getter)func_get_name, (setter)func_set_name},
@@ -519,6 +591,7 @@
 		PyFunction_GET_GLOBALS(func), (PyObject *)NULL,
 		&PyTuple_GET_ITEM(arg, 0), PyTuple_Size(arg),
 		k, nk, d, nd,
+		PyFunction_GET_KW_DEFAULTS(func),
 		PyFunction_GET_CLOSURE(func));
 
 	if (k != NULL)

Modified: python/branches/p3yk-noslice/Objects/intobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/intobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/intobject.c	Fri Dec 15 05:21:50 2006
@@ -446,6 +446,17 @@
 	return (i < j) ? -1 : (i > j) ? 1 : 0;
 }
 
+static PyObject *
+int_richcompare(PyObject *self, PyObject *other, int op)
+{
+	if (!PyInt_Check(self) || !PyInt_Check(other)) {
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
+	}
+	return Py_CmpToRich(op, int_compare((PyIntObject *)self, 
+					    (PyIntObject *)other));
+}
+
 static long
 int_hash(PyIntObject *v)
 {
@@ -546,6 +557,17 @@
 	}
 }
 
+/* Integer overflow checking for unary negation: on a 2's-complement
+ * box, -x overflows iff x is the most negative long.  In this case we
+ * get -x == x.  However, -x is undefined (by C) if x /is/ the most
+ * negative long (it's a signed overflow case), and some compilers care.
+ * So we cast x to unsigned long first.  However, then other compilers
+ * warn about applying unary minus to an unsigned operand.  Hence the
+ * weird "0-".
+ */
+#define UNARY_NEG_WOULD_OVERFLOW(x)	\
+	((x) < 0 && (unsigned long)(x) == 0-(unsigned long)(x))
+
 /* Return type of i_divmod */
 enum divmod_result {
 	DIVMOD_OK,		/* Correct result */
@@ -565,7 +587,7 @@
 		return DIVMOD_ERROR;
 	}
 	/* (-sys.maxint-1)/-1 is the only overflow case. */
-	if (y == -1 && x < 0 && x == -x)
+	if (y == -1 && UNARY_NEG_WOULD_OVERFLOW(x))
 		return DIVMOD_OVERFLOW;
 	xdivy = x / y;
 	xmody = x - xdivy * y;
@@ -733,10 +755,10 @@
 static PyObject *
 int_neg(PyIntObject *v)
 {
-	register long a, x;
+	register long a;
 	a = v->ob_ival;
-	x = -a;
-	if (a < 0 && x < 0) {
+        /* check for overflow */
+	if (UNARY_NEG_WOULD_OVERFLOW(a)) {
 		PyObject *o = PyLong_FromLong(a);
 		if (o != NULL) {
 			PyObject *result = PyNumber_Negative(o);
@@ -745,7 +767,7 @@
 		}
 		return NULL;
 	}
-	return PyInt_FromLong(x);
+	return PyInt_FromLong(-a);
 }
 
 static PyObject *
@@ -769,7 +791,7 @@
 }
 
 static int
-int_nonzero(PyIntObject *v)
+int_bool(PyIntObject *v)
 {
 	return v->ob_ival != 0;
 }
@@ -944,8 +966,25 @@
 		return PyInt_FromLong(0L);
 	if (base == -909)
 		return PyNumber_Int(x);
-	if (PyString_Check(x))
-		return PyInt_FromString(PyString_AS_STRING(x), NULL, base);
+	if (PyString_Check(x)) {
+		/* Since PyInt_FromString doesn't have a length parameter,
+		 * check here for possible NULs in the string. */
+		char *string = PyString_AS_STRING(x);
+		if (strlen(string) != PyString_Size(x)) {
+			/* create a repr() of the input string,
+			 * just like PyInt_FromString does */
+			PyObject *srepr;
+			srepr = PyObject_Repr(x);
+			if (srepr == NULL)
+				return NULL;
+			PyErr_Format(PyExc_ValueError,
+			     "invalid literal for int() with base %d: %s",
+			     base, PyString_AS_STRING(srepr));
+			Py_DECREF(srepr);
+			return NULL;
+		}
+		return PyInt_FromString(string, NULL, base);
+	}
 #ifdef Py_USING_UNICODE
 	if (PyUnicode_Check(x))
 		return PyInt_FromUnicode(PyUnicode_AS_UNICODE(x),
@@ -1023,14 +1062,14 @@
 	(unaryfunc)int_neg,	/*nb_negative*/
 	(unaryfunc)int_pos,	/*nb_positive*/
 	(unaryfunc)int_abs,	/*nb_absolute*/
-	(inquiry)int_nonzero,	/*nb_nonzero*/
+	(inquiry)int_bool,	/*nb_bool*/
 	(unaryfunc)int_invert,	/*nb_invert*/
 	(binaryfunc)int_lshift,	/*nb_lshift*/
 	(binaryfunc)int_rshift,	/*nb_rshift*/
 	(binaryfunc)int_and,	/*nb_and*/
 	(binaryfunc)int_xor,	/*nb_xor*/
 	(binaryfunc)int_or,	/*nb_or*/
-	0,		/*nb_coerce*/
+	0,			/*nb_coerce*/
 	(unaryfunc)int_int,	/*nb_int*/
 	(unaryfunc)int_long,	/*nb_long*/
 	(unaryfunc)int_float,	/*nb_float*/
@@ -1063,7 +1102,7 @@
 	(printfunc)int_print,			/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)int_compare,			/* tp_compare */
+	0,					/* tp_compare */
 	(reprfunc)int_repr,			/* tp_repr */
 	&int_as_number,				/* tp_as_number */
 	0,					/* tp_as_sequence */
@@ -1078,7 +1117,7 @@
 	int_doc,				/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	int_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */

Modified: python/branches/p3yk-noslice/Objects/iterobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/iterobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/iterobject.c	Fri Dec 15 05:21:50 2006
@@ -230,3 +230,176 @@
 	(iternextfunc)calliter_iternext,	/* tp_iternext */
 	0,					/* tp_methods */
 };
+
+
+/*********************** Zip Iterator **************************/
+/* Largely copied from itertools.c by Brian Holmes */
+
+typedef struct zipiterobject_t {
+	PyObject_HEAD
+	PyTupleObject *it_tuple;  /* Set to NULL when iterator is exhausted */
+        Py_ssize_t resultsize;	
+	PyTupleObject *result;	/* Reusable tuple for optimization */
+} zipiterobject;
+
+static PyTypeObject PyZipIter_Type; /* Forward */
+
+PyObject *
+_PyZip_CreateIter(PyObject* args)
+{
+	Py_ssize_t i;
+        Py_ssize_t tuplesize;
+	PyObject* ziptuple;
+	PyObject* result;
+	struct zipiterobject_t* zipiter;
+        
+        assert(PyTuple_Check(args));
+
+	if (PyZipIter_Type.ob_type == NULL) {
+		if (PyType_Ready(&PyZipIter_Type) < 0)
+			return NULL;
+	}
+
+	tuplesize = PySequence_Length((PyObject*) args);
+
+	ziptuple = PyTuple_New(tuplesize);
+	if (ziptuple == NULL)
+		return NULL;
+
+	for (i = 0; i < tuplesize; i++) {
+		PyObject *o = PyTuple_GET_ITEM(args, i);
+		PyObject *it = PyObject_GetIter(o);
+		if (it == NULL) {
+			/* XXX Should we do this?
+			if (PyErr_ExceptionMatches(PyExc_TypeError))
+				PyErr_Format(PyExc_TypeError, 
+				  "zip argument #%zd must support iteration",
+					I+1);
+			*/
+			Py_DECREF(ziptuple);
+			return NULL;
+		}
+		PyTuple_SET_ITEM(ziptuple, i, it);
+	}
+
+        /* create a reusable result holder */
+        result = PyTuple_New(tuplesize);
+        if (result == NULL) {
+                Py_DECREF(ziptuple);
+                return NULL;
+        }
+        for (i = 0; i < tuplesize; i++) {
+                Py_INCREF(Py_None);
+                PyTuple_SET_ITEM(result, i, Py_None);
+        }
+	
+	zipiter = PyObject_GC_New(zipiterobject, &PyZipIter_Type);
+	if (zipiter == NULL) {
+		Py_DECREF(ziptuple);
+		Py_DECREF(result);
+		return NULL;
+	}
+
+	zipiter->result = (PyTupleObject*) result;
+        zipiter->resultsize = tuplesize;
+	Py_INCREF(ziptuple);
+	zipiter->it_tuple = (PyTupleObject *) ziptuple;
+	_PyObject_GC_TRACK(zipiter);
+	return (PyObject *)zipiter;
+}
+
+static void
+zipiter_dealloc(zipiterobject *it)
+{
+	_PyObject_GC_UNTRACK(it);
+	Py_XDECREF(it->it_tuple);
+	Py_XDECREF(it->result);
+	PyObject_GC_Del(it);
+}
+
+static int
+zipiter_traverse(zipiterobject *it, visitproc visit, void *arg)
+{
+	Py_VISIT(it->it_tuple);
+	Py_VISIT(it->result);
+	return 0;
+}
+
+static PyObject *
+zipiter_next(zipiterobject *zit)
+{
+        Py_ssize_t i;
+        Py_ssize_t tuplesize = zit->resultsize;
+        PyObject *result = (PyObject*) zit->result;
+        PyObject *olditem;
+
+        if (tuplesize == 0)
+                return NULL;
+
+        if (result->ob_refcnt == 1) {
+		Py_INCREF(result);
+		for (i = 0; i < tuplesize; i++) {
+			PyObject *it = PyTuple_GET_ITEM(zit->it_tuple, i);
+			PyObject *item;
+			assert(PyIter_Check(it));
+			item = (*it->ob_type->tp_iternext)(it);
+			if (item == NULL) {
+				Py_DECREF(result);
+				return NULL;
+			}
+			olditem = PyTuple_GET_ITEM(result, i);
+			PyTuple_SET_ITEM(result, i, item);
+			Py_DECREF(olditem);
+		}
+	} else {
+		result = PyTuple_New(tuplesize);
+		if (result == NULL)
+			return NULL;
+		for (i = 0; i < tuplesize; i++) {
+			PyObject *it = PyTuple_GET_ITEM(zit->it_tuple, i);
+			PyObject *item;
+			assert(PyIter_Check(it));
+			item = (*it->ob_type->tp_iternext)(it);
+			if (item == NULL) {
+				Py_DECREF(result);
+				return NULL;
+			}
+			PyTuple_SET_ITEM(result, i, item);
+		}
+	}
+	return result;
+}
+
+static PyTypeObject PyZipIter_Type = {
+	PyObject_HEAD_INIT(0)
+	0,					/* ob_size */
+	"zipiterator",				/* tp_name */
+	sizeof(zipiterobject),			/* tp_basicsize */
+	0,					/* tp_itemsize */
+	/* methods */
+	(destructor)zipiter_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,/* tp_flags */
+	0,					/* tp_doc */
+	(traverseproc)zipiter_traverse,		/* tp_traverse */
+	0,					/* tp_clear */
+	0,					/* tp_richcompare */
+	0,					/* tp_weakzipoffset */
+	PyObject_SelfIter,			/* tp_iter */
+	(iternextfunc)zipiter_next,		/* tp_iternext */
+	0,					/* tp_methods */
+	0,					/* tp_members */
+};

Modified: python/branches/p3yk-noslice/Objects/listobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/listobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/listobject.c	Fri Dec 15 05:21:50 2006
@@ -863,17 +863,12 @@
 listpop(PyListObject *self, PyObject *args)
 {
 	Py_ssize_t i = -1;
-	PyObject *v, *arg = NULL;
+	PyObject *v;
 	int status;
 
-	if (!PyArg_UnpackTuple(args, "pop", 0, 1, &arg))
+	if (!PyArg_ParseTuple(args, "|n:pop", &i))
 		return NULL;
-	if (arg != NULL) {
-		if (PyInt_Check(arg))
-			i = PyInt_AS_LONG((PyIntObject*) arg);
-		else if (!PyArg_ParseTuple(args, "|n:pop", &i))
-   			return NULL;
-	}
+
 	if (self->ob_size == 0) {
 		/* Special-case most common failure cause */
 		PyErr_SetString(PyExc_IndexError, "pop from empty list");
@@ -951,9 +946,10 @@
 	if (res == NULL)
 		return -1;
 	if (!PyInt_Check(res)) {
+		PyErr_Format(PyExc_TypeError,
+			     "comparison function must return int, not %.200s",
+			     res->ob_type->tp_name);
 		Py_DECREF(res);
-		PyErr_SetString(PyExc_TypeError,
-				"comparison function must return int");
 		return -1;
 	}
 	i = PyInt_AsLong(res);
@@ -1971,6 +1967,26 @@
 	return (PyObject *)co;
 }
 
+static int
+is_default_cmp(PyObject *cmpfunc)
+{
+	PyCFunctionObject *f;
+	if (cmpfunc == NULL || cmpfunc == Py_None)
+		return 1;
+	if (!PyCFunction_Check(cmpfunc))
+		return 0;
+	f = (PyCFunctionObject *)cmpfunc;
+	if (f->m_self != NULL)
+		return 0;
+	if (!PyString_Check(f->m_module))
+		return 0;
+	if (strcmp(PyString_AS_STRING(f->m_module), "__builtin__") != 0)
+		return 0;
+	if (strcmp(f->m_ml->ml_name, "cmp") != 0)
+		return 0;
+	return 1;
+}
+
 /* An adaptive, stable, natural mergesort.  See listsort.txt.
  * Returns Py_None on success, NULL on error.  Even in case of error, the
  * list will be some permutation of its input state (nothing is lost or
@@ -2001,7 +2017,7 @@
 			kwlist, &compare, &keyfunc, &reverse))
 			return NULL;
 	}
-	if (compare == Py_None)
+	if (is_default_cmp(compare))
 		compare = NULL;
 	if (keyfunc == Py_None)
 		keyfunc = NULL;
@@ -2490,8 +2506,9 @@
 		}
 	}
 	else {
-		PyErr_SetString(PyExc_TypeError,
-				"list indices must be integers");
+		PyErr_Format(PyExc_TypeError,
+			     "list indices must be integers, not %.200s",
+			     item->ob_type->tp_name);
 		return NULL;
 	}
 }
@@ -2613,6 +2630,11 @@
 
 			garbage = (PyObject**)
 				PyMem_MALLOC(slicelength*sizeof(PyObject*));
+			if (!garbage) {
+				Py_DECREF(seq);
+				PyErr_NoMemory();
+				return -1;
+			}
 
 			selfitems = self->ob_item;
 			seqitems = PySequence_Fast_ITEMS(seq);
@@ -2635,8 +2657,9 @@
 		}
 	}
 	else {
-		PyErr_SetString(PyExc_TypeError,
-				"list indices must be integers");
+		PyErr_Format(PyExc_TypeError,
+			     "list indices must be integers, not %.200s",
+			     item->ob_type->tp_name);
 		return -1;
 	}
 }

Modified: python/branches/p3yk-noslice/Objects/longobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/longobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/longobject.c	Fri Dec 15 05:21:50 2006
@@ -1,5 +1,3 @@
-
-
 /* Long (arbitrary precision) integer object implementation */
 
 /* XXX The functional organization of this file is terrible */
@@ -193,6 +191,18 @@
 	return (PyObject *)v;
 }
 
+/* Checking for overflow in PyLong_AsLong is a PITA since C doesn't define
+ * anything about what happens when a signed integer operation overflows,
+ * and some compilers think they're doing you a favor by being "clever"
+ * then.  The bit pattern for the largest postive signed long is
+ * (unsigned long)LONG_MAX, and for the smallest negative signed long
+ * it is abs(LONG_MIN), which we could write -(unsigned long)LONG_MIN.
+ * However, some other compilers warn about applying unary minus to an
+ * unsigned operand.  Hence the weird "0-".
+ */
+#define PY_ABS_LONG_MIN		(0-(unsigned long)LONG_MIN)
+#define PY_ABS_SSIZE_T_MIN	(0-(size_t)PY_SSIZE_T_MIN)
+
 /* Get a C long int from a long int object.
    Returns -1 and sets an error condition if overflow occurs. */
 
@@ -225,14 +235,16 @@
 		if ((x >> SHIFT) != prev)
 			goto overflow;
 	}
-	/* Haven't lost any bits, but if the sign bit is set we're in
-	 * trouble *unless* this is the min negative number.  So,
-	 * trouble iff sign bit set && (positive || some bit set other
-	 * than the sign bit).
-	 */
-	if ((long)x < 0 && (sign > 0 || (x << 1) != 0))
-		goto overflow;
-	return (long)x * sign;
+	/* Haven't lost any bits, but casting to long requires extra care
+	 * (see comment above).
+         */
+	if (x <= (unsigned long)LONG_MAX) {
+		return (long)x * sign;
+	}
+	else if (sign < 0 && x == PY_ABS_LONG_MIN) {
+		return LONG_MIN;
+	}
+	/* else overflow */
 
  overflow:
 	PyErr_SetString(PyExc_OverflowError,
@@ -268,14 +280,16 @@
 		if ((x >> SHIFT) != prev)
 			goto overflow;
 	}
-	/* Haven't lost any bits, but if the sign bit is set we're in
-	 * trouble *unless* this is the min negative number.  So,
-	 * trouble iff sign bit set && (positive || some bit set other
-	 * than the sign bit).
+	/* Haven't lost any bits, but casting to a signed type requires
+	 * extra care (see comment above).
 	 */
-	if ((Py_ssize_t)x < 0 && (sign > 0 || (x << 1) != 0))
-		goto overflow;
-	return (Py_ssize_t)x * sign;
+	if (x <= (size_t)PY_SSIZE_T_MAX) {
+		return (Py_ssize_t)x * sign;
+	}
+	else if (sign < 0 && x == PY_ABS_SSIZE_T_MIN) {
+		return PY_SSIZE_T_MIN;
+	}
+	/* else overflow */
 
  overflow:
 	PyErr_SetString(PyExc_OverflowError,
@@ -1167,7 +1181,7 @@
 {
 	register PyLongObject *a = (PyLongObject *)aa;
 	PyStringObject *str;
-	Py_ssize_t i;
+	Py_ssize_t i, j, sz;
 	Py_ssize_t size_a;
 	char *p;
 	int bits;
@@ -1187,11 +1201,18 @@
 		++bits;
 		i >>= 1;
 	}
-	i = 5 + (size_a*SHIFT + bits-1) / bits;
-	str = (PyStringObject *) PyString_FromStringAndSize((char *)0, i);
+	i = 5;
+	j = size_a*SHIFT + bits-1;
+	sz = i + j / bits;
+	if (j / SHIFT < size_a || sz < i) {
+		PyErr_SetString(PyExc_OverflowError,
+				"long is too large to format");
+		return NULL;
+	}
+	str = (PyStringObject *) PyString_FromStringAndSize((char *)0, sz);
 	if (str == NULL)
 		return NULL;
-	p = PyString_AS_STRING(str) + i;
+	p = PyString_AS_STRING(str) + sz;
 	*p = '\0';
 	if (a->ob_size < 0)
 		sign = '-';
@@ -1303,7 +1324,7 @@
 		} while ((*q++ = *p++) != '\0');
 		q--;
 		_PyString_Resize((PyObject **)&str,
-				 (int) (q - PyString_AS_STRING(str)));
+				 (Py_ssize_t) (q - PyString_AS_STRING(str)));
 	}
 	return (PyObject *)str;
 }
@@ -1361,14 +1382,14 @@
 	while (_PyLong_DigitValue[Py_CHARMASK(*p)] < base)
 		++p;
 	*str = p;
-	n = (p - start) * bits_per_char;
-	if (n / bits_per_char != p - start) {
+	/* n <- # of Python digits needed, = ceiling(n/SHIFT). */
+	n = (p - start) * bits_per_char + SHIFT - 1;
+	if (n / bits_per_char < p - start) {
 		PyErr_SetString(PyExc_ValueError,
 				"long string too large to convert");
 		return NULL;
 	}
-	/* n <- # of Python digits needed, = ceiling(n/SHIFT). */
-	n = (n + SHIFT - 1) / SHIFT;
+	n = n / SHIFT;
 	z = _PyLong_New(n);
 	if (z == NULL)
 		return NULL;
@@ -1882,6 +1903,14 @@
 	return sign < 0 ? -1 : sign > 0 ? 1 : 0;
 }
 
+static PyObject *
+long_richcompare(PyObject *self, PyObject *other, int op)
+{
+	PyLongObject *a, *b;
+	CONVERT_BINOP((PyObject *)self, (PyObject *)other, &a, &b);
+	return Py_CmpToRich(op, long_compare(a, b));
+}
+
 static long
 long_hash(PyLongObject *v)
 {
@@ -2880,7 +2909,7 @@
 }
 
 static int
-long_nonzero(PyLongObject *v)
+long_bool(PyLongObject *v)
 {
 	return ABS(v->ob_size) != 0;
 }
@@ -3152,22 +3181,6 @@
 	return c;
 }
 
-static int
-long_coerce(PyObject **pv, PyObject **pw)
-{
-	if (PyInt_Check(*pw)) {
-		*pw = PyLong_FromLong(PyInt_AS_LONG(*pw));
-		Py_INCREF(*pv);
-		return 0;
-	}
-	else if (PyLong_Check(*pw)) {
-		Py_INCREF(*pv);
-		Py_INCREF(*pw);
-		return 0;
-	}
-	return 1; /* Can't do it */
-}
-
 static PyObject *
 long_long(PyObject *v)
 {
@@ -3317,14 +3330,14 @@
 	(unaryfunc) 	long_neg,	/*nb_negative*/
 	(unaryfunc) 	long_pos,	/*tp_positive*/
 	(unaryfunc) 	long_abs,	/*tp_absolute*/
-	(inquiry)	long_nonzero,	/*tp_nonzero*/
+	(inquiry)	long_bool,	/*tp_bool*/
 	(unaryfunc)	long_invert,	/*nb_invert*/
 			long_lshift,	/*nb_lshift*/
 	(binaryfunc)	long_rshift,	/*nb_rshift*/
 			long_and,	/*nb_and*/
 			long_xor,	/*nb_xor*/
 			long_or,	/*nb_or*/
-			long_coerce,	/*nb_coerce*/
+			0,		/*nb_coerce*/
 			long_int,	/*nb_int*/
 			long_long,	/*nb_long*/
 			long_float,	/*nb_float*/
@@ -3357,7 +3370,7 @@
 	0,					/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)long_compare,			/* tp_compare */
+	0,					/* tp_compare */
 	long_repr,				/* tp_repr */
 	&long_as_number,			/* tp_as_number */
 	0,					/* tp_as_sequence */
@@ -3372,7 +3385,7 @@
 	long_doc,				/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	long_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */

Modified: python/branches/p3yk-noslice/Objects/methodobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/methodobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/methodobject.c	Fri Dec 15 05:21:50 2006
@@ -196,17 +196,31 @@
 				   m->m_self);
 }
 
-static int
-meth_compare(PyCFunctionObject *a, PyCFunctionObject *b)
+static PyObject *
+meth_richcompare(PyObject *self, PyObject *other, int op)
 {
-	if (a->m_self != b->m_self)
-		return (a->m_self < b->m_self) ? -1 : 1;
-	if (a->m_ml->ml_meth == b->m_ml->ml_meth)
-		return 0;
-	if (strcmp(a->m_ml->ml_name, b->m_ml->ml_name) < 0)
-		return -1;
+	PyCFunctionObject *a, *b;
+	PyObject *res;
+	int eq;
+
+	if ((op != Py_EQ && op != Py_NE) ||
+	    !PyCFunction_Check(self) ||
+	    !PyCFunction_Check(other))
+	{
+		Py_INCREF(Py_NotImplemented);
+		return Py_NotImplemented;
+	}
+	a = (PyCFunctionObject *)self;
+	b = (PyCFunctionObject *)other;
+	eq = a->m_self == b->m_self;
+	if (eq)
+		eq = a->m_ml->ml_meth == b->m_ml->ml_meth;
+	if (op == Py_EQ)
+		res = eq ? Py_True : Py_False;
 	else
-		return 1;
+		res = eq ? Py_False : Py_True;
+	Py_INCREF(res);
+	return res;
 }
 
 static long
@@ -240,7 +254,7 @@
 	0,					/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)meth_compare,			/* tp_compare */
+	0,					/* tp_compare */
 	(reprfunc)meth_repr,			/* tp_repr */
 	0,					/* tp_as_number */
 	0,					/* tp_as_sequence */
@@ -255,7 +269,7 @@
  	0,					/* tp_doc */
  	(traverseproc)meth_traverse,		/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	meth_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */

Modified: python/branches/p3yk-noslice/Objects/object.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/object.c	(original)
+++ python/branches/p3yk-noslice/Objects/object.c	Fri Dec 15 05:21:50 2006
@@ -252,14 +252,6 @@
 	return PyObject_INIT_VAR(op, tp, nitems);
 }
 
-/* for binary compatibility with 2.2 */
-#undef _PyObject_Del
-void
-_PyObject_Del(PyObject *op)
-{
-	PyObject_FREE(op);
-}
-
 /* Implementation of PyObject_Print with recursion checking */
 static int
 internal_print(PyObject *op, FILE *fp, int flags, int nesting)
@@ -513,431 +505,200 @@
 #endif
 
 
-/* Helper to warn about deprecated tp_compare return values.  Return:
-   -2 for an exception;
-   -1 if v <  w;
-    0 if v == w;
-    1 if v  > w.
-   (This function cannot return 2.)
-*/
-static int
-adjust_tp_compare(int c)
-{
-	if (PyErr_Occurred()) {
-		if (c != -1 && c != -2) {
-			PyObject *t, *v, *tb;
-			PyErr_Fetch(&t, &v, &tb);
-			if (PyErr_Warn(PyExc_RuntimeWarning,
-				       "tp_compare didn't return -1 or -2 "
-				       "for exception") < 0) {
-				Py_XDECREF(t);
-				Py_XDECREF(v);
-				Py_XDECREF(tb);
-			}
-			else
-				PyErr_Restore(t, v, tb);
-		}
-		return -2;
-	}
-	else if (c < -1 || c > 1) {
-		if (PyErr_Warn(PyExc_RuntimeWarning,
-			       "tp_compare didn't return -1, 0 or 1") < 0)
-			return -2;
-		else
-			return c < -1 ? -1 : 1;
-	}
-	else {
-		assert(c >= -1 && c <= 1);
-		return c;
-	}
-}
+/* The new comparison philosophy is: we completely separate three-way
+   comparison from rich comparison.  That is, PyObject_Compare() and
+   PyObject_Cmp() *just* use the tp_compare slot.  And PyObject_RichCompare()
+   and PyObject_RichCompareBool() *just* use the tp_richcompare slot.
+   
+   See (*) below for practical amendments.
 
+   IOW, only cmp() uses tp_compare; the comparison operators (==, !=, <=, <,
+   >=, >) only use tp_richcompare.  Note that list.sort() only uses <.
 
-/* Macro to get the tp_richcompare field of a type if defined */
-#define RICHCOMPARE(t) ((t)->tp_richcompare)
+   (And yes, eventually we'll rip out cmp() and tp_compare.)
 
-/* Map rich comparison operators to their swapped version, e.g. LT --> GT */
-int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE};
+   The calling conventions are different: tp_compare only gets called with two
+   objects of the appropriate type; tp_richcompare gets called with a first
+   argument of the appropriate type and a second object of an arbitrary type.
+   We never do any kind of coercion.
 
-/* Try a genuine rich comparison, returning an object.  Return:
-   NULL for exception;
-   NotImplemented if this particular rich comparison is not implemented or
-     undefined;
-   some object not equal to NotImplemented if it is implemented
-     (this latter object may not be a Boolean).
-*/
-static PyObject *
-try_rich_compare(PyObject *v, PyObject *w, int op)
-{
-	richcmpfunc f;
-	PyObject *res;
-
-	if (v->ob_type != w->ob_type &&
-	    PyType_IsSubtype(w->ob_type, v->ob_type) &&
-	    (f = RICHCOMPARE(w->ob_type)) != NULL) {
-		res = (*f)(w, v, _Py_SwappedOp[op]);
-		if (res != Py_NotImplemented)
-			return res;
-		Py_DECREF(res);
-	}
-	if ((f = RICHCOMPARE(v->ob_type)) != NULL) {
-		res = (*f)(v, w, op);
-		if (res != Py_NotImplemented)
-			return res;
-		Py_DECREF(res);
-	}
-	if ((f = RICHCOMPARE(w->ob_type)) != NULL) {
-		return (*f)(w, v, _Py_SwappedOp[op]);
-	}
-	res = Py_NotImplemented;
-	Py_INCREF(res);
-	return res;
-}
+   The return conventions are also different.
 
-/* Try a genuine rich comparison, returning an int.  Return:
-   -1 for exception (including the case where try_rich_compare() returns an
-      object that's not a Boolean);
-    0 if the outcome is false;
-    1 if the outcome is true;
-    2 if this particular rich comparison is not implemented or undefined.
-*/
-static int
-try_rich_compare_bool(PyObject *v, PyObject *w, int op)
-{
-	PyObject *res;
-	int ok;
+   The tp_compare slot should return a C int, as follows:
 
-	if (RICHCOMPARE(v->ob_type) == NULL && RICHCOMPARE(w->ob_type) == NULL)
-		return 2; /* Shortcut, avoid INCREF+DECREF */
-	res = try_rich_compare(v, w, op);
-	if (res == NULL)
-		return -1;
-	if (res == Py_NotImplemented) {
-		Py_DECREF(res);
-		return 2;
-	}
-	ok = PyObject_IsTrue(res);
-	Py_DECREF(res);
-	return ok;
-}
+     -1 if a < b or if an exception occurred
+      0 if a == b
+     +1 if a > b
 
-/* Try rich comparisons to determine a 3-way comparison.  Return:
-   -2 for an exception;
-   -1 if v  < w;
-    0 if v == w;
-    1 if v  > w;
-    2 if this particular rich comparison is not implemented or undefined.
-*/
-static int
-try_rich_to_3way_compare(PyObject *v, PyObject *w)
-{
-	static struct { int op; int outcome; } tries[3] = {
-		/* Try this operator, and if it is true, use this outcome: */
-		{Py_EQ, 0},
-		{Py_LT, -1},
-		{Py_GT, 1},
-	};
-	int i;
+   No other return values are allowed.  PyObject_Compare() has the same
+   calling convention.
 
-	if (RICHCOMPARE(v->ob_type) == NULL && RICHCOMPARE(w->ob_type) == NULL)
-		return 2; /* Shortcut */
+  The tp_richcompare slot should return an object, as follows:
 
-	for (i = 0; i < 3; i++) {
-		switch (try_rich_compare_bool(v, w, tries[i].op)) {
-		case -1:
-			return -2;
-		case 1:
-			return tries[i].outcome;
-		}
-	}
+    NULL if an exception occurred
+    NotImplemented if the requested comparison is not implemented
+    any other false value if the requested comparison is false
+    any other true value if the requested comparison is true
 
-	return 2;
-}
+  The PyObject_RichCompare[Bool]() wrappers raise TypeError when they get
+  NotImplemented.
 
-/* Try a 3-way comparison, returning an int.  Return:
-   -2 for an exception;
-   -1 if v <  w;
-    0 if v == w;
-    1 if v  > w;
-    2 if this particular 3-way comparison is not implemented or undefined.
-*/
-static int
-try_3way_compare(PyObject *v, PyObject *w)
-{
-	int c;
-	cmpfunc f;
+  (*) Practical amendments:
 
-	/* Comparisons involving instances are given to instance_compare,
-	   which has the same return conventions as this function. */
+  - If rich comparison returns NotImplemented, == and != are decided by
+    comparing the object pointer (i.e. falling back to the base object
+    implementation).
 
-	f = v->ob_type->tp_compare;
+  - If three-way comparison is not implemented, it falls back on rich
+    comparison (but not the other way around!).
 
-	/* If both have the same (non-NULL) tp_compare, use it. */
-	if (f != NULL && f == w->ob_type->tp_compare) {
-		c = (*f)(v, w);
-		return adjust_tp_compare(c);
-	}
-
-	/* If either tp_compare is _PyObject_SlotCompare, that's safe. */
-	if (f == _PyObject_SlotCompare ||
-	    w->ob_type->tp_compare == _PyObject_SlotCompare)
-		return _PyObject_SlotCompare(v, w);
-
-	/* If we're here, v and w,
-	    a) are not instances;
-	    b) have different types or a type without tp_compare; and
-	    c) don't have a user-defined tp_compare.
-	   tp_compare implementations in C assume that both arguments
-	   have their type, so we give up if the coercion fails.
-	*/
-	c = PyNumber_CoerceEx(&v, &w);
-	if (c < 0)
-		return -2;
-	if (c > 0)
-		return 2;
-	f = v->ob_type->tp_compare;
-	if (f != NULL && f == w->ob_type->tp_compare) {
-		c = (*f)(v, w);
-		Py_DECREF(v);
-		Py_DECREF(w);
-		return adjust_tp_compare(c);
-	}
-
-	/* No comparison defined */
-	Py_DECREF(v);
-	Py_DECREF(w);
-	return 2;
-}
-
-/* Final fallback 3-way comparison, returning an int.  Return:
-   -2 if an error occurred;
-   -1 if v <  w;
-    0 if v == w;
-    1 if v >  w.
 */
-static int
-default_3way_compare(PyObject *v, PyObject *w)
-{
-	int c;
-	const char *vname, *wname;
-
-	if (v->ob_type == w->ob_type) {
-		/* When comparing these pointers, they must be cast to
-		 * integer types (i.e. Py_uintptr_t, our spelling of C9X's
-		 * uintptr_t).  ANSI specifies that pointer compares other
-		 * than == and != to non-related structures are undefined.
-		 */
-		Py_uintptr_t vv = (Py_uintptr_t)v;
-		Py_uintptr_t ww = (Py_uintptr_t)w;
-		return (vv < ww) ? -1 : (vv > ww) ? 1 : 0;
-	}
-
-	/* None is smaller than anything */
-	if (v == Py_None)
-		return -1;
-	if (w == Py_None)
-		return 1;
 
-	/* different type: compare type names; numbers are smaller */
-	if (PyNumber_Check(v))
-		vname = "";
-	else
-		vname = v->ob_type->tp_name;
-	if (PyNumber_Check(w))
-		wname = "";
-	else
-		wname = w->ob_type->tp_name;
-	c = strcmp(vname, wname);
-	if (c < 0)
-		return -1;
-	if (c > 0)
-		return 1;
-	/* Same type name, or (more likely) incomparable numeric types */
-	return ((Py_uintptr_t)(v->ob_type) < (
-		Py_uintptr_t)(w->ob_type)) ? -1 : 1;
-}
+/* Forward */
+static PyObject *do_richcompare(PyObject *v, PyObject *w, int op);
 
-/* Do a 3-way comparison, by hook or by crook.  Return:
-   -2 for an exception (but see below);
-   -1 if v <  w;
-    0 if v == w;
-    1 if v >  w;
-   BUT: if the object implements a tp_compare function, it returns
-   whatever this function returns (whether with an exception or not).
-*/
+/* Perform a three-way comparison, raising TypeError if three-way comparison
+   is not supported.  */
 static int
-do_cmp(PyObject *v, PyObject *w)
+do_compare(PyObject *v, PyObject *w)
 {
-	int c;
 	cmpfunc f;
+	int ok;
 
-	if (v->ob_type == w->ob_type
-	    && (f = v->ob_type->tp_compare) != NULL) {
-		c = (*f)(v, w);
-		return adjust_tp_compare(c);
-	}
-	/* We only get here if one of the following is true:
-	   a) v and w have different types
-	   b) v and w have the same type, which doesn't have tp_compare
-	   c) v and w are instances, and either __cmp__ is not defined or
-	      __cmp__ returns NotImplemented
-	*/
-	c = try_rich_to_3way_compare(v, w);
-	if (c < 2)
-		return c;
-	c = try_3way_compare(v, w);
-	if (c < 2)
-		return c;
-	return default_3way_compare(v, w);
-}
-
-/* Compare v to w.  Return
-   -1 if v <  w or exception (PyErr_Occurred() true in latter case).
-    0 if v == w.
-    1 if v > w.
-   XXX The docs (C API manual) say the return value is undefined in case
-   XXX of error.
-*/
+	if (v->ob_type == w->ob_type && 
+	    (f = v->ob_type->tp_compare) != NULL) {
+		return (*f)(v, w);
+	}
+
+	/* Now try three-way compare before giving up.  This is intentionally
+	   elaborate; if you have a it will raise TypeError if it detects two
+	   objects that aren't ordered with respect to each other. */
+	ok = PyObject_RichCompareBool(v, w, Py_LT);
+	if (ok < 0)
+		return -1; /* Error */
+	if (ok)
+		return -1; /* Less than */
+	ok = PyObject_RichCompareBool(v, w, Py_GT);
+	if (ok < 0)
+		return -1; /* Error */
+	if (ok)
+		return 1; /* Greater than */
+	ok = PyObject_RichCompareBool(v, w, Py_EQ);
+	if (ok < 0)
+		return -1; /* Error */
+	if (ok)
+		return 0; /* Equal */
+
+	/* Give up */
+	PyErr_Format(PyExc_TypeError,
+		     "unorderable types: '%.100s' != '%.100s'",
+		     v->ob_type->tp_name,
+		     w->ob_type->tp_name);
+	return -1;
+}
+
+/* Perform a three-way comparison.  This wraps do_compare() with a check for
+   NULL arguments and a recursion check. */
 int
 PyObject_Compare(PyObject *v, PyObject *w)
 {
-	int result;
+	int res;
 
 	if (v == NULL || w == NULL) {
-		PyErr_BadInternalCall();
+		if (!PyErr_Occurred())
+			PyErr_BadInternalCall();
 		return -1;
 	}
-	if (v == w)
-		return 0;
 	if (Py_EnterRecursiveCall(" in cmp"))
 		return -1;
-	result = do_cmp(v, w);
+	res = do_compare(v, w);
 	Py_LeaveRecursiveCall();
-	return result < 0 ? -1 : result;
+	return res < 0 ? -1 : res;
 }
 
-/* Return (new reference to) Py_True or Py_False. */
-static PyObject *
-convert_3way_to_object(int op, int c)
-{
-	PyObject *result;
-	switch (op) {
-	case Py_LT: c = c <  0; break;
-	case Py_LE: c = c <= 0; break;
-	case Py_EQ: c = c == 0; break;
-	case Py_NE: c = c != 0; break;
-	case Py_GT: c = c >  0; break;
-	case Py_GE: c = c >= 0; break;
-	}
-	result = c ? Py_True : Py_False;
-	Py_INCREF(result);
-	return result;
-}
-
-/* We want a rich comparison but don't have one.  Try a 3-way cmp instead.
-   Return
-   NULL      if error
-   Py_True   if v op w
-   Py_False  if not (v op w)
-*/
-static PyObject *
-try_3way_to_rich_compare(PyObject *v, PyObject *w, int op)
-{
-	int c;
+/* Map rich comparison operators to their swapped version, e.g. LT <--> GT */
+int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE};
 
-	c = try_3way_compare(v, w);
-	if (c >= 2)
-		c = default_3way_compare(v, w);
-	if (c <= -2)
-		return NULL;
-	return convert_3way_to_object(op, c);
-}
+static char *opstrings[] = {">", ">=", "==", "!=", "<", "<="};
 
-/* Do rich comparison on v and w.  Return
-   NULL      if error
-   Else a new reference to an object other than Py_NotImplemented, usually(?):
-   Py_True   if v op w
-   Py_False  if not (v op w)
-*/
+/* Perform a rich comparison, raising TypeError when the requested comparison
+   operator is not supported. */
 static PyObject *
-do_richcmp(PyObject *v, PyObject *w, int op)
+do_richcompare(PyObject *v, PyObject *w, int op)
 {
+	richcmpfunc f;
 	PyObject *res;
 
-	res = try_rich_compare(v, w, op);
-	if (res != Py_NotImplemented)
-		return res;
-	Py_DECREF(res);
-
-	return try_3way_to_rich_compare(v, w, op);
+	if (v->ob_type != w->ob_type &&
+	    PyType_IsSubtype(w->ob_type, v->ob_type) &&
+	    (f = w->ob_type->tp_richcompare) != NULL) {
+		res = (*f)(w, v, _Py_SwappedOp[op]);
+		if (res != Py_NotImplemented)
+			return res;
+		Py_DECREF(res);
+	}
+	if ((f = v->ob_type->tp_richcompare) != NULL) {
+		res = (*f)(v, w, op);
+		if (res != Py_NotImplemented)
+			return res;
+		Py_DECREF(res);
+	}
+	if ((f = w->ob_type->tp_richcompare) != NULL) {
+		res = (*f)(w, v, _Py_SwappedOp[op]);
+		if (res != Py_NotImplemented)
+			return res;
+		Py_DECREF(res);
+	}
+	/* If neither object implements it, provide a sensible default
+	   for == and !=, but raise an exception for ordering. */
+	switch (op) {
+	case Py_EQ:
+		res = (v == w) ? Py_True : Py_False;
+		break;
+	case Py_NE:
+		res = (v != w) ? Py_True : Py_False;
+		break;
+	default:
+		PyErr_Format(PyExc_TypeError,
+			     "unorderable types: %.100s() %s %.100s()",
+			     v->ob_type->tp_name,
+			     opstrings[op],
+			     w->ob_type->tp_name);
+		return NULL;
+	}
+	Py_INCREF(res);
+	return res;
 }
 
-/* Return:
-   NULL for exception;
-   some object not equal to NotImplemented if it is implemented
-     (this latter object may not be a Boolean).
-*/
+/* Perform a rich comparison with object result.  This wraps do_richcompare()
+   with a check for NULL arguments and a recursion check. */
+
 PyObject *
 PyObject_RichCompare(PyObject *v, PyObject *w, int op)
 {
 	PyObject *res;
 
 	assert(Py_LT <= op && op <= Py_GE);
-	if (Py_EnterRecursiveCall(" in cmp"))
+	if (v == NULL || w == NULL) {
+		if (!PyErr_Occurred())
+			PyErr_BadInternalCall();
 		return NULL;
-
-	/* If the types are equal, and not old-style instances, try to
-	   get out cheap (don't bother with coercions etc.). */
-	if (v->ob_type == w->ob_type) {
-		cmpfunc fcmp;
-		richcmpfunc frich = RICHCOMPARE(v->ob_type);
-		/* If the type has richcmp, try it first.  try_rich_compare
-		   tries it two-sided, which is not needed since we've a
-		   single type only. */
-		if (frich != NULL) {
-			res = (*frich)(v, w, op);
-			if (res != Py_NotImplemented)
-				goto Done;
-			Py_DECREF(res);
-		}
-		/* No richcmp, or this particular richmp not implemented.
-		   Try 3-way cmp. */
-		fcmp = v->ob_type->tp_compare;
-		if (fcmp != NULL) {
-			int c = (*fcmp)(v, w);
-			c = adjust_tp_compare(c);
-			if (c == -2) {
-				res = NULL;
-				goto Done;
-			}
-			res = convert_3way_to_object(op, c);
-			goto Done;
-		}
 	}
-
-	/* Fast path not taken, or couldn't deliver a useful result. */
-	res = do_richcmp(v, w, op);
-Done:
+	if (Py_EnterRecursiveCall(" in cmp"))
+		return NULL;
+	res = do_richcompare(v, w, op);
 	Py_LeaveRecursiveCall();
 	return res;
 }
 
-/* Return -1 if error; 1 if v op w; 0 if not (v op w). */
+/* Perform a rich comparison with integer result.  This wraps
+   PyObject_RichCompare(), returning -1 for error, 0 for false, 1 for true. */
 int
 PyObject_RichCompareBool(PyObject *v, PyObject *w, int op)
 {
 	PyObject *res;
 	int ok;
 
-	/* Quick result when objects are the same.
-	   Guarantees that identity implies equality. */
-	if (v == w) {
-		if (op == Py_EQ)
-			return 1;
-		else if (op == Py_NE)
-			return 0;
-	}
-
 	res = PyObject_RichCompare(v, w, op);
 	if (res == NULL)
 		return -1;
@@ -949,6 +710,44 @@
 	return ok;
 }
 
+/* Turn the result of a three-way comparison into the result expected by a
+   rich comparison. */
+PyObject *
+Py_CmpToRich(int op, int cmp)
+{
+	PyObject *res;
+	int ok;
+
+	if (PyErr_Occurred())
+		return NULL;
+	switch (op) {
+	case Py_LT:
+		ok = cmp <  0; 
+		break;
+	case Py_LE:
+		ok = cmp <= 0; 
+		break;
+	case Py_EQ:
+		ok = cmp == 0; 
+		break;
+	case Py_NE:
+		ok = cmp != 0; 
+		break;
+	case Py_GT: 
+		ok = cmp >  0; 
+		break;
+	case Py_GE:
+		ok = cmp >= 0; 
+		break;
+	default:
+		PyErr_BadArgument(); 
+		return NULL;
+	}
+	res = ok ? Py_True : Py_False;
+	Py_INCREF(res);
+	return res;
+}
+
 /* Set of hash utility functions to help maintaining the invariant that
 	if a==b then hash(a)==hash(b)
 
@@ -1447,8 +1246,8 @@
 	if (v == Py_None)
 		return 0;
 	else if (v->ob_type->tp_as_number != NULL &&
-		 v->ob_type->tp_as_number->nb_nonzero != NULL)
-		res = (*v->ob_type->tp_as_number->nb_nonzero)(v);
+		 v->ob_type->tp_as_number->nb_bool != NULL)
+		res = (*v->ob_type->tp_as_number->nb_bool)(v);
 	else if (v->ob_type->tp_as_mapping != NULL &&
 		 v->ob_type->tp_as_mapping->mp_length != NULL)
 		res = (*v->ob_type->tp_as_mapping->mp_length)(v);
@@ -1474,33 +1273,6 @@
 	return res == 0;
 }
 
-/* Coerce two numeric types to the "larger" one.
-   Increment the reference count on each argument.
-   Return value:
-   -1 if an error occurred;
-   0 if the coercion succeeded (and then the reference counts are increased);
-   1 if no coercion is possible (and no error is raised).
-*/
-int
-PyNumber_CoerceEx(PyObject **pv, PyObject **pw)
-{
-	register PyObject *v = *pv;
-	register PyObject *w = *pw;
-	int res;
-
-	if (v->ob_type->tp_as_number && v->ob_type->tp_as_number->nb_coerce) {
-		res = (*v->ob_type->tp_as_number->nb_coerce)(pv, pw);
-		if (res <= 0)
-			return res;
-	}
-	if (w->ob_type->tp_as_number && w->ob_type->tp_as_number->nb_coerce) {
-		res = (*w->ob_type->tp_as_number->nb_coerce)(pw, pv);
-		if (res <= 0)
-			return res;
-	}
-	return 1;
-}
-
 /* Test whether an object can be called */
 
 int
@@ -1832,6 +1604,9 @@
 
 	if (PyType_Ready(&PyNotImplemented_Type) < 0)
 		Py_FatalError("Can't initialize type(NotImplemented)");
+
+	if (PyType_Ready(&PyCode_Type) < 0)
+		Py_FatalError("Can't initialize 'code'");
 }
 
 

Modified: python/branches/p3yk-noslice/Objects/obmalloc.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/obmalloc.c	(original)
+++ python/branches/p3yk-noslice/Objects/obmalloc.c	Fri Dec 15 05:21:50 2006
@@ -691,7 +691,8 @@
 
 #undef Py_ADDRESS_IN_RANGE
 
-#if defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)
+#if defined(__GNUC__) && ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) || \
+			  (__GNUC__ >= 4))
 #define Py_NO_INLINE __attribute__((__noinline__))
 #else
 #define Py_NO_INLINE

Modified: python/branches/p3yk-noslice/Objects/setobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/setobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/setobject.c	Fri Dec 15 05:21:50 2006
@@ -10,6 +10,20 @@
 #include "Python.h"
 #include "structmember.h"
 
+/* Set a key error with the specified argument, wrapping it in a
+ * tuple automatically so that tuple keys are not unpacked as the
+ * exception arguments. */
+static void
+set_key_error(PyObject *arg)
+{
+	PyObject *tup;
+	tup = PyTuple_Pack(1, arg);
+	if (!tup)
+		return; /* caller will expect error to be set anyway */
+	PyErr_SetObject(PyExc_KeyError, tup);
+	Py_DECREF(tup);
+}
+
 /* This must be >= 1. */
 #define PERTURB_SHIFT 5
 
@@ -179,11 +193,13 @@
 		if (entry->key == dummy && freeslot == NULL)
 			freeslot = entry;
 	}
+	assert(0);	/* NOT REACHED */
+	return 0;
 }
 
 /*
 Internal routine to insert a new key into the table.
-Used both by the internal resize routine and by the public insert routine.
+Used by the public insert routine.
 Eats a reference to key.
 */
 static int
@@ -216,6 +232,35 @@
 }
 
 /*
+Internal routine used by set_table_resize() to insert an item which is
+known to be absent from the set.  This routine also assumes that
+the set contains no deleted entries.  Besides the performance benefit,
+using set_insert_clean() in set_table_resize() is dangerous (SF bug #1456209).
+Note that no refcounts are changed by this routine; if needed, the caller
+is responsible for incref'ing `key`.
+*/
+static void
+set_insert_clean(register PySetObject *so, PyObject *key, long hash)
+{
+	register size_t i;
+	register size_t perturb;
+	register size_t mask = (size_t)so->mask;
+	setentry *table = so->table;
+	register setentry *entry;
+
+	i = hash & mask;
+	entry = &table[i];
+	for (perturb = hash; entry->key != NULL; perturb >>= PERTURB_SHIFT) {
+		i = (i << 2) + i + perturb + 1;
+		entry = &table[i & mask];
+	}
+	so->fill++;
+	entry->key = key;
+	entry->hash = hash;
+	so->used++;
+}
+
+/*
 Restructure the table by allocating a new table and reinserting all
 keys again.  When entries have been deleted, the new table may
 actually be smaller than the old one.
@@ -296,11 +341,7 @@
 		} else {
 			/* ACTIVE */
 			--i;
-			if(set_insert_key(so, entry->key, entry->hash) == -1) {
-				if (is_oldtable_malloced)
-					PyMem_DEL(oldtable);
-				return -1;
-			}
+			set_insert_clean(so, entry->key, entry->hash);
 		}
 	}
 
@@ -319,8 +360,10 @@
 	assert(so->fill <= so->mask);  /* at least one empty slot */
 	n_used = so->used;
 	Py_INCREF(entry->key);
-	if (set_insert_key(so, entry->key, entry->hash) == -1)
+	if (set_insert_key(so, entry->key, entry->hash) == -1) {
+		Py_DECREF(entry->key);
 		return -1;
+	}
 	if (!(so->used > n_used && so->fill*3 >= (so->mask+1)*2))
 		return 0;
 	return set_table_resize(so, so->used>50000 ? so->used*2 : so->used*4);
@@ -529,15 +572,28 @@
 	Py_ssize_t pos=0;
 	char *emit = "";	/* No separator emitted on first pass */
 	char *separator = ", ";
+	int literalform = 0;
 
-	fprintf(fp, "%s([", so->ob_type->tp_name);
+	if (!so->used) {
+		fprintf(fp, "%s()", so->ob_type->tp_name);
+		return 0;
+	}
+
+	if (so->ob_type == &PySet_Type) {
+		literalform = 1;
+		fprintf(fp, "{");
+	} else
+		fprintf(fp, "%s([", so->ob_type->tp_name);
 	while (set_next(so, &pos, &entry)) {
 		fputs(emit, fp);
 		emit = separator;
 		if (PyObject_Print(entry->key, fp, 0) != 0)
 			return -1;
 	}
-	fputs("])", fp);
+	if (literalform)
+		fputs("}", fp);
+	else
+		fputs("])", fp);
 	return 0;
 }
 
@@ -546,6 +602,10 @@
 {
 	PyObject *keys, *result, *listrepr;
 
+	/* shortcut for the empty set */
+	if (!so->used)
+		return PyString_FromFormat("%s()", so->ob_type->tp_name);
+
 	keys = PySequence_List((PyObject *)so);
 	if (keys == NULL)
 		return NULL;
@@ -554,8 +614,15 @@
 	if (listrepr == NULL)
 		return NULL;
 
-	result = PyString_FromFormat("%s(%s)", so->ob_type->tp_name,
-		PyString_AS_STRING(listrepr));
+	if (so->ob_type == &PySet_Type) {
+		char *s = PyString_AS_STRING(listrepr);
+		s += 1;
+		s[strlen(s)-1] = 0;
+		result = PyString_FromFormat("{%s}", s);
+	} else {
+		result = PyString_FromFormat("%s(%s)", so->ob_type->tp_name,
+			 	PyString_AS_STRING(listrepr));
+	}
 	Py_DECREF(listrepr);
 	return result;
 }
@@ -1131,7 +1198,12 @@
 		}
 
 		while (set_next((PySetObject *)other, &pos, &entry)) {
-			if (set_contains_entry(so, entry)) {
+			int rv = set_contains_entry(so, entry);
+			if (rv == -1) {
+				Py_DECREF(result);
+				return NULL;
+			}
+			if (rv) {
 				if (set_add_entry(result, entry) == -1) {
 					Py_DECREF(result);
 					return NULL;
@@ -1148,8 +1220,27 @@
 	}
 
 	while ((key = PyIter_Next(it)) != NULL) {
-		if (set_contains_key(so, key)) {
-			if (set_add_key(result, key) == -1) {
+		int rv;
+		setentry entry;
+		long hash = PyObject_Hash(key);
+
+		if (hash == -1) {
+			Py_DECREF(it);
+			Py_DECREF(result);
+			Py_DECREF(key);
+			return NULL;
+		}
+		entry.hash = hash;
+		entry.key = key;
+		rv = set_contains_entry(so, &entry);
+		if (rv == -1) {
+			Py_DECREF(it);
+			Py_DECREF(result);
+			Py_DECREF(key);
+			return NULL;
+		}
+		if (rv) {
+			if (set_add_entry(result, &entry) == -1) {
 				Py_DECREF(it);
 				Py_DECREF(result);
 				Py_DECREF(key);
@@ -1225,7 +1316,8 @@
 		Py_ssize_t pos = 0;
 
 		while (set_next((PySetObject *)other, &pos, &entry))
-			set_discard_entry(so, entry);
+			if (set_discard_entry(so, entry) == -1)
+				return -1;
 	} else {
 		PyObject *key, *it;
 		it = PyObject_GetIter(other);
@@ -1288,17 +1380,26 @@
 			entrycopy.hash = entry->hash;
 			entrycopy.key = entry->key;
 			if (!PyDict_Contains(other, entry->key)) {
-				if (set_add_entry((PySetObject *)result, &entrycopy) == -1)
+				if (set_add_entry((PySetObject *)result, &entrycopy) == -1) {
+					Py_DECREF(result);
 					return NULL;
+				}
 			}
 		}
 		return result;
 	}
 
 	while (set_next(so, &pos, &entry)) {
-		if (!set_contains_entry((PySetObject *)other, entry)) {
-			if (set_add_entry((PySetObject *)result, entry) == -1)
+		int rv = set_contains_entry((PySetObject *)other, entry);
+		if (rv == -1) {
+			Py_DECREF(result);
+			return NULL;
+		}
+		if (!rv) {
+			if (set_add_entry((PySetObject *)result, entry) == -1) {
+				Py_DECREF(result);
 				return NULL;
+			}
 		}
 	}
 	return result;
@@ -1350,11 +1451,18 @@
 		PyObject *value;
 		int rv;
 		while (PyDict_Next(other, &pos, &key, &value)) {
-			rv = set_discard_key(so, key);
+			setentry an_entry;
+			long hash = PyObject_Hash(key);
+
+			if (hash == -1)
+				return NULL;
+			an_entry.hash = hash;
+			an_entry.key = key;
+			rv = set_discard_entry(so, &an_entry);
 			if (rv == -1)
 				return NULL;
 			if (rv == DISCARD_NOTFOUND) {
-				if (set_add_key(so, key) == -1)
+				if (set_add_entry(so, &an_entry) == -1)
 					return NULL;
 			}
 		}
@@ -1457,7 +1565,10 @@
 		Py_RETURN_FALSE;
 
 	while (set_next(so, &pos, &entry)) {
-		if (!set_contains_entry((PySetObject *)other, entry))
+		int rv = set_contains_entry((PySetObject *)other, entry);
+		if (rv == -1)
+			return NULL;
+		if (!rv)
 			Py_RETURN_FALSE;
 	}
 	Py_RETURN_TRUE;
@@ -1604,7 +1715,7 @@
 		Py_DECREF(tmpkey);
 		return result;
 	} else if (rv == DISCARD_NOTFOUND) {
-		PyErr_SetObject(PyExc_KeyError, key);
+		set_key_error(key);
 		return NULL;
 	}
 	Py_RETURN_NONE;
@@ -1760,7 +1871,7 @@
 	0,				/*nb_negative*/
 	0,				/*nb_positive*/
 	0,				/*nb_absolute*/
-	0,				/*nb_nonzero*/
+	0,				/*nb_bool*/
 	0,				/*nb_invert*/
 	0,				/*nb_lshift*/
 	0,				/*nb_rshift*/
@@ -1870,7 +1981,7 @@
 	0,				/*nb_negative*/
 	0,				/*nb_positive*/
 	0,				/*nb_absolute*/
-	0,				/*nb_nonzero*/
+	0,				/*nb_bool*/
 	0,				/*nb_invert*/
 	0,				/*nb_lshift*/
 	0,				/*nb_rshift*/

Modified: python/branches/p3yk-noslice/Objects/sliceobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/sliceobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/sliceobject.c	Fri Dec 15 05:21:50 2006
@@ -280,25 +280,55 @@
 	{NULL, NULL}
 };
 
-static int
-slice_compare(PySliceObject *v, PySliceObject *w)
+static PyObject *
+slice_richcompare(PyObject *v, PyObject *w, int op)
 {
-	int result = 0;
+	PyObject *t1;
+	PyObject *t2;
+	PyObject *res;
 
-        if (v == w)
-		return 0;
+	if (v == w) {
+		/* XXX Do we really need this shortcut?
+		   There's a unit test for it, but is that fair? */
+		switch (op) {
+		case Py_EQ: 
+		case Py_LE:
+		case Py_GE:
+			res = Py_True; 
+			break;
+		default:
+			res = Py_False; 
+			break;
+		}
+		Py_INCREF(res);
+		return res;
+	}
 
-	if (PyObject_Cmp(v->start, w->start, &result) < 0)
-	    return -2;
-	if (result != 0)
-		return result;
-	if (PyObject_Cmp(v->stop, w->stop, &result) < 0)
-	    return -2;
-	if (result != 0)
-		return result;
-	if (PyObject_Cmp(v->step, w->step, &result) < 0)
-	    return -2;
-	return result;
+	t1 = PyTuple_New(3);
+	t2 = PyTuple_New(3);
+	if (t1 == NULL || t2 == NULL)
+		return NULL;
+
+	PyTuple_SET_ITEM(t1, 0, ((PySliceObject *)v)->start);
+	PyTuple_SET_ITEM(t1, 1, ((PySliceObject *)v)->stop);
+	PyTuple_SET_ITEM(t1, 2, ((PySliceObject *)v)->step);
+	PyTuple_SET_ITEM(t2, 0, ((PySliceObject *)w)->start);
+	PyTuple_SET_ITEM(t2, 1, ((PySliceObject *)w)->stop);
+	PyTuple_SET_ITEM(t2, 2, ((PySliceObject *)w)->step);
+
+	res = PyObject_RichCompare(t1, t2, op);
+
+	PyTuple_SET_ITEM(t1, 0, NULL);
+	PyTuple_SET_ITEM(t1, 1, NULL);
+	PyTuple_SET_ITEM(t1, 2, NULL);
+	PyTuple_SET_ITEM(t2, 0, NULL);
+	PyTuple_SET_ITEM(t2, 1, NULL);
+	PyTuple_SET_ITEM(t2, 2, NULL);
+
+	Py_DECREF(t1);
+	Py_DECREF(t2);
+
+	return res;
 }
 
 static long
@@ -318,7 +348,7 @@
 	0,					/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
-	(cmpfunc)slice_compare, 		/* tp_compare */
+	0,			 		/* tp_compare */
 	(reprfunc)slice_repr,   		/* tp_repr */
 	0,					/* tp_as_number */
 	0,	    				/* tp_as_sequence */
@@ -333,7 +363,7 @@
 	slice_doc,				/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	slice_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */

Modified: python/branches/p3yk-noslice/Objects/stringlib/partition.h
==============================================================================
--- python/branches/p3yk-noslice/Objects/stringlib/partition.h	(original)
+++ python/branches/p3yk-noslice/Objects/stringlib/partition.h	Fri Dec 15 05:21:50 2006
@@ -78,12 +78,12 @@
             }
 
     if (pos < 0) {
-	Py_INCREF(str_obj);
-	PyTuple_SET_ITEM(out, 0, (PyObject*) str_obj);
 	Py_INCREF(STRINGLIB_EMPTY);
-	PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY);
+	PyTuple_SET_ITEM(out, 0, (PyObject*) STRINGLIB_EMPTY);
 	Py_INCREF(STRINGLIB_EMPTY);
-	PyTuple_SET_ITEM(out, 2, (PyObject*) STRINGLIB_EMPTY);
+	PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY);
+	Py_INCREF(str_obj);        
+	PyTuple_SET_ITEM(out, 2, (PyObject*) str_obj);
 	return out;
     }
 

Modified: python/branches/p3yk-noslice/Objects/stringobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/stringobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/stringobject.c	Fri Dec 15 05:21:50 2006
@@ -804,10 +804,22 @@
 		return ret;
 	}
 	if (flags & Py_PRINT_RAW) {
+		char *data = op->ob_sval;
+		Py_ssize_t size = op->ob_size;
+		while (size > INT_MAX) {
+			/* Very long strings cannot be written atomically.
+			 * But don't write exactly INT_MAX bytes at a time
+			 * to avoid memory aligment issues.
+			 */
+			const int chunk_size = INT_MAX & ~0x3FFF;
+			fwrite(data, 1, chunk_size, fp);
+			data += chunk_size;
+			size -= chunk_size;
+		}
 #ifdef __VMS
-                if (op->ob_size) fwrite(op->ob_sval, (int) op->ob_size, 1, fp);
+                if (size) fwrite(data, (int)size, 1, fp);
 #else
-                fwrite(op->ob_sval, 1, (int) op->ob_size, fp);
+                fwrite(data, 1, (int)size, fp);
 #endif
 		return 0;
 	}
@@ -844,7 +856,7 @@
 	register PyStringObject* op = (PyStringObject*) obj;
 	size_t newsize = 2 + 4 * op->ob_size;
 	PyObject *v;
-	if (newsize > PY_SSIZE_T_MAX) {
+	if (newsize > PY_SSIZE_T_MAX || newsize / 4 != op->ob_size) {
 		PyErr_SetString(PyExc_OverflowError,
 			"string is too large to make repr");
 	}
@@ -1059,8 +1071,9 @@
 			return PyUnicode_Contains(str_obj, sub_obj);
 #endif
 		if (!PyString_Check(sub_obj)) {
-			PyErr_SetString(PyExc_TypeError,
-			    "'in <string>' requires string as left operand");
+			PyErr_Format(PyExc_TypeError,
+			    "'in <string>' requires string as left operand, "
+			    "not %.200s", sub_obj->ob_type->tp_name);
 			return -1;
 		}
 	}
@@ -1239,8 +1252,9 @@
 		}
 	}
 	else {
-		PyErr_SetString(PyExc_TypeError,
-				"string indices must be integers");
+		PyErr_Format(PyExc_TypeError,
+			     "string indices must be integers, not %.200s",
+			     item->ob_type->tp_name);
 		return NULL;
 	}
 }
@@ -1554,11 +1568,11 @@
 }
 
 PyDoc_STRVAR(rpartition__doc__,
-"S.rpartition(sep) -> (head, sep, tail)\n\
+"S.rpartition(sep) -> (tail, sep, head)\n\
 \n\
 Searches for the separator sep in S, starting at the end of S, and returns\n\
 the part before it, the separator itself, and the part after it.  If the\n\
-separator is not found, returns S and two empty strings.");
+separator is not found, returns two empty strings and S.");
 
 static PyObject *
 string_rpartition(PyStringObject *self, PyObject *sep_obj)
@@ -4147,7 +4161,8 @@
 	double x;
 	x = PyFloat_AsDouble(v);
 	if (x == -1.0 && PyErr_Occurred()) {
-		PyErr_SetString(PyExc_TypeError, "float argument required");
+		PyErr_Format(PyExc_TypeError, "float argument required, "
+			     "not %.200s", v->ob_type->tp_name);
 		return -1;
 	}
 	if (prec < 0)
@@ -4248,7 +4263,7 @@
 		return NULL;
 	}
 	llen = PyString_Size(result);
-	if (llen > PY_SSIZE_T_MAX) {
+	if (llen > INT_MAX) {
 		PyErr_SetString(PyExc_ValueError, "string too large in _PyString_FormatLong");
 		return NULL;
 	}
@@ -4342,7 +4357,8 @@
 
 	x = PyInt_AsLong(v);
 	if (x == -1 && PyErr_Occurred()) {
-		PyErr_SetString(PyExc_TypeError, "int argument required");
+		PyErr_Format(PyExc_TypeError, "int argument required, not %.200s",
+			     v->ob_type->tp_name);
 		return -1;
 	}
 	if (x < 0 && type == 'u') {
@@ -4737,9 +4753,10 @@
 			default:
 				PyErr_Format(PyExc_ValueError,
 				  "unsupported format character '%c' (0x%x) "
-				  "at index %i",
+				  "at index %zd",
 				  c, c,
-				  (int)(fmt - 1 - PyString_AsString(format)));
+				  (Py_ssize_t)(fmt - 1 -
+					       PyString_AsString(format)));
 				goto error;
 			}
 			if (sign) {

Modified: python/branches/p3yk-noslice/Objects/tupleobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/tupleobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/tupleobject.c	Fri Dec 15 05:21:50 2006
@@ -626,8 +626,9 @@
 		}
 	}
 	else {
-		PyErr_SetString(PyExc_TypeError, 
-				"tuple indices must be integers");
+		PyErr_Format(PyExc_TypeError, 
+			     "tuple indices must be integers, not %.200s",
+			     item->ob_type->tp_name);
 		return NULL;
 	}
 }

Modified: python/branches/p3yk-noslice/Objects/typeobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/typeobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/typeobject.c	Fri Dec 15 05:21:50 2006
@@ -98,7 +98,7 @@
 		s = strrchr(type->tp_name, '.');
 		if (s != NULL)
 			return PyString_FromStringAndSize(
-				type->tp_name, (int)(s - type->tp_name));
+			    type->tp_name, (Py_ssize_t)(s - type->tp_name));
 		return PyString_FromString("__builtin__");
 	}
 }
@@ -361,16 +361,6 @@
 	{0}
 };
 
-static int
-type_compare(PyObject *v, PyObject *w)
-{
-	/* This is called with type objects only. So we
-	   can just compare the addresses. */
-	Py_uintptr_t vv = (Py_uintptr_t)v;
-	Py_uintptr_t ww = (Py_uintptr_t)w;
-	return (vv < ww) ? -1 : (vv > ww) ? 1 : 0;
-}
-
 static PyObject *
 type_repr(PyTypeObject *type)
 {
@@ -2191,12 +2181,12 @@
 	0,					/* tp_print */
 	0,			 		/* tp_getattr */
 	0,					/* tp_setattr */
-	type_compare,				/* tp_compare */
+	0,					/* tp_compare */
 	(reprfunc)type_repr,			/* tp_repr */
 	0,					/* tp_as_number */
 	0,					/* tp_as_sequence */
 	0,					/* tp_as_mapping */
-	(hashfunc)_Py_HashPointer,		/* tp_hash */
+	0,					/* tp_hash */
 	(ternaryfunc)type_call,			/* tp_call */
 	0,					/* tp_str */
 	(getattrofunc)type_getattro,		/* tp_getattro */
@@ -2301,6 +2291,30 @@
 }
 
 static PyObject *
+object_richcompare(PyObject *self, PyObject *other, int op)
+{
+	PyObject *res;
+
+	switch (op) {
+
+	case Py_EQ:
+		res = (self == other) ? Py_True : Py_False;
+		break;
+
+	case Py_NE:
+		res = (self != other) ? Py_True : Py_False;
+		break;
+
+	default:
+		res = Py_NotImplemented;
+		break;
+	}
+
+	Py_INCREF(res);
+	return res;
+}
+
+static PyObject *
 object_get_class(PyObject *self, void *closure)
 {
 	Py_INCREF(self->ob_type);
@@ -2702,7 +2716,7 @@
 	PyDoc_STR("The most base type"),	/* tp_doc */
 	0,					/* tp_traverse */
 	0,					/* tp_clear */
-	0,					/* tp_richcompare */
+	object_richcompare,			/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */
@@ -2913,14 +2927,13 @@
 		COPYNUM(nb_negative);
 		COPYNUM(nb_positive);
 		COPYNUM(nb_absolute);
-		COPYNUM(nb_nonzero);
+		COPYNUM(nb_bool);
 		COPYNUM(nb_invert);
 		COPYNUM(nb_lshift);
 		COPYNUM(nb_rshift);
 		COPYNUM(nb_and);
 		COPYNUM(nb_xor);
 		COPYNUM(nb_or);
-		COPYNUM(nb_coerce);
 		COPYNUM(nb_int);
 		COPYNUM(nb_long);
 		COPYNUM(nb_float);
@@ -3612,7 +3625,7 @@
 	while (type && type->tp_flags & Py_TPFLAGS_HEAPTYPE)
 		type = type->tp_base;
         /* If type is NULL now, this is a really weird type.
-           In the same of backwards compatibility (?), just shut up. */
+           In the spirit of backwards compatibility (?), just shut up. */
 	if (type && type->tp_setattro != func) {
 		PyErr_Format(PyExc_TypeError,
 			     "can't apply this %s to %s object",
@@ -3829,7 +3842,7 @@
 	while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
 		staticbase = staticbase->tp_base;
         /* If staticbase is NULL now, it is a really weird type.
-           In the same of backwards compatibility (?), just shut up. */
+           In the spirit of backwards compatibility (?), just shut up. */
 	if (staticbase && staticbase->tp_new != type->tp_new) {
 		PyErr_Format(PyExc_TypeError,
 			     "%s.__new__(%s) is not safe, use %s.__new__()",
@@ -3985,19 +3998,10 @@
 		return -1;
 	len = PyInt_AsSsize_t(res);
 	Py_DECREF(res);
-	if (len == -1 && PyErr_Occurred())
-		return -1;
-#if SIZEOF_SIZE_T < SIZEOF_INT
-	/* Overflow check -- range of PyInt is more than C ssize_t */
-	if (len != (int)len) {
-		PyErr_SetString(PyExc_OverflowError,
-			"__len__() should return 0 <= outcome < 2**31");
-		return -1;
-	}
-#endif
 	if (len < 0) {
-		PyErr_SetString(PyExc_ValueError,
-				"__len__() should return >= 0");
+		if (!PyErr_Occurred())
+			PyErr_SetString(PyExc_ValueError,
+					"__len__() should return >= 0");
 		return -1;
 	}
 	return len;
@@ -4154,32 +4158,39 @@
 SLOT0(slot_nb_absolute, "__abs__")
 
 static int
-slot_nb_nonzero(PyObject *self)
+slot_nb_bool(PyObject *self)
 {
 	PyObject *func, *args;
-	static PyObject *nonzero_str, *len_str;
+	static PyObject *bool_str, *len_str;
 	int result = -1;
+	int from_len = 0;
 
-	func = lookup_maybe(self, "__nonzero__", &nonzero_str);
+	func = lookup_maybe(self, "__bool__", &bool_str);
 	if (func == NULL) {
 		if (PyErr_Occurred())
 			return -1;
 		func = lookup_maybe(self, "__len__", &len_str);
 		if (func == NULL)
 			return PyErr_Occurred() ? -1 : 1;
+		from_len = 1;
  	}
 	args = PyTuple_New(0);
 	if (args != NULL) {
 		PyObject *temp = PyObject_Call(func, args, NULL);
 		Py_DECREF(args);
 		if (temp != NULL) {
-			if (PyInt_CheckExact(temp) || PyBool_Check(temp))
+			if (from_len) {
+				/* enforced by slot_nb_len */
 				result = PyObject_IsTrue(temp);
+			}
+			else if (PyBool_Check(temp)) {
+				result = PyObject_IsTrue(temp);
+			}
 			else {
 				PyErr_Format(PyExc_TypeError,
-					     "__nonzero__ should return "
-					     "bool or int, returned %s",
-					     temp->ob_type->tp_name);
+					 "__bool__ should return "
+					 "bool, returned %s",
+					 temp->ob_type->tp_name);
 				result = -1;
 			}
 			Py_DECREF(temp);
@@ -4822,7 +4833,7 @@
 	UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+x"),
 	UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
 	       "abs(x)"),
-	UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquirypred,
+	UNSLOT("__bool__", nb_bool, slot_nb_bool, wrap_inquirypred,
 	       "x != 0"),
 	UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"),
 	BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"),
@@ -5511,6 +5522,8 @@
 	PyObject *obj = NULL;
 	PyTypeObject *obj_type = NULL;
 
+	if (!_PyArg_NoKeywords("super", kwds))
+		return -1;
 	if (!PyArg_ParseTuple(args, "O!|O:super", &PyType_Type, &type, &obj))
 		return -1;
 	if (obj == Py_None)

Modified: python/branches/p3yk-noslice/Objects/unicodeobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/unicodeobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/unicodeobject.c	Fri Dec 15 05:21:50 2006
@@ -2040,7 +2040,32 @@
 
     static const char *hexdigit = "0123456789abcdef";
 
-    repr = PyString_FromStringAndSize(NULL, 2 + 6*size + 1);
+    /* XXX(nnorwitz): rather than over-allocating, it would be
+       better to choose a different scheme.  Perhaps scan the
+       first N-chars of the string and allocate based on that size.
+    */
+    /* Initial allocation is based on the longest-possible unichr
+       escape.
+
+       In wide (UTF-32) builds '\U00xxxxxx' is 10 chars per source
+       unichr, so in this case it's the longest unichr escape. In
+       narrow (UTF-16) builds this is five chars per source unichr
+       since there are two unichrs in the surrogate pair, so in narrow
+       (UTF-16) builds it's not the longest unichr escape.
+
+       In wide or narrow builds '\uxxxx' is 6 chars per source unichr,
+       so in the narrow (UTF-16) build case it's the longest unichr
+       escape.
+    */
+
+    repr = PyString_FromStringAndSize(NULL,
+        2
+#ifdef Py_UNICODE_WIDE
+        + 10*size
+#else
+        + 6*size
+#endif
+        + 1);
     if (repr == NULL)
         return NULL;
 
@@ -2065,15 +2090,6 @@
 #ifdef Py_UNICODE_WIDE
         /* Map 21-bit characters to '\U00xxxxxx' */
         else if (ch >= 0x10000) {
-	    Py_ssize_t offset = p - PyString_AS_STRING(repr);
-
-	    /* Resize the string if necessary */
-	    if (offset + 12 > PyString_GET_SIZE(repr)) {
-		if (_PyString_Resize(&repr, PyString_GET_SIZE(repr) + 100))
-		    return NULL;
-		p = PyString_AS_STRING(repr) + offset;
-	    }
-
             *p++ = '\\';
             *p++ = 'U';
             *p++ = hexdigit[(ch >> 28) & 0x0000000F];
@@ -2086,8 +2102,8 @@
             *p++ = hexdigit[ch & 0x0000000F];
 	    continue;
         }
-#endif
-	/* Map UTF-16 surrogate pairs to Unicode \UXXXXXXXX escapes */
+#else
+	/* Map UTF-16 surrogate pairs to '\U00xxxxxx' */
 	else if (ch >= 0xD800 && ch < 0xDC00) {
 	    Py_UNICODE ch2;
 	    Py_UCS4 ucs;
@@ -2112,6 +2128,7 @@
 	    s--;
 	    size++;
 	}
+#endif
 
         /* Map 16-bit characters to '\uxxxx' */
         if (ch >= 256) {
@@ -2367,6 +2384,7 @@
     Py_UNICODE unimax = PyUnicode_GetMax();
 #endif
 
+    /* XXX overflow detection missing */
     v = _PyUnicode_New((size+Py_UNICODE_SIZE-1)/ Py_UNICODE_SIZE);
     if (v == NULL)
 	goto onError;
@@ -3153,6 +3171,7 @@
 			Py_ssize_t needed = (targetsize - extrachars) + \
 				     (targetsize << 2);
 			extrachars += needed;
+			/* XXX overflow detection missing */
 			if (_PyUnicode_Resize(&v,
 					     PyUnicode_GET_SIZE(v) + needed) < 0) {
 			    Py_DECREF(x);
@@ -6695,11 +6714,11 @@
 }
 
 PyDoc_STRVAR(rpartition__doc__,
-"S.rpartition(sep) -> (head, sep, tail)\n\
+"S.rpartition(sep) -> (tail, sep, head)\n\
 \n\
 Searches for the separator sep in S, starting at the end of S, and returns\n\
 the part before it, the separator itself, and the part after it.  If the\n\
-separator is not found, returns S and two empty strings.");
+separator is not found, returns two empty strings and S.");
 
 static PyObject*
 unicode_rpartition(PyUnicodeObject *self, PyObject *separator)
@@ -7750,10 +7769,11 @@
 	    default:
 		PyErr_Format(PyExc_ValueError,
 			     "unsupported format character '%c' (0x%x) "
-			     "at index %i",
+			     "at index %zd",
 			     (31<=c && c<=126) ? (char)c : '?',
                              (int)c,
-			     (int)(fmt -1 - PyUnicode_AS_UNICODE(uformat)));
+			     (Py_ssize_t)(fmt - 1 -
+					  PyUnicode_AS_UNICODE(uformat)));
 		goto onError;
 	    }
 	    if (sign) {

Modified: python/branches/p3yk-noslice/Objects/weakrefobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/weakrefobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/weakrefobject.c	Fri Dec 15 05:21:50 2006
@@ -184,7 +184,9 @@
 static PyObject *
 weakref_richcompare(PyWeakReference* self, PyWeakReference* other, int op)
 {
-    if (op != Py_EQ || self->ob_type != other->ob_type) {
+    if ((op != Py_EQ && op != Py_NE) ||
+	!PyWeakref_Check(self) ||
+	!PyWeakref_Check(other)) {
         Py_INCREF(Py_NotImplemented);
         return Py_NotImplemented;
     }
@@ -458,12 +460,12 @@
     return PyObject_SetAttr(PyWeakref_GET_OBJECT(proxy), name, value);
 }
 
-static int
-proxy_compare(PyObject *proxy, PyObject *v)
+static PyObject *
+proxy_richcompare(PyObject *proxy, PyObject *v, int op)
 {
-    UNWRAP_I(proxy);
-    UNWRAP_I(v);
-    return PyObject_Compare(proxy, v);
+    UNWRAP(proxy);
+    UNWRAP(v);
+    return PyObject_RichCompare(proxy, v, op);
 }
 
 /* number slots */
@@ -497,7 +499,7 @@
 WRAP_BINARY(proxy_ior, PyNumber_InPlaceOr)
 
 static int
-proxy_nonzero(PyWeakReference *proxy)
+proxy_bool(PyWeakReference *proxy)
 {
     PyObject *o = PyWeakref_GET_OBJECT(proxy);
     if (!proxy_checkref(proxy))
@@ -586,7 +588,7 @@
     proxy_neg,              /*nb_negative*/
     proxy_pos,              /*nb_positive*/
     proxy_abs,              /*nb_absolute*/
-    (inquiry)proxy_nonzero, /*nb_nonzero*/
+    (inquiry)proxy_bool,    /*nb_bool*/
     proxy_invert,           /*nb_invert*/
     proxy_lshift,           /*nb_lshift*/
     proxy_rshift,           /*nb_rshift*/
@@ -641,7 +643,7 @@
     0,				        /* tp_print */
     0,				        /* tp_getattr */
     0, 				        /* tp_setattr */
-    proxy_compare,		        /* tp_compare */
+    0,				        /* tp_compare */
     (reprfunc)proxy_repr,	        /* tp_repr */
     &proxy_as_number,		        /* tp_as_number */
     &proxy_as_sequence,		        /* tp_as_sequence */
@@ -656,7 +658,7 @@
     0,                                  /* tp_doc */
     (traverseproc)gc_traverse,          /* tp_traverse */
     (inquiry)gc_clear,                  /* tp_clear */
-    0,                                  /* tp_richcompare */
+    proxy_richcompare,                  /* tp_richcompare */
     0,                                  /* tp_weaklistoffset */
     (getiterfunc)proxy_iter,            /* tp_iter */
     (iternextfunc)proxy_iternext,       /* tp_iternext */
@@ -675,7 +677,7 @@
     0,				        /* tp_print */
     0,				        /* tp_getattr */
     0, 				        /* tp_setattr */
-    proxy_compare,		        /* tp_compare */
+    0,				        /* tp_compare */
     (unaryfunc)proxy_repr,	        /* tp_repr */
     &proxy_as_number,		        /* tp_as_number */
     &proxy_as_sequence,		        /* tp_as_sequence */
@@ -690,7 +692,7 @@
     0,                                  /* tp_doc */
     (traverseproc)gc_traverse,          /* tp_traverse */
     (inquiry)gc_clear,                  /* tp_clear */
-    0,                                  /* tp_richcompare */
+    proxy_richcompare,                  /* tp_richcompare */
     0,                                  /* tp_weaklistoffset */
     (getiterfunc)proxy_iter,            /* tp_iter */
     (iternextfunc)proxy_iternext,       /* tp_iternext */

Modified: python/branches/p3yk-noslice/PC/VC6/_bsddb.dsp
==============================================================================
Binary files. No diff available.

Modified: python/branches/p3yk-noslice/PC/VC6/_ssl.mak
==============================================================================
--- python/branches/p3yk-noslice/PC/VC6/_ssl.mak	(original)
+++ python/branches/p3yk-noslice/PC/VC6/_ssl.mak	Fri Dec 15 05:21:50 2006
@@ -2,17 +2,17 @@
 !IFDEF DEBUG
 MODULE=_ssl_d.pyd
 TEMP_DIR=x86-temp-debug/_ssl
-CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG
+CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG /DWIN32
 SSL_LIB_DIR=$(SSL_DIR)/out32.dbg
 !ELSE
 MODULE=_ssl.pyd
 TEMP_DIR=x86-temp-release/_ssl
-CFLAGS=/Ox /MD /LD
+CFLAGS=/Ox /MD /LD /DWIN32
 SSL_LIB_DIR=$(SSL_DIR)/out32
 !ENDIF
 
 INCLUDES=-I ../../Include -I .. -I $(SSL_DIR)/inc32
-LIBS=gdi32.lib wsock32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib
+LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib
 
 SOURCE=../../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib
 

Modified: python/branches/p3yk-noslice/PC/VC6/_tkinter.dsp
==============================================================================
Binary files. No diff available.

Modified: python/branches/p3yk-noslice/PC/VC6/bz2.dsp
==============================================================================
Binary files. No diff available.

Modified: python/branches/p3yk-noslice/PC/VC6/pcbuild.dsw
==============================================================================
Binary files. No diff available.

Modified: python/branches/p3yk-noslice/PC/VC6/pythoncore.dsp
==============================================================================
Binary files. No diff available.

Modified: python/branches/p3yk-noslice/PC/VC6/readme.txt
==============================================================================
--- python/branches/p3yk-noslice/PC/VC6/readme.txt	(original)
+++ python/branches/p3yk-noslice/PC/VC6/readme.txt	Fri Dec 15 05:21:50 2006
@@ -62,40 +62,37 @@
 
 _tkinter
     Python wrapper for the Tk windowing system.  Requires building
-    Tcl/Tk first.  Following are instructions for Tcl/Tk 8.4.3:
+    Tcl/Tk first.  Following are instructions for Tcl/Tk 8.4.12.
 
     Get source
     ----------
-    Go to
-        http://prdownloads.sourceforge.net/tcl/
-    and download
-        tcl843-src.zip
-        tk843-src.zip
-    Unzip into
-        dist\tcl8.4.3\
-        dist\tk8.4.3\
-    respectively.
+    In the dist directory, run
+    svn export http://svn.python.org/projects/external/tcl8.4.12
+    svn export http://svn.python.org/projects/external/tk8.4.12
+    svn export http://svn.python.org/projects/external/tix-8.4.0
 
-    Build Tcl first (done here w/ MSVC 6 on Win98SE)
+    Build Tcl first (done here w/ MSVC 6 on Win2K)
     ---------------
-    cd dist\tcl8.4.3\win
-    run vcvars32.bat [necessary even on Win2K]
+    cd dist\tcl8.4.12\win
+    run vcvars32.bat
     nmake -f makefile.vc
-    nmake -f makefile.vc INSTALLDIR=..\..\tcl84 install
+    nmake -f makefile.vc INSTALLDIR=..\..\tcltk install
 
     XXX Should we compile with OPTS=threads?
 
-    XXX Some tests failed in "nmake -f makefile.vc test".
-    XXX all.tcl:  Total 10480   Passed 9743    Skipped 719     Failed 18
-    XXX
-    XXX That was on Win98SE.  On Win2K:
-    XXX all.tcl   Total 10480   Passed 9781    Skipped 698     Failed  1
+    Optional:  run tests, via
+        nmake -f makefile.vc test
+
+        all.tcl:        Total   10835   Passed  10096   Skipped 732     Failed  7
+        Sourced 129 Test Files.
+        Files with failing tests: exec.test expr.test io.test main.test string.test stri
+        ngObj.test
 
     Build Tk
     --------
-    cd dist\tk8.4.3\win
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.3
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.3 INSTALLDIR=..\..\tcl84 install
+    cd dist\tk8.4.12\win
+    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12
+    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install
 
     XXX Should we compile with OPTS=threads?
 
@@ -103,96 +100,59 @@
     XXX failed.  It popped up tons of little windows, and did lots of
     XXX stuff, and nothing blew up.
 
-    XXX Our installer copies a lot of stuff out of the Tcl/Tk install
-    XXX directory.  Is all of that really needed for Python use of Tcl/Tk?
-
-    Make sure the installer matches
-    -------------------------------
-    Ensure that the Wise compiler vrbl _TCLDIR_ is set to the name of
-    the common Tcl/Tk installation directory (tcl84 for the instructions
-    above).  This is needed so the installer can copy various Tcl/Tk
-    files into the Python distribution.
-
-
-zlib
-    Python wrapper for the zlib compression library.  Get the source code
-    for version 1.1.4 from a convenient mirror at:
-        http://www.gzip.org/zlib/
-    Unpack into dist\zlib-1.1.4.
-    A custom pre-link step in the zlib project settings should manage to
-    build zlib-1.1.4\zlib.lib by magic before zlib.pyd (or zlib_d.pyd) is
-    linked in PCbuild\.
-    However, the zlib project is not smart enough to remove anything under
-    zlib-1.1.4\ when you do a clean, so if you want to rebuild zlib.lib
-    you need to clean up zlib-1.1.4\ by hand.
+   Built Tix
+   ---------
+   cd dist\tix-8.4.0\win
+   nmake -f python.mak
+   nmake -f python.mak install
 
 bz2
     Python wrapper for the libbz2 compression library.  Homepage
         http://sources.redhat.com/bzip2/
-    Download the source tarball, bzip2-1.0.2.tar.gz.
-    Unpack into dist\bzip2-1.0.2.  WARNING:  If you're using WinZip, you
-    must disable its "TAR file smart CR/LF conversion" feature (under
-    Options -> Configuration -> Miscellaneous -> Other) for the duration.
-
-    A custom pre-link step in the bz2 project settings should manage to
-    build bzip2-1.0.2\libbz2.lib by magic before bz2.pyd (or bz2_d.pyd) is
-    linked in PCbuild\.
-    However, the bz2 project is not smart enough to remove anything under
-    bzip2-1.0.2\ when you do a clean, so if you want to rebuild bzip2.lib
-    you need to clean up bzip2-1.0.2\ by hand.
-
-    The build step shouldn't yield any warnings or errors, and should end
-    by displaying 6 blocks each terminated with
-        FC: no differences encountered
-    If FC finds differences, see the warning abou WinZip above (when I
-    first tried it, sample3.ref failed due to CRLF conversion).
+    Download the source from the python.org copy into the dist
+    directory:
+
+    svn export http://svn.python.org/projects/external/bzip2-1.0.3
+
+    And requires building bz2 first.
 
-    All of this managed to build bzip2-1.0.2\libbz2.lib, which the Python
+    cd dist\bzip2-1.0.3
+    nmake -f makefile.msc
+
+    All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python
     project links in.
 
 
 _bsddb
-    Go to Sleepycat's download page:
-        http://www.sleepycat.com/download/
+    To use the version of bsddb that Python is built with by default, invoke
+    (in the dist directory)
+
+     svn export http://svn.python.org/projects/external/db-4.4.20
+
+    Then open db-4.4.20\build_win32\Berkeley_DB.dsw and build the "db_static"
+    project for "Release" mode.
+
+    Alternatively, if you want to start with the original sources,
+    go to Sleepycat's download page:
+        http://www.sleepycat.com/downloads/releasehistorybdb.html
+
+    and download version 4.4.20.
 
-    and download version 4.1.25.  The file name is db-4.1.25.NC.zip.
-    XXX with or without strong cryptography?  I picked "without".
+    With or without strong cryptography? You can choose either with or
+    without strong cryptography, as per the instructions below.  By
+    default, Python is built and distributed WITHOUT strong crypto.
 
-    Unpack into
-        dist\db-4.1.25
+    Unpack the sources; if you downloaded the non-crypto version, rename
+    the directory from db-4.4.20.NC to db-4.4.20.
 
-    [If using WinZip to unpack the db-4.1.25.NC distro, that requires
-     renaming the directory (to remove ".NC") after unpacking.
-    ]
-
-    Open
-        dist\db-4.1.25\docs\index.html
-
-    and follow the Windows instructions for building the Sleepycat
-    software.  Note that Berkeley_DB.dsw is in the build_win32 subdirectory.
-    Build the Release version ("build_all -- Win32 Release").
-
-    XXX We're actually linking against Release_static\libdb41s.lib.
-    XXX This yields the following warnings:
-"""
-Compiling...
-_bsddb.c
-Linking...
-   Creating library ./_bsddb.lib and object ./_bsddb.exp
-LINK : warning LNK4049: locally defined symbol "_malloc" imported
-LINK : warning LNK4049: locally defined symbol "_free" imported
-LINK : warning LNK4049: locally defined symbol "_fclose" imported
-LINK : warning LNK4049: locally defined symbol "_fopen" imported
-_bsddb.pyd - 0 error(s), 4 warning(s)
-"""
-    XXX This isn't encouraging, but I don't know what to do about it.
+    Now apply any patches that apply to your version.
 
     To run extensive tests, pass "-u bsddb" to regrtest.py.  test_bsddb3.py
     is then enabled.  Running in verbose mode may be helpful.
 
     XXX The test_bsddb3 tests don't always pass, on Windows (according to
-    XXX me) or on Linux (according to Barry).  I had much better luck
-    XXX on Win2K than on Win98SE.  The common failure mode across platforms
+    XXX me) or on Linux (according to Barry).  (I had much better luck
+    XXX on Win2K than on Win98SE.)  The common failure mode across platforms
     XXX is
     XXX     DBAgainError: (11, 'Resource temporarily unavailable -- unable
     XXX                         to join the environment')

Deleted: /python/branches/p3yk-noslice/PC/VC6/zlib.dsp
==============================================================================
Binary file. No diff available.

Modified: python/branches/p3yk-noslice/PC/_msi.c
==============================================================================
--- python/branches/p3yk-noslice/PC/_msi.c	(original)
+++ python/branches/p3yk-noslice/PC/_msi.c	Fri Dec 15 05:21:50 2006
@@ -495,7 +495,7 @@
 
     status = MsiSummaryInfoGetProperty(si->h, field, &type, &ival, 
 	&fval, sval, &ssize);
-    if (status = ERROR_MORE_DATA) {
+    if (status == ERROR_MORE_DATA) {
 	sval = malloc(ssize);
         status = MsiSummaryInfoGetProperty(si->h, field, &type, &ival, 
     	    &fval, sval, &ssize);

Modified: python/branches/p3yk-noslice/PC/_winreg.c
==============================================================================
--- python/branches/p3yk-noslice/PC/_winreg.c	(original)
+++ python/branches/p3yk-noslice/PC/_winreg.c	Fri Dec 15 05:21:50 2006
@@ -305,7 +305,7 @@
 "handle - The integer Win32 handle.\n"
 "\n"
 "Operations:\n"
-"__nonzero__ - Handles with an open object return true, otherwise false.\n"
+"__bool__ - Handles with an open object return true, otherwise false.\n"
 "__int__ - Converting a handle to an integer returns the Win32 handle.\n"
 "__cmp__ - Handle objects are compared using the handle value.");
 
@@ -375,7 +375,7 @@
 }
 
 static int
-PyHKEY_nonzeroFunc(PyObject *ob)
+PyHKEY_boolFunc(PyObject *ob)
 {
 	return ((PyHKEYObject *)ob)->hkey != 0;
 }
@@ -437,7 +437,7 @@
 	PyHKEY_unaryFailureFunc,	/* nb_negative */
 	PyHKEY_unaryFailureFunc,	/* nb_positive */
 	PyHKEY_unaryFailureFunc,	/* nb_absolute */
-	PyHKEY_nonzeroFunc,		/* nb_nonzero */
+	PyHKEY_boolFunc,		/* nb_bool */
 	PyHKEY_unaryFailureFunc,	/* nb_invert */
 	PyHKEY_binaryFailureFunc,	/* nb_lshift */
 	PyHKEY_binaryFailureFunc,	/* nb_rshift */

Modified: python/branches/p3yk-noslice/PC/example_nt/example.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PC/example_nt/example.vcproj	(original)
+++ python/branches/p3yk-noslice/PC/example_nt/example.vcproj	Fri Dec 15 05:21:50 2006
@@ -39,7 +39,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/export:initexample"
-				AdditionalDependencies="odbc32.lib odbccp32.lib python25.lib"
+				AdditionalDependencies="odbc32.lib odbccp32.lib python26.lib"
 				OutputFile=".\Release/example.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
@@ -105,7 +105,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/export:initexample"
-				AdditionalDependencies="odbc32.lib odbccp32.lib python25_d.lib"
+				AdditionalDependencies="odbc32.lib odbccp32.lib python26_d.lib"
 				OutputFile=".\Debug/example_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"

Modified: python/branches/p3yk-noslice/PC/pyconfig.h
==============================================================================
--- python/branches/p3yk-noslice/PC/pyconfig.h	(original)
+++ python/branches/p3yk-noslice/PC/pyconfig.h	Fri Dec 15 05:21:50 2006
@@ -39,8 +39,12 @@
    would be ISO C conforming). Neither renaming is feasible, so
    we just silence the warnings. */
 
+#ifndef _CRT_SECURE_NO_DEPRECATE
 #define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
 #define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
 
 /* Windows CE does not have these */
 #ifndef MS_WINCE

Modified: python/branches/p3yk-noslice/PCbuild/_ctypes.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild/_ctypes.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild/_ctypes.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,6 +4,7 @@
 	Version="7.10"
 	Name="_ctypes"
 	ProjectGUID="{F22F40F4-D318-40DC-96B3-88DC81CE0894}"
+	RootNamespace="_ctypes"
 	Keyword="Win32Proj">
 	<Platforms>
 		<Platform
@@ -128,7 +129,7 @@
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
+				AdditionalOptions=" /USECL:MS_OPTERON /GS-"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\_ctypes\libffi_msvc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
@@ -268,6 +269,41 @@
 		</File>
 		<File
 			RelativePath="..\Modules\_ctypes\libffi_msvc\win32.c">
+			<FileConfiguration
+				Name="ReleaseAMD64|Win32"
+				ExcludedFromBuild="TRUE">
+				<Tool
+					Name="VCCLCompilerTool"/>
+			</FileConfiguration>
+		</File>
+		<File
+			RelativePath="..\Modules\_ctypes\libffi_msvc\win64.asm">
+			<FileConfiguration
+				Name="Debug|Win32"
+				ExcludedFromBuild="TRUE">
+				<Tool
+					Name="VCCustomBuildTool"/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				ExcludedFromBuild="TRUE">
+				<Tool
+					Name="VCCustomBuildTool"/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="ReleaseAMD64|Win32">
+				<Tool
+					Name="VCCustomBuildTool"
+					CommandLine="amd64_ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;
+"
+					Outputs="&quot;$(IntDir)\win64.obj&quot;"/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="ReleaseItanium|Win32"
+				ExcludedFromBuild="TRUE">
+				<Tool
+					Name="VCCustomBuildTool"/>
+			</FileConfiguration>
 		</File>
 	</Files>
 	<Globals>

Modified: python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj	Fri Dec 15 05:21:50 2006
@@ -683,6 +683,9 @@
 			RelativePath="..\Parser\parsetok.c">
 		</File>
 		<File
+			RelativePath="..\Python\peephole.c">
+		</File>
+		<File
 			RelativePath="..\Modules\posixmodule.c">
 		</File>
 		<File
@@ -725,18 +728,12 @@
 			RelativePath="..\Modules\sha512module.c">
 		</File>
 		<File
-			RelativePath="..\Modules\sha512module.c">
-		</File>
-		<File
 			RelativePath="..\Modules\shamodule.c">
 		</File>
 		<File
 			RelativePath="..\Modules\signalmodule.c">
 		</File>
 		<File
-			RelativePath="..\Modules\signalmodule.c">
-		</File>
-		<File
 			RelativePath="..\Objects\sliceobject.c">
 		</File>
 		<File

Modified: python/branches/p3yk-noslice/PCbuild8/_ctypes.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/_ctypes.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/_ctypes.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,20 +4,24 @@
 	Version="8,00"
 	Name="_ctypes"
 	ProjectGUID="{F22F40F4-D318-40DC-96B3-88DC81CE0894}"
+	RootNamespace="_ctypes"
 	Keyword="Win32Proj"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\_ctypes"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -63,14 +67,15 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"
-				OutputFile="./_ctypes_d.pyd"
+				OutputFile="$(OutDir)\_ctypes_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_ctypes_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="0"
 				BaseAddress="0x1D1A0000"
-				ImportLibrary=".\./_ctypes_d.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -99,9 +104,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\_ctypes"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -120,19 +125,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\_ctypes\libffi_msvc"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="false"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
+				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -147,17 +153,16 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"
-				OutputFile="./_ctypes.pyd"
+				OutputFile="$(OutDir)\_ctypes_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile=".\./_ctypes.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
 				BaseAddress="0x1D1A0000"
-				ImportLibrary=".\./_ctypes.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -185,9 +190,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\_ctypes"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -209,19 +214,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\_ctypes\libffi_msvc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="0"
 				CompileAs="0"
 			/>
 			<Tool
@@ -235,18 +237,19 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"
-				OutputFile="./_ctypes.pyd"
+				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"
+				OutputFile="$(OutDir)\_ctypes.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile=".\./_ctypes.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				SubSystem="0"
 				OptimizeReferences="0"
 				EnableCOMDATFolding="0"
 				BaseAddress="0x1D1A0000"
-				ImportLibrary=".\./_ctypes.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -274,9 +277,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="ia64-temp-release\_ctypes"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -295,22 +298,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\_ctypes\libffi_msvc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="0"
 				CompileAs="0"
 			/>
 			<Tool
@@ -324,18 +325,19 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"
-				OutputFile="./_ctypes.pyd"
+				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"
+				OutputFile="$(OutDir)\_ctypes.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile=".\./_ctypes.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				SubSystem="0"
 				OptimizeReferences="0"
 				EnableCOMDATFolding="0"
 				BaseAddress="0x1D1A0000"
-				ImportLibrary=".\./_ctypes.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/_ctypes_test.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/_ctypes_test.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/_ctypes_test.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,20 +4,24 @@
 	Version="8,00"
 	Name="_ctypes_test"
 	ProjectGUID="{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}"
+	RootNamespace="_ctypes_test"
 	Keyword="Win32Proj"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\_ctypes_test"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes_test"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -62,13 +66,14 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="./_ctypes_test_d.pyd"
+				OutputFile="$(OutDir)\_ctypes_test_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_ctypes_test_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="0"
-				ImportLibrary=".\./_ctypes_test_d.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -97,9 +102,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\_ctypes_test"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes_test"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -118,19 +123,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="false"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
+				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -144,16 +150,15 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="./_ctypes_test.pyd"
+				OutputFile="$(OutDir)/_ctypes_test_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile=".\./_ctypes_test.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				ImportLibrary=".\./_ctypes_test.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -181,9 +186,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="ia64-temp-release\_ctypes_test"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes_test"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -205,18 +210,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
-				Optimization="0"
+				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="false"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
+				DebugInformationFormat="0"
 				CompileAs="0"
 			/>
 			<Tool
@@ -230,15 +233,17 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
-				OutputFile="./_ctypes_test_d.pyd"
+				OutputFile="$(OutDir)\_ctypes_test.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_ctypes_test_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="0"
-				ImportLibrary=".\./_ctypes_test_d.lib"
-				TargetMachine="0"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -266,9 +271,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\_ctypes_test"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_ctypes_test"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="2"
@@ -287,22 +292,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
+				DebugInformationFormat="0"
 				CompileAs="0"
 			/>
 			<Tool
@@ -316,17 +319,17 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				OutputFile="./_ctypes_test.pyd"
+				OutputFile="$(OutDir)\_ctypes_test.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile=".\./_ctypes_test.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				SubSystem="0"
 				OptimizeReferences="0"
 				EnableCOMDATFolding="0"
-				ImportLibrary=".\./_ctypes_test.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/_elementtree.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/_elementtree.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/_elementtree.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="_elementtree"
 	ProjectGUID="{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}"
+	RootNamespace="_elementtree"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\_elementtree"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_elementtree"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -61,14 +65,15 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile="./_elementtree_d.pyd"
+				OutputFile="$(OutDir)\_elementtree_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_elementtree_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D100000"
-				ImportLibrary=".\./_elementtree_d.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -97,9 +102,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\_elementtree"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_elementtree"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -119,16 +124,14 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\expat"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="_DEBUG;HAVE_EXPAT_H;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
@@ -147,15 +150,16 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile="./_elementtree.pyd"
+				OutputFile="$(OutDir)\_elementtree_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_elementtree.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D100000"
-				ImportLibrary=".\./_elementtree.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -183,9 +187,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory="./."
-			IntermediateDirectory=".\ia64-temp-release\_elementtree"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_elementtree"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -208,20 +212,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\expat"
 				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -236,17 +236,17 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile="./_elementtree.pyd"
+				OutputFile="$(OutDir)\_elementtree.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_elementtree.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D100000"
-				ImportLibrary=".\./_elementtree.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -274,9 +274,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\_elementtree"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_elementtree"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -296,23 +296,21 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC,..\Modules\expat"
 				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
 				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -327,17 +325,17 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile="./_elementtree.pyd"
+				OutputFile="$(OutDir)\_elementtree.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_elementtree.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D100000"
-				ImportLibrary=".\./_elementtree.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/_msi.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/_msi.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/_msi.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="_msi"
 	ProjectGUID="{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}"
+	RootNamespace="_msi"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\_msi"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_msi"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -63,13 +67,14 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
-				OutputFile="./_msi.pyd"
+				OutputFile="$(OutDir)\_msi.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_msi.pdb"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./_msi.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -98,9 +103,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\_msi"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_msi"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -121,19 +126,19 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -148,13 +153,15 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
-				OutputFile="./_msi.pyd"
+				OutputFile="$(OutDir)\_msi.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./_msi.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./_msi.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -182,9 +189,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\ia64-temp-release\_msi"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_msi"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -208,21 +215,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -236,15 +238,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
 				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
-				OutputFile="./_msi.pyd"
+				OutputFile="$(OutDir)\_msi.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./_msi.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./_msi.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -272,9 +275,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\_msi"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_msi"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -295,24 +298,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -326,15 +325,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib bufferoverflowU.lib"
-				OutputFile="./_msi.pyd"
+				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
+				OutputFile="$(OutDir)\_msi.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./_msi.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./_msi.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/_sqlite3.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/_sqlite3.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/_sqlite3.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="_sqlite3"
 	ProjectGUID="{2FF0A312-22F9-4C34-B070-842916DE27A9}"
+	RootNamespace="_sqlite3"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\_sqlite3"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_sqlite3"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -61,15 +65,16 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="..\..\sqlite-source-3.3.4\sqlite3.lib"
-				OutputFile="./_sqlite3_d.pyd"
+				OutputFile="$(OutDir)\_sqlite3_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				IgnoreDefaultLibraryNames=""
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_sqlite3_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1e180000"
-				ImportLibrary=".\./_sqlite3_d.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -98,9 +103,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\_sqlite3"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_sqlite"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -120,16 +125,14 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include;..\PC;..\..\sqlite-source-3.3.4"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
@@ -148,16 +151,17 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="..\..\sqlite-source-3.3.4\sqlite3.lib"
-				OutputFile="./_sqlite3.pyd"
+				OutputFile="$(OutDir)\_sqlite3_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				IgnoreDefaultLibraryNames=""
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_sqlite3.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1e180000"
-				ImportLibrary=".\./_sqlite3.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -185,9 +189,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory="./."
-			IntermediateDirectory=".\ia64-temp-release\_sqlite3"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_sqlite3"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -210,20 +214,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include;..\PC;..\..\sqlite-source-3.3.4"
 				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -238,18 +238,18 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
-				AdditionalDependencies="..\..\sqlite-source-3.3.4\ia64\sqlite3.lib"
-				OutputFile="./_sqlite3.pyd"
+				AdditionalDependencies="..\..\sqlite-source-3.3.4\sqlite3.lib"
+				OutputFile="$(OutDir)\_sqlite3.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				IgnoreDefaultLibraryNames=""
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_sqlite3.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1e180000"
-				ImportLibrary=".\./_sqlite3.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -277,9 +277,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\_sqlite3"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\_sqlite3"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -299,23 +299,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include;..\PC;..\..\sqlite-source-3.3.4"
 				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -330,18 +327,18 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				AdditionalDependencies="..\..\sqlite-source-3.3.4\amd64\sqlite3.lib"
-				OutputFile="./_sqlite3.pyd"
+				AdditionalDependencies="..\..\sqlite-source-3.3.4\sqlite3.lib"
+				OutputFile="$(OutDir)\_sqlite3.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				IgnoreDefaultLibraryNames=""
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./_sqlite3.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1e180000"
-				ImportLibrary=".\./_sqlite3.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/make_buildinfo.c
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/make_buildinfo.c	(original)
+++ python/branches/p3yk-noslice/PCbuild8/make_buildinfo.c	Fri Dec 15 05:21:50 2006
@@ -3,19 +3,23 @@
 #include <sys/stat.h>
 #include <stdio.h>
 
-/* This file creates the getbuildinfo.o object, by first
-   invoking subwcrev.exe (if found), and then invoking cl.exe.
-   As a side effect, it might generate PCBuild\getbuildinfo2.c
-   also. If this isn't a subversion checkout, or subwcrev isn't
-   found, it compiles ..\\Modules\\getbuildinfo.c instead.
+/* This file creates the getbuildinfo2.c file, by
+   invoking subwcrev.exe (if found).
+   If this isn't a subversion checkout, or subwcrev isn't
+   found, it copies ..\\Modules\\getbuildinfo.c instead.
+
+   A file, getbuildinfo2.h is then updated to define
+   SUBWCREV if it was a subversion checkout.
+
+   getbuildinfo2.c is part of the pythoncore project with
+   getbuildinfo2.h as a forced include.  This helps
+   VisualStudio refrain from unnecessary compiles much of the
+   time.
 
    Currently, subwcrev.exe is found from the registry entries
    of TortoiseSVN.
 
-   No attempt is made to place getbuildinfo.o into the proper
-   binary directory. This isn't necessary, as this tool is
-   invoked as a pre-link step for pythoncore, so that overwrites
-   any previous getbuildinfo.o.
+   make_buildinfo.exe is called as a pre-build step for pythoncore.
 
 */
 
@@ -40,11 +44,11 @@
 	    type != REG_SZ)
 		/* Registry corrupted */
 		return 0;
-	strcat(command, "bin\\subwcrev.exe");
+	strcat_s(command, sizeof(command), "bin\\subwcrev.exe");
 	if (_stat(command+1, &st) < 0)
 		/* subwcrev.exe not part of the release */
 		return 0;
-	strcat(command, "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo2.c");
+	strcat_s(command, sizeof(command), "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo2.c");
 	puts(command); fflush(stdout);
 	if (system(command) < 0)
 		return 0;
@@ -53,40 +57,25 @@
 
 int main(int argc, char*argv[])
 {
-	char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
-	int do_unlink, result;
-	if (argc != 2) {
-		fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
-		return EXIT_FAILURE;
-	}
-	if (strcmp(argv[1], "Release") == 0) {
-		strcat(command, "-MD ");
-	}
-	else if (strcmp(argv[1], "Debug") == 0) {
-		strcat(command, "-D_DEBUG -MDd ");
-	}
-	else if (strcmp(argv[1], "ReleaseItanium") == 0) {
-		strcat(command, "-MD /USECL:MS_ITANIUM ");
-	}
-	else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
-		strcat(command, "-MD ");
-		strcat(command, "-MD /USECL:MS_OPTERON ");
-	}
-	else {
-		fprintf(stderr, "unsupported configuration %s\n", argv[1]);
-		return EXIT_FAILURE;
-	}
+	char command[500] = "";
+	int svn;
+	FILE *f;
 
-	if ((do_unlink = make_buildinfo2()))
-		strcat(command, "getbuildinfo2.c -DSUBWCREV ");
-	else
-		strcat(command, "..\\Modules\\getbuildinfo.c");
-	strcat(command, " -Fogetbuildinfo.o -I..\\Include -I..\\PC");
-	puts(command); fflush(stdout);
-	result = system(command);
-	if (do_unlink)
-		unlink("getbuildinfo2.c");
-	if (result < 0)
+	if (fopen_s(&f, "getbuildinfo2.h", "w"))
 		return EXIT_FAILURE;
+	/* Get getbuildinfo.c from svn as getbuildinfo2.c */
+	svn = make_buildinfo2();
+	if (svn) {
+		puts("got getbuildinfo2.c from svn.  Updating getbuildinfo2.h");
+		/* yes.  make sure SUBWCREV is defined */
+		fprintf(f, "#define SUBWCREV\n");
+	} else {
+		puts("didn't get getbuildinfo2.c from svn.  Copying from Modules and clearing getbuildinfo2.h");
+		strcat_s(command, sizeof(command), "copy ..\\Modules\\getbuildinfo.c getbuildinfo2.c");
+		puts(command); fflush(stdout);
+		if (system(command) < 0)
+			return EXIT_FAILURE;
+	}
+	fclose(f);
 	return 0;
 }
\ No newline at end of file

Modified: python/branches/p3yk-noslice/PCbuild8/make_buildinfo.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/make_buildinfo.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/make_buildinfo.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,6 +4,7 @@
 	Version="8,00"
 	Name="make_buildinfo"
 	ProjectGUID="{C73F0EC1-358B-4177-940F-0846AC8B04CD}"
+	RootNamespace="make_buildinfo"
 	Keyword="Win32Proj"
 	>
 	<Platforms>
@@ -40,7 +41,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -90,82 +91,8 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="."
-			IntermediateDirectory=".\x86-temp-release\make_buildinfo"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/make_buildinfo.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
+				Description="Making getbuildinfo2.c"
+				CommandLine="$(TargetPath)"
 			/>
 		</Configuration>
 	</Configurations>

Modified: python/branches/p3yk-noslice/PCbuild8/pcbuild.sln
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/pcbuild.sln	(original)
+++ python/branches/p3yk-noslice/PCbuild8/pcbuild.sln	Fri Dec 15 05:21:50 2006
@@ -2,8 +2,8 @@
 # Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"
 	ProjectSection(ProjectDependencies) = postProject
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD}
 		{F0E0541E-F17D-430B-97C4-93ADF0DD284E} = {F0E0541E-F17D-430B-97C4-93ADF0DD284E}
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"
@@ -61,137 +61,244 @@
 		readme.txt = readme.txt
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore_pgo", "pythoncore_pgo.vcproj", "{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}"
 	ProjectSection(ProjectDependencies) = postProject
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_versioninfo", "make_versioninfo.vcproj", "{F0E0541E-F17D-430B-97C4-93ADF0DD284E}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		PGIRelease|Win32 = PGIRelease|Win32
+		PGIRelease|x64 = PGIRelease|x64
+		PGORelease|Win32 = PGORelease|Win32
+		PGORelease|x64 = PGORelease|x64
 		Release|Win32 = Release|Win32
-		ReleaseAMD64|Win32 = ReleaseAMD64|Win32
-		ReleaseItanium|Win32 = ReleaseItanium|Win32
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|Win32.ActiveCfg = Debug|Win32
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|Win32.Build.0 = Debug|Win32
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|x64.ActiveCfg = Debug|x64
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|x64.Build.0 = Debug|x64
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGIRelease|Win32.ActiveCfg = PGIRelease|Win32
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGIRelease|Win32.Build.0 = PGIRelease|Win32
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGIRelease|x64.ActiveCfg = PGIRelease|x64
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGIRelease|x64.Build.0 = PGIRelease|x64
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGORelease|Win32.ActiveCfg = PGORelease|Win32
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGORelease|Win32.Build.0 = PGORelease|Win32
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGORelease|x64.ActiveCfg = PGORelease|x64
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGORelease|x64.Build.0 = PGORelease|x64
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|Win32.ActiveCfg = Release|Win32
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|Win32.Build.0 = Release|Win32
-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|x64.ActiveCfg = Release|x64
+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|x64.Build.0 = Release|x64
 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|Win32.ActiveCfg = Debug|Win32
 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|Win32.Build.0 = Debug|Win32
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|x64.ActiveCfg = Debug|x64
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|x64.Build.0 = Debug|x64
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGIRelease|Win32.Build.0 = Release|Win32
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGIRelease|x64.ActiveCfg = Release|x64
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGIRelease|x64.Build.0 = Release|x64
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGORelease|Win32.Build.0 = Release|Win32
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGORelease|x64.ActiveCfg = Release|x64
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGORelease|x64.Build.0 = Release|x64
 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|Win32.ActiveCfg = Release|Win32
 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|Win32.Build.0 = Release|Win32
-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|x64.ActiveCfg = Release|x64
+		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|x64.Build.0 = Release|x64
 		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug|Win32.ActiveCfg = Debug|Win32
 		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug|Win32.Build.0 = Debug|Win32
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug|x64.ActiveCfg = Debug|x64
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug|x64.Build.0 = Debug|x64
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGIRelease|Win32.Build.0 = Release|Win32
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGIRelease|x64.ActiveCfg = Release|x64
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGIRelease|x64.Build.0 = Release|x64
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGORelease|Win32.Build.0 = Release|Win32
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGORelease|x64.ActiveCfg = Release|x64
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.PGORelease|x64.Build.0 = Release|x64
 		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release|Win32.ActiveCfg = Release|Win32
 		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release|Win32.Build.0 = Release|Win32
-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release|x64.ActiveCfg = Release|x64
+		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release|x64.Build.0 = Release|x64
 		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug|Win32.ActiveCfg = Debug|Win32
 		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug|Win32.Build.0 = Debug|Win32
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug|x64.ActiveCfg = Debug|x64
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug|x64.Build.0 = Debug|x64
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGIRelease|Win32.Build.0 = Release|Win32
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGIRelease|x64.ActiveCfg = Release|x64
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGIRelease|x64.Build.0 = Release|x64
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGORelease|Win32.Build.0 = Release|Win32
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGORelease|x64.ActiveCfg = Release|x64
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.PGORelease|x64.Build.0 = Release|x64
 		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release|Win32.ActiveCfg = Release|Win32
 		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release|Win32.Build.0 = Release|Win32
-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release|x64.ActiveCfg = Release|x64
+		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release|x64.Build.0 = Release|x64
 		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|Win32.ActiveCfg = Debug|Win32
 		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|Win32.Build.0 = Debug|Win32
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|x64.ActiveCfg = Debug|x64
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|x64.Build.0 = Debug|x64
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGIRelease|Win32.Build.0 = Release|Win32
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGIRelease|x64.ActiveCfg = Release|x64
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGIRelease|x64.Build.0 = Release|x64
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGORelease|Win32.Build.0 = Release|Win32
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGORelease|x64.ActiveCfg = Release|x64
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGORelease|x64.Build.0 = Release|x64
 		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.ActiveCfg = Release|Win32
 		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.Build.0 = Release|Win32
-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.ReleaseAMD64|Win32.ActiveCfg = Release|Win32
-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.ReleaseItanium|Win32.ActiveCfg = Release|Win32
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.ActiveCfg = Release|x64
+		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.Build.0 = Release|x64
 		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug|Win32.ActiveCfg = Debug|Win32
 		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug|Win32.Build.0 = Debug|Win32
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug|x64.ActiveCfg = Debug|x64
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug|x64.Build.0 = Debug|x64
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGIRelease|Win32.Build.0 = Release|Win32
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGIRelease|x64.ActiveCfg = Release|x64
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGIRelease|x64.Build.0 = Release|x64
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGORelease|Win32.Build.0 = Release|Win32
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGORelease|x64.ActiveCfg = Release|x64
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.PGORelease|x64.Build.0 = Release|x64
 		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release|Win32.ActiveCfg = Release|Win32
 		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release|Win32.Build.0 = Release|Win32
-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release|x64.ActiveCfg = Release|x64
+		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release|x64.Build.0 = Release|x64
 		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Debug|Win32.ActiveCfg = Debug|Win32
 		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Debug|Win32.Build.0 = Debug|Win32
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Debug|x64.ActiveCfg = Debug|x64
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Debug|x64.Build.0 = Debug|x64
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGIRelease|Win32.Build.0 = Release|Win32
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGIRelease|x64.ActiveCfg = Release|x64
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGIRelease|x64.Build.0 = Release|x64
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGORelease|Win32.Build.0 = Release|Win32
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGORelease|x64.ActiveCfg = Release|x64
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.PGORelease|x64.Build.0 = Release|x64
 		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release|Win32.ActiveCfg = Release|Win32
 		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release|Win32.Build.0 = Release|Win32
-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release|x64.ActiveCfg = Release|x64
+		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release|x64.Build.0 = Release|x64
 		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.ActiveCfg = Debug|Win32
 		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.Build.0 = Debug|Win32
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.ActiveCfg = Release|Win32
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.Build.0 = Release|Win32
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseAMD64|Win32.ActiveCfg = Release|Win32
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseAMD64|Win32.Build.0 = Release|Win32
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseItanium|Win32.ActiveCfg = Release|Win32
-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseItanium|Win32.Build.0 = Release|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.Build.0 = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGIRelease|Win32.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGIRelease|Win32.Build.0 = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGIRelease|x64.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGORelease|Win32.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGORelease|Win32.Build.0 = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGORelease|x64.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.Build.0 = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.ActiveCfg = Debug|Win32
+		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.Build.0 = Debug|Win32
 		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Debug|Win32.ActiveCfg = Debug|Win32
 		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Debug|Win32.Build.0 = Debug|Win32
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Debug|x64.ActiveCfg = Debug|x64
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Debug|x64.Build.0 = Debug|x64
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGIRelease|Win32.Build.0 = Release|Win32
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGIRelease|x64.ActiveCfg = Release|x64
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGIRelease|x64.Build.0 = Release|x64
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGORelease|Win32.Build.0 = Release|Win32
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGORelease|x64.ActiveCfg = Release|x64
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.PGORelease|x64.Build.0 = Release|x64
 		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Release|Win32.ActiveCfg = Release|Win32
 		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Release|Win32.Build.0 = Release|Win32
-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Release|x64.ActiveCfg = Release|x64
+		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Release|x64.Build.0 = Release|x64
 		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Debug|Win32.ActiveCfg = Debug|Win32
 		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Debug|Win32.Build.0 = Debug|Win32
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Debug|x64.ActiveCfg = Debug|x64
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Debug|x64.Build.0 = Debug|x64
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGIRelease|Win32.Build.0 = Release|Win32
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGIRelease|x64.ActiveCfg = Release|x64
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGIRelease|x64.Build.0 = Release|x64
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGORelease|Win32.Build.0 = Release|Win32
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGORelease|x64.ActiveCfg = Release|x64
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.PGORelease|x64.Build.0 = Release|x64
 		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Release|Win32.ActiveCfg = Release|Win32
 		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Release|Win32.Build.0 = Release|Win32
-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
+		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Release|x64.ActiveCfg = Release|x64
 		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Debug|Win32.Build.0 = Debug|Win32
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Debug|x64.ActiveCfg = Debug|x64
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Debug|x64.Build.0 = Debug|x64
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGIRelease|Win32.Build.0 = Release|Win32
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGIRelease|x64.ActiveCfg = Release|x64
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGIRelease|x64.Build.0 = Release|x64
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGORelease|Win32.Build.0 = Release|Win32
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGORelease|x64.ActiveCfg = Release|x64
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.PGORelease|x64.Build.0 = Release|x64
 		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Release|Win32.ActiveCfg = Release|Win32
 		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Release|Win32.Build.0 = Release|Win32
-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Release|x64.ActiveCfg = Release|x64
+		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Release|x64.Build.0 = Release|x64
 		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Debug|Win32.ActiveCfg = Debug|Win32
 		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Debug|Win32.Build.0 = Debug|Win32
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Debug|x64.ActiveCfg = Debug|x64
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Debug|x64.Build.0 = Debug|x64
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGIRelease|Win32.Build.0 = Release|Win32
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGIRelease|x64.ActiveCfg = Release|x64
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGIRelease|x64.Build.0 = Release|x64
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGORelease|Win32.Build.0 = Release|Win32
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGORelease|x64.ActiveCfg = Release|x64
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.PGORelease|x64.Build.0 = Release|x64
 		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Release|Win32.ActiveCfg = Release|Win32
 		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Release|Win32.Build.0 = Release|Win32
-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.Debug|Win32.ActiveCfg = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.Debug|Win32.Build.0 = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.Release|Win32.ActiveCfg = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.Release|Win32.Build.0 = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.ReleaseAMD64|Win32.ActiveCfg = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.ReleaseAMD64|Win32.Build.0 = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.ReleaseItanium|Win32.ActiveCfg = Release|Win32
-		{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}.ReleaseItanium|Win32.Build.0 = Release|Win32
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Release|x64.ActiveCfg = Release|x64
+		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Release|x64.Build.0 = Release|x64
 		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|Win32.Build.0 = Debug|Win32
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|x64.ActiveCfg = Debug|x64
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|x64.Build.0 = Debug|x64
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGIRelease|Win32.Build.0 = Release|Win32
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGIRelease|x64.ActiveCfg = Release|x64
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGIRelease|x64.Build.0 = Release|x64
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGORelease|Win32.Build.0 = Release|Win32
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGORelease|x64.ActiveCfg = Release|x64
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGORelease|x64.Build.0 = Release|x64
 		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|Win32.ActiveCfg = Release|Win32
 		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|Win32.Build.0 = Release|Win32
-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseAMD64|Win32.ActiveCfg = ReleaseAMD64|Win32
-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseAMD64|Win32.Build.0 = ReleaseAMD64|Win32
-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseItanium|Win32.ActiveCfg = ReleaseItanium|Win32
-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseItanium|Win32.Build.0 = ReleaseItanium|Win32
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|x64.ActiveCfg = Release|x64
+		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|x64.Build.0 = Release|x64
 		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|Win32.ActiveCfg = Debug|Win32
 		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|Win32.Build.0 = Debug|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.ActiveCfg = Debug|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.Build.0 = Debug|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGIRelease|Win32.ActiveCfg = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGIRelease|Win32.Build.0 = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGIRelease|x64.ActiveCfg = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGORelease|Win32.ActiveCfg = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGORelease|Win32.Build.0 = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGORelease|x64.ActiveCfg = Release|Win32
 		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|Win32.ActiveCfg = Release|Win32
 		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|Win32.Build.0 = Release|Win32
-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseAMD64|Win32.ActiveCfg = Release|Win32
-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseAMD64|Win32.Build.0 = Release|Win32
-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseItanium|Win32.ActiveCfg = Release|Win32
-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseItanium|Win32.Build.0 = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.ActiveCfg = Release|Win32
+		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: python/branches/p3yk-noslice/PCbuild8/python.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/python.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/python.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="python"
 	ProjectGUID="{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}"
+	RootNamespace="python"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\python"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\python"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -67,11 +71,12 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile=".\./python.exe"
+				OutputFile="$(OutDir)\python.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="1"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
@@ -103,9 +108,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\python"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\python"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -126,15 +131,18 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="0"
+				Optimization="2"
+				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				RuntimeLibrary="3"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
-				BrowseInformation="1"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
 				DebugInformationFormat="3"
@@ -145,9 +153,8 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
+				PreprocessorDefinitions="NDEBUG"
 				Culture="1033"
-				AdditionalIncludeDirectories="..\Include"
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
@@ -155,15 +162,16 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile="./python_d.exe"
+				OutputFile="$(OutDir)\python.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="1"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
-				TargetMachine="1"
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -191,9 +199,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\ia64-temp-release\python"
+			Name="Debug|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\python"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -217,20 +225,14 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM /VSEXTCOMP_VERBOSE"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="true"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
+				BrowseInformation="1"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -239,25 +241,26 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
+				PreprocessorDefinitions="_DEBUG"
 				Culture="1033"
+				AdditionalIncludeDirectories="..\Include"
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK /VSEXTCOMP_VERBOSE"
 				AdditionalDependencies="odbccp32.lib"
-				OutputFile=".\./python.exe"
+				OutputFile="$(OutDir)\python_d.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="1"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
-				TargetMachine="0"
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -285,9 +288,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\python"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\python"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -308,23 +311,18 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="true"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
+				BrowseInformation="1"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -333,25 +331,26 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
+				PreprocessorDefinitions="_DEBUG"
 				Culture="1033"
+				AdditionalIncludeDirectories="..\Include"
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				AdditionalDependencies="odbccp32.lib"
-				OutputFile=".\./python.exe"
+				AdditionalDependencies="odbccp32.lib python26_d.lib"
+				OutputFile="$(OutDir)\python_d.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="1"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
-				TargetMachine="0"
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/pythoncore.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/pythoncore.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/pythoncore.vcproj	Fri Dec 15 05:21:50 2006
@@ -10,14 +10,17 @@
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\pythoncore"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -25,6 +28,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
+				CommandLine=""
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -66,22 +70,20 @@
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
-				Description="generate buildinfo"
-				CommandLine="make_buildinfo.exe $(ConfigurationName)&#x0D;&#x0A;"
+				CommandLine=""
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="getbuildinfo.o"
-				OutputFile="./python25.dll"
+				OutputFile="$(OutDir)\python26.dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
 				IgnoreDefaultLibraryNames="libc"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python25.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				LinkTimeCodeGeneration="0"
 				BaseAddress="0x1e000000"
-				ImportLibrary=".\./python25.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -110,9 +112,106 @@
 			/>
 		</Configuration>
 		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				WholeProgramOptimization="false"
+				AdditionalIncludeDirectories="..\Include,..\PC"
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;_CRT_SECURE_NO_DEPRECATE"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+				AdditionalIncludeDirectories="..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\python26.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames="libc"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				LinkTimeCodeGeneration="0"
+				BaseAddress="0x1e000000"
+				ImportLibrary=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\pythoncore"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -162,16 +261,15 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="getbuildinfo.o"
-				OutputFile="./python25_d.dll"
+				OutputFile="$(OutDir)\python26_d.dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
 				IgnoreDefaultLibraryNames="libc"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python25_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1e000000"
-				ImportLibrary=".\./python25_d.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -200,9 +298,98 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory="./."
-			IntermediateDirectory=".\ia64-temp-release\pythoncore"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm200 "
+				Optimization="0"
+				AdditionalIncludeDirectories="..\Include,..\PC"
+				PreprocessorDefinitions="_DEBUG;USE_DL_EXPORT;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+				AdditionalIncludeDirectories="..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\python26_d.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames="libc"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				BaseAddress="0x1e000000"
+				ImportLibrary=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="PGIRelease|Win32"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -210,6 +397,8 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
+				Description="Get getbuildinfo2.c"
+				CommandLine="make_buildinfo.exe"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -225,20 +414,18 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
+				AdditionalOptions="/Zm200 "
 				Optimization="2"
 				InlineFunctionExpansion="1"
+				WholeProgramOptimization="true"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT"
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;_CRT_SECURE_NO_DEPRECATE"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -253,23 +440,21 @@
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
-				Description="generate buildinfo"
-				CommandLine="make_buildinfo.exe $(ConfigurationName)"
+				CommandLine=""
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
-				AdditionalDependencies="getbuildinfo.o"
-				OutputFile="./python25.dll"
+				OutputFile="$(OutDir)/python26.dll"
 				LinkIncremental="1"
-				SuppressStartupBanner="false"
+				SuppressStartupBanner="true"
 				IgnoreDefaultLibraryNames="libc"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python25.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
+				LinkTimeCodeGeneration="2"
 				BaseAddress="0x1e000000"
-				ImportLibrary=".\./python25.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -294,12 +479,13 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
+				CommandLine=""
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="./."
-			IntermediateDirectory=".\amd64-temp-release\pythoncore"
+			Name="PGIRelease|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -307,6 +493,8 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
+				Description="Get getbuildinfo2.c"
+				CommandLine="make_buildinfo.exe"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -319,23 +507,22 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions="/Zm200  /USECL:MS_OPTERON /GS-"
+				AdditionalOptions="/Zm200 "
 				Optimization="2"
 				InlineFunctionExpansion="1"
+				WholeProgramOptimization="true"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT"
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;_CRT_SECURE_NO_DEPRECATE"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -350,23 +537,21 @@
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
-				Description="generate buildinfo"
-				CommandLine="make_buildinfo.exe $(ConfigurationName)"
+				CommandLine=""
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				AdditionalDependencies="getbuildinfo.o"
-				OutputFile="./python25.dll"
+				OutputFile="$(OutDir)/python26.dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
 				IgnoreDefaultLibraryNames="libc"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./python25.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
+				LinkTimeCodeGeneration="2"
 				BaseAddress="0x1e000000"
-				ImportLibrary=".\./python25.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -391,97 +576,651 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
+				CommandLine=""
 			/>
 		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="zlib"
+		<Configuration
+			Name="PGORelease|Win32"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\PGIRelease\pythoncore"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			BuildLogFile="$(OutDir)\BuildLog.htm"
+			ExcludeBuckets="7"
 			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..\Include,..\PC"
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;_CRT_SECURE_NO_DEPRECATE"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+				AdditionalIncludeDirectories="..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="copy $(PlatformName)\python.exe $(IntDir)&#x0D;&#x0A;$(IntDir)\python.exe ../Tools/pybench/pybench.py -n 1&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\python26.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames="libc"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				LinkTimeCodeGeneration="3"
+				ProfileGuidedDatabase="$(IntDir)\$(TargetName).pgd"
+				BaseAddress="0x1e000000"
+				ImportLibrary=""
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="PGORelease|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythoncore"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			BuildLogFile="$(OutDir)\BuildLog.htm"
+			ExcludeBuckets="7"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..\Include,..\PC"
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;_CRT_SECURE_NO_DEPRECATE"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+				AdditionalIncludeDirectories="..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="copy $(PlatformName)\python.exe $(IntDir)&#x0D;&#x0A;$(IntDir)\python.exe ../Tools/pybench/pybench.py -n 1&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\python26.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames="libc"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				LinkTimeCodeGeneration="3"
+				ProfileGuidedDatabase="$(IntDir)\$(TargetName).pgd"
+				BaseAddress="0x1e000000"
+				ImportLibrary=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="zlib"
+			>
+			<File
+				RelativePath="..\Modules\zlib\adler32.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\compress.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\crc32.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\deflate.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\gzio.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\infback.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\inffast.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\inflate.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\inftrees.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\trees.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\uncompr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\Modules\zlibmodule.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="PGIRelease|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="PGIRelease|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="PGORelease|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="PGORelease|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories="..\Modules\zlib"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\Modules\zlib\zutil.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="include files"
+			>
+			<File
+				RelativePath="..\Include\abstract.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\asdl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\ast.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\bitset.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\boolobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\bufferobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\cellobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\ceval.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\classobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\cobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\code.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\codecs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\compile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\complexobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\cStringIO.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\datetime.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\descrobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\dictobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\enumobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\errcode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\eval.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\fileobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\floatobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\frameobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\funcobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\genobject.h"
+				>
+			</File>
 			<File
-				RelativePath="..\Modules\zlib\adler32.c"
+				RelativePath="..\Include\graminit.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\compress.c"
+				RelativePath="..\Include\grammar.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\crc32.c"
+				RelativePath="..\Include\import.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\deflate.c"
+				RelativePath="..\Include\intobject.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\gzio.c"
+				RelativePath="..\Include\intrcheck.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\infback.c"
+				RelativePath="..\Include\iterobject.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\inffast.c"
+				RelativePath="..\Include\listobject.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\inflate.c"
+				RelativePath="..\Include\longintrepr.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\inftrees.c"
+				RelativePath="..\Include\longobject.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\trees.c"
+				RelativePath="..\Include\marshal.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\uncompr.c"
+				RelativePath="..\Include\metagrammar.h"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\zlibmodule.c"
+				RelativePath="..\Include\methodobject.h"
 				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\Modules\zlib"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\Modules\zlib"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseItanium|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\Modules\zlib"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseAMD64|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\Modules\zlib"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\Modules\zlib\zutil.c"
+				RelativePath="..\Include\modsupport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\moduleobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\node.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\object.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\objimpl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\opcode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\osdefs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\parsetok.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\patchlevel.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pgen.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pgenheaders.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\py_curses.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pyarena.h"
+				>
+			</File>
+			<File
+				RelativePath="..\PC\pyconfig.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pydebug.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pyerrors.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pyexpat.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pyfpe.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pygetopt.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pymactoolbox.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pymem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pyport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pystate.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pystrtod.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\Python-ast.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\Python.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pythonrun.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\pythread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\rangeobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\setobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\sliceobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\stringobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\structmember.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\structseq.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\symtable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\sysmodule.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\timefuncs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\token.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\traceback.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\tupleobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\ucnhash.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\unicodeobject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\Include\weakrefobject.h"
 				>
 			</File>
 		</Filter>
@@ -558,6 +1297,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\Modules\_typesmodule.c"
+			>
+		</File>
+		<File
 			RelativePath="..\Modules\_weakref.c"
 			>
 		</File>
@@ -738,6 +1481,74 @@
 			>
 		</File>
 		<File
+			RelativePath=".\getbuildinfo2.c"
+			>
+			<FileConfiguration
+				Name="Release|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Debug|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGIRelease|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGIRelease|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGORelease|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGORelease|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ForcedIncludeFiles="getbuildinfo2.h"
+				/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\Python\getcompiler.c"
 			>
 		</File>
@@ -797,6 +1608,14 @@
 				/>
 			</FileConfiguration>
 			<FileConfiguration
+				Name="Release|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					AdditionalIncludeDirectories="..\Python"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
 				Name="Debug|Win32"
 				>
 				<Tool
@@ -805,7 +1624,31 @@
 				/>
 			</FileConfiguration>
 			<FileConfiguration
-				Name="ReleaseItanium|Win32"
+				Name="Debug|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					AdditionalIncludeDirectories="..\Python"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGIRelease|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					AdditionalIncludeDirectories="..\Python"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGIRelease|x64"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					AdditionalIncludeDirectories="..\Python"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="PGORelease|Win32"
 				>
 				<Tool
 					Name="VCCLCompilerTool"
@@ -813,7 +1656,7 @@
 				/>
 			</FileConfiguration>
 			<FileConfiguration
-				Name="ReleaseAMD64|Win32"
+				Name="PGORelease|x64"
 				>
 				<Tool
 					Name="VCCLCompilerTool"
@@ -938,6 +1781,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\Python\peephole.c"
+			>
+		</File>
+		<File
 			RelativePath="..\Modules\posixmodule.c"
 			>
 		</File>

Deleted: /python/branches/p3yk-noslice/PCbuild8/pythoncore_pgo.vcproj
==============================================================================
--- /python/branches/p3yk-noslice/PCbuild8/pythoncore_pgo.vcproj	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,781 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8,00"
-	Name="pythoncore_pgo"
-	ProjectGUID="{8B59C1FF-2439-4BE9-9F24-84D4982D28D4}"
-	RootNamespace="pythoncore_pgo"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(ProjectName)"
-			IntermediateDirectory=".\x86-temp-release\$(ProjectName)"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="/Zm200 "
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				WholeProgramOptimization="true"
-				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;_CRT_SECURE_NO_DEPRECATE"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="3"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-				AdditionalIncludeDirectories="..\Include"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-				Description="Generate buildinfo &amp; profile guided optimizations (please be patient)"
-				CommandLine="make_buildinfo.exe $(ConfigurationName)&#x0D;&#x0A;link @$(ProjectName)_link.txt&#x0D;&#x0A;$(OutDir)\python ../Tools/pybench/pybench.py -n 1&#x0D;&#x0A;"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="getbuildinfo.o"
-				OutputFile="$(OutDir)/python25.dll"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				IgnoreDefaultLibraryNames="libc"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile="$(OutDir)/python25.pdb"
-				SubSystem="2"
-				LinkTimeCodeGeneration="3"
-				BaseAddress="0x1e000000"
-				ImportLibrary="$(OutDir)/python25.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="zlib"
-			>
-			<File
-				RelativePath="..\Modules\zlib\adler32.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\compress.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\crc32.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\deflate.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\gzio.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\infback.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\inffast.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\inflate.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\inftrees.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\trees.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\uncompr.c"
-				>
-			</File>
-			<File
-				RelativePath="..\Modules\zlibmodule.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\Modules\zlib"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\Modules\zlib\zutil.c"
-				>
-			</File>
-		</Filter>
-		<File
-			RelativePath="..\Modules\_bisectmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\_codecs_cn.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\_codecs_hk.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\_codecs_iso2022.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\_codecs_jp.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\_codecs_kr.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\_codecs_tw.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_codecsmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_csv.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_functoolsmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_heapqmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_hotshot.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_localemodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_lsprof.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_randommodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_sre.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_struct.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Pc\_subprocess.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\_weakref.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Pc\_winreg.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\abstract.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\acceler.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\arraymodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\asdl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\ast.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\audioop.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\binascii.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\bitset.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\bltinmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\boolobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\bufferobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\cellobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\ceval.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\classobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cmathmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\cobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\codecs.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\codeobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\collectionsmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\compile.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\complexobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\PC\config.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cPickle.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cStringIO.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\datetimemodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\descrobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\dictobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\PC\dl_nt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\dynload_win.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\enumobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\errnomodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\errors.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\exceptions.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\fileobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\firstsets.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\floatobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\frameobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\frozen.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\funcobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\future.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\gcmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\genobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getargs.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getcompiler.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getcopyright.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getmtime.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getopt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\PC\getpathp.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getplatform.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\getversion.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\graminit.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\grammar.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\grammar1.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\imageop.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\import.c"
-			>
-		</File>
-		<File
-			RelativePath="..\PC\import_nt.c"
-			>
-			<FileConfiguration
-				Name="Release|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					AdditionalIncludeDirectories="..\Python"
-				/>
-			</FileConfiguration>
-		</File>
-		<File
-			RelativePath="..\Python\importdl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\intobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\iterobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\itertoolsmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\listnode.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\listobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\longobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\main.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\marshal.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\mathmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\md5.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\md5module.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\metagrammar.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\methodobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\mmapmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\modsupport.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\moduleobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\PC\msvcrtmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\cjkcodecs\multibytecodec.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\myreadline.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\mysnprintf.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\mystrtoul.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\node.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\object.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\obmalloc.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\operator.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\parser.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\parsermodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\parsetok.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\posixmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\pyarena.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\pyfpe.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\pystate.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\pystrtod.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\Python-ast.c"
-			>
-		</File>
-		<File
-			RelativePath="..\PCbuild8\python.exe"
-			>
-			<FileConfiguration
-				Name="Release|Win32"
-				>
-				<Tool
-					Name="VCCustomBuildTool"
-					CommandLine="xcopy $(InputFileName)* $(OutDir) /F /I /Y&#x0D;&#x0A;"
-					Outputs="$(OutDir)\$(InputFileName)"
-				/>
-			</FileConfiguration>
-		</File>
-		<File
-			RelativePath="..\PC\python_nt.rc"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\pythonrun.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\rangeobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\rgbimgmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\rotatingtree.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\setobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\sha256module.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\sha512module.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\sha512module.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\shamodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\signalmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\signalmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\sliceobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\stringobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\stropmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\structmember.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\structseq.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\symtable.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\symtablemodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\sysmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\thread.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\threadmodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\timemodule.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Parser\tokenizer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Python\traceback.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\tupleobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\typeobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\unicodectype.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\unicodeobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Objects\weakrefobject.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\xxsubtype.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\yuvconvert.c"
-			>
-		</File>
-		<File
-			RelativePath="..\Modules\zipimport.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>

Deleted: /python/branches/p3yk-noslice/PCbuild8/pythoncore_pgo_link.txt
==============================================================================
--- /python/branches/p3yk-noslice/PCbuild8/pythoncore_pgo_link.txt	Fri Dec 15 05:21:50 2006
+++ (empty file)
@@ -1,311 +0,0 @@
-/OUT:".\pythoncore_pgo/python25.dll" /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:".\x86-temp-release\pythoncore_pgo\python25.dll.intermediate.manifest" /NODEFAULTLIB:"libc" /DEBUG /PDB:".\pythoncore_pgo/python25.pdb" /SUBSYSTEM:WINDOWS /LTCG:PGINSTRUMENT /PGD:".\pythoncore_pgo\python25.pgd" /BASE:"0x1e000000" /IMPLIB:"pythoncore_pgo/python25.lib" /MACHINE:X86 getbuildinfo.o kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
-
-".\x86-temp-release\pythoncore_pgo\adler32.obj"
-
-".\x86-temp-release\pythoncore_pgo\compress.obj"
-
-".\x86-temp-release\pythoncore_pgo\crc32.obj"
-
-".\x86-temp-release\pythoncore_pgo\deflate.obj"
-
-".\x86-temp-release\pythoncore_pgo\gzio.obj"
-
-".\x86-temp-release\pythoncore_pgo\infback.obj"
-
-".\x86-temp-release\pythoncore_pgo\inffast.obj"
-
-".\x86-temp-release\pythoncore_pgo\inflate.obj"
-
-".\x86-temp-release\pythoncore_pgo\inftrees.obj"
-
-".\x86-temp-release\pythoncore_pgo\trees.obj"
-
-".\x86-temp-release\pythoncore_pgo\uncompr.obj"
-
-".\x86-temp-release\pythoncore_pgo\zlibmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\zutil.obj"
-
-".\x86-temp-release\pythoncore_pgo\_bisectmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecs_cn.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecs_hk.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecs_iso2022.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecs_jp.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecs_kr.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecs_tw.obj"
-
-".\x86-temp-release\pythoncore_pgo\_codecsmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\_csv.obj"
-
-".\x86-temp-release\pythoncore_pgo\_functoolsmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\_heapqmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\_hotshot.obj"
-
-".\x86-temp-release\pythoncore_pgo\_localemodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\_lsprof.obj"
-
-".\x86-temp-release\pythoncore_pgo\_randommodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\_sre.obj"
-
-".\x86-temp-release\pythoncore_pgo\_struct.obj"
-
-".\x86-temp-release\pythoncore_pgo\_subprocess.obj"
-
-".\x86-temp-release\pythoncore_pgo\_weakref.obj"
-
-".\x86-temp-release\pythoncore_pgo\_winreg.obj"
-
-".\x86-temp-release\pythoncore_pgo\abstract.obj"
-
-".\x86-temp-release\pythoncore_pgo\acceler.obj"
-
-".\x86-temp-release\pythoncore_pgo\arraymodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\asdl.obj"
-
-".\x86-temp-release\pythoncore_pgo\ast.obj"
-
-".\x86-temp-release\pythoncore_pgo\audioop.obj"
-
-".\x86-temp-release\pythoncore_pgo\binascii.obj"
-
-".\x86-temp-release\pythoncore_pgo\bitset.obj"
-
-".\x86-temp-release\pythoncore_pgo\bltinmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\boolobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\bufferobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\cellobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\ceval.obj"
-
-".\x86-temp-release\pythoncore_pgo\classobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\cmathmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\cobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\codecs.obj"
-
-".\x86-temp-release\pythoncore_pgo\codeobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\collectionsmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\compile.obj"
-
-".\x86-temp-release\pythoncore_pgo\complexobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\config.obj"
-
-".\x86-temp-release\pythoncore_pgo\cPickle.obj"
-
-".\x86-temp-release\pythoncore_pgo\cStringIO.obj"
-
-".\x86-temp-release\pythoncore_pgo\datetimemodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\descrobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\dictobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\dl_nt.obj"
-
-".\x86-temp-release\pythoncore_pgo\dynload_win.obj"
-
-".\x86-temp-release\pythoncore_pgo\enumobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\errnomodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\errors.obj"
-
-".\x86-temp-release\pythoncore_pgo\exceptions.obj"
-
-".\x86-temp-release\pythoncore_pgo\fileobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\firstsets.obj"
-
-".\x86-temp-release\pythoncore_pgo\floatobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\frameobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\frozen.obj"
-
-".\x86-temp-release\pythoncore_pgo\funcobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\future.obj"
-
-".\x86-temp-release\pythoncore_pgo\gcmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\genobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\getargs.obj"
-
-".\x86-temp-release\pythoncore_pgo\getcompiler.obj"
-
-".\x86-temp-release\pythoncore_pgo\getcopyright.obj"
-
-".\x86-temp-release\pythoncore_pgo\getmtime.obj"
-
-".\x86-temp-release\pythoncore_pgo\getopt.obj"
-
-".\x86-temp-release\pythoncore_pgo\getpathp.obj"
-
-".\x86-temp-release\pythoncore_pgo\getplatform.obj"
-
-".\x86-temp-release\pythoncore_pgo\getversion.obj"
-
-".\x86-temp-release\pythoncore_pgo\graminit.obj"
-
-".\x86-temp-release\pythoncore_pgo\grammar.obj"
-
-".\x86-temp-release\pythoncore_pgo\grammar1.obj"
-
-".\x86-temp-release\pythoncore_pgo\imageop.obj"
-
-".\x86-temp-release\pythoncore_pgo\import.obj"
-
-".\x86-temp-release\pythoncore_pgo\import_nt.obj"
-
-".\x86-temp-release\pythoncore_pgo\importdl.obj"
-
-".\x86-temp-release\pythoncore_pgo\intobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\iterobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\itertoolsmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\listnode.obj"
-
-".\x86-temp-release\pythoncore_pgo\listobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\longobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\main.obj"
-
-".\x86-temp-release\pythoncore_pgo\marshal.obj"
-
-".\x86-temp-release\pythoncore_pgo\mathmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\md5.obj"
-
-".\x86-temp-release\pythoncore_pgo\md5module.obj"
-
-".\x86-temp-release\pythoncore_pgo\metagrammar.obj"
-
-".\x86-temp-release\pythoncore_pgo\methodobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\mmapmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\modsupport.obj"
-
-".\x86-temp-release\pythoncore_pgo\moduleobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\msvcrtmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\multibytecodec.obj"
-
-".\x86-temp-release\pythoncore_pgo\myreadline.obj"
-
-".\x86-temp-release\pythoncore_pgo\mysnprintf.obj"
-
-".\x86-temp-release\pythoncore_pgo\mystrtoul.obj"
-
-".\x86-temp-release\pythoncore_pgo\node.obj"
-
-".\x86-temp-release\pythoncore_pgo\object.obj"
-
-".\x86-temp-release\pythoncore_pgo\obmalloc.obj"
-
-".\x86-temp-release\pythoncore_pgo\operator.obj"
-
-".\x86-temp-release\pythoncore_pgo\parser.obj"
-
-".\x86-temp-release\pythoncore_pgo\parsermodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\parsetok.obj"
-
-".\x86-temp-release\pythoncore_pgo\posixmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\pyarena.obj"
-
-".\x86-temp-release\pythoncore_pgo\pyfpe.obj"
-
-".\x86-temp-release\pythoncore_pgo\pystate.obj"
-
-".\x86-temp-release\pythoncore_pgo\pystrtod.obj"
-
-".\x86-temp-release\pythoncore_pgo\Python-ast.obj"
-
-".\x86-temp-release\pythoncore_pgo\python_nt.res"
-
-".\x86-temp-release\pythoncore_pgo\pythonrun.obj"
-
-".\x86-temp-release\pythoncore_pgo\rangeobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\rgbimgmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\rotatingtree.obj"
-
-".\x86-temp-release\pythoncore_pgo\setobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\sha256module.obj"
-
-".\x86-temp-release\pythoncore_pgo\sha512module.obj"
-
-".\x86-temp-release\pythoncore_pgo\shamodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\signalmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\sliceobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\stringobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\stropmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\structmember.obj"
-
-".\x86-temp-release\pythoncore_pgo\structseq.obj"
-
-".\x86-temp-release\pythoncore_pgo\symtable.obj"
-
-".\x86-temp-release\pythoncore_pgo\symtablemodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\sysmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\thread.obj"
-
-".\x86-temp-release\pythoncore_pgo\threadmodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\timemodule.obj"
-
-".\x86-temp-release\pythoncore_pgo\tokenizer.obj"
-
-".\x86-temp-release\pythoncore_pgo\traceback.obj"
-
-".\x86-temp-release\pythoncore_pgo\tupleobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\typeobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\unicodectype.obj"
-
-".\x86-temp-release\pythoncore_pgo\unicodeobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\weakrefobject.obj"
-
-".\x86-temp-release\pythoncore_pgo\xxsubtype.obj"
-
-".\x86-temp-release\pythoncore_pgo\yuvconvert.obj"
-
-".\x86-temp-release\pythoncore_pgo\zipimport.obj"

Modified: python/branches/p3yk-noslice/PCbuild8/pythonw.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/pythonw.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/pythonw.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="pythonw"
 	ProjectGUID="{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"
+	RootNamespace="pythonw"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\pythonw"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythonw"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -62,11 +66,12 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="./pythonw_d.exe"
+				OutputFile="$(OutDir)\pythonw_d.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./pythonw_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
@@ -98,9 +103,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\pythonw"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythonw"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -120,16 +125,14 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
@@ -141,7 +144,7 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
+				PreprocessorDefinitions="_DEBUG"
 				Culture="1033"
 			/>
 			<Tool
@@ -149,15 +152,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile=".\./pythonw.exe"
+				OutputFile="$(OutDir)\pythonw_d.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./pythonw.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
-				TargetMachine="1"
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -185,9 +189,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\ia64-temp-release\pythonw"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythonw"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -210,20 +214,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -240,16 +240,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
-				OutputFile=".\./pythonw.exe"
+				OutputFile="$(OutDir)\pythonw.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./pythonw.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
-				TargetMachine="0"
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -277,9 +277,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\pythonw"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\pythonw"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -299,23 +299,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -332,16 +329,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				OutputFile=".\./pythonw.exe"
+				OutputFile="$(OutDir)\pythonw.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./pythonw.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				StackReserveSize="2000000"
 				BaseAddress="0x1d000000"
-				TargetMachine="0"
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/readme.txt
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/readme.txt	(original)
+++ python/branches/p3yk-noslice/PCbuild8/readme.txt	Fri Dec 15 05:21:50 2006
@@ -12,7 +12,7 @@
 The proper order to build subprojects:
 
 1) pythoncore (this builds the main Python DLL and library files,
-               python25.{dll, lib} in Release mode)
+               python26.{dll, lib} in Release mode)
               NOTE:  in previous releases, this subproject was
               named after the release number, e.g. python20.
 
@@ -25,8 +25,21 @@
    to the subsystems they implement, or are running a Python core buildbot
    test slave; see SUBPROJECTS below)
 
+Binary files go into PCBuild8\Win32 or \x64 directories and don't
+interfere with each other.
+
 When using the Debug setting, the output files have a _d added to
-their name:  python25_d.dll, python_d.exe, parser_d.pyd, and so on.
+their name:  python26_d.dll, python_d.exe, parser_d.pyd, and so on.
+
+There are two special configurations for the pythoncore project and
+the solution.  These are PGIRelease and PGORelease.  They are for
+createing profile-guided optimized versions of python.dll.
+The former creates the instrumented binaries, and the latter
+runs python.exe with the instrumented python.dll on the performance
+testsuite, and creates a new, optimized, python.dll in
+PCBuild8\Win32\PGORelease, or in the x64 folder.  Note that although
+we can cross-compile x64 binaries on a 32 bit machine, we cannot
+create the PGO binaries, since they require actually running the code.
 
 SUBPROJECTS
 -----------
@@ -37,12 +50,6 @@
 
 pythoncore
     .dll and .lib
-pythoncore_pgo
-	.dll and .lib, a variant of pythoncore that is optimized through a 
-	Profile Guided Optimization (PGO), employing pybench as the profile
-	case to optimize for. The results are produced as a python25.{dll,lib}
-	in the subfolder 'pythoncore_pgo'. To use this instead of the 
-	standard Python dll place this dll with the python.exe.
 python
     .exe
 pythonw

Modified: python/branches/p3yk-noslice/PCbuild8/select.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/select.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/select.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="select"
 	ProjectGUID="{97239A56-DBC0-41D2-BC14-C87D9B97D63B}"
+	RootNamespace="select"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\select"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\select"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -64,15 +68,16 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="wsock32.lib"
-				OutputFile="./select.pyd"
+				OutputFile="$(OutDir)\select.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				IgnoreDefaultLibraryNames="libc"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./select.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D110000"
-				ImportLibrary=".\./select.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -101,9 +106,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\select"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\select"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -123,13 +128,17 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="0"
+				Optimization="2"
+				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS"
-				RuntimeLibrary="3"
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
@@ -148,16 +157,17 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="wsock32.lib"
-				OutputFile="./select_d.pyd"
+				OutputFile="$(OutDir)\select.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				IgnoreDefaultLibraryNames="libc,msvcrt"
+				AdditionalLibraryDirectories="$(OutDir)"
+				IgnoreDefaultLibraryNames="libc"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./select_d.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D110000"
-				ImportLibrary=".\./select_d.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -185,9 +195,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\ia64-temp-release\select"
+			Name="Debug|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\select"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -210,20 +220,13 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS"
-				StringPooling="true"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -238,18 +241,18 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
 				AdditionalDependencies="wsock32.lib"
-				OutputFile="./select.pyd"
+				OutputFile="$(OutDir)\select_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				IgnoreDefaultLibraryNames="libc"
+				AdditionalLibraryDirectories="$(OutDir)"
+				IgnoreDefaultLibraryNames="libc,msvcrt"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./select.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D110000"
-				ImportLibrary=".\./select.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -277,9 +280,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\select"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\select"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -299,23 +302,17 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS"
-				StringPooling="true"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -330,18 +327,18 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
 				AdditionalDependencies="wsock32.lib"
-				OutputFile="./select.pyd"
+				OutputFile="$(OutDir)\select_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				IgnoreDefaultLibraryNames="libc"
+				AdditionalLibraryDirectories="$(OutDir)"
+				IgnoreDefaultLibraryNames="libc,msvcrt"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./select.pdb"
+				ProgramDatabaseFile=""
 				SubSystem="2"
 				BaseAddress="0x1D110000"
-				ImportLibrary=".\./select.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/unicodedata.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/unicodedata.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/unicodedata.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="unicodedata"
 	ProjectGUID="{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}"
+	RootNamespace="unicodedata"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\unicodedata"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\unicodedata"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -63,12 +67,14 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="./unicodedata.pyd"
+				OutputFile="$(OutDir)\unicodedata.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./unicodedata.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D120000"
-				ImportLibrary=".\./unicodedata.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -97,9 +103,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\unicodedata"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\unicodedata"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -120,18 +126,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="0"
+				Optimization="2"
+				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -145,14 +153,15 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="./unicodedata_d.pyd"
+				OutputFile="$(OutDir)\unicodedata.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./unicodedata_d.pdb"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D120000"
-				ImportLibrary=".\./unicodedata_d.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -180,9 +189,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\ia64-temp-release\unicodedata"
+			Name="Debug|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\unicodedata"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -206,20 +215,14 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"
-				StringPooling="true"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -234,14 +237,15 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
-				OutputFile="./unicodedata.pyd"
+				OutputFile="$(OutDir)\unicodedata_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./unicodedata.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D120000"
-				ImportLibrary=".\./unicodedata.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -269,9 +273,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\unicodedata"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\unicodedata"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -292,23 +296,18 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"
-				StringPooling="true"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
@@ -323,14 +322,15 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
-				OutputFile="./unicodedata.pyd"
+				OutputFile="$(OutDir)\unicodedata_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./unicodedata.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D120000"
-				ImportLibrary=".\./unicodedata.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/PCbuild8/w9xpopen.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/w9xpopen.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/w9xpopen.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="w9xpopen"
 	ProjectGUID="{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"
+	RootNamespace="w9xpopen"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\w9xpopen"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\w9xpopen"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -60,11 +64,12 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="./w9xpopen_d.exe"
+				OutputFile="$(OutDir)\w9xpopen_d.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./w9xpopen_d.pdb"
+				ProgramDatabaseFile=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -93,9 +98,89 @@
 			/>
 		</Configuration>
 		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\w9xpopen"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\w9xpopen_d.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
 			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\w9xpopen"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\w9xpopen"
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -140,10 +225,12 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile=".\./w9xpopen.exe"
+				OutputFile="$(OutDir)\w9xpopen.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./w9xpopen.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -171,6 +258,87 @@
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\w9xpopen"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\w9xpopen.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
 	</Configurations>
 	<References>
 	</References>

Modified: python/branches/p3yk-noslice/PCbuild8/winsound.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/winsound.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild8/winsound.vcproj	Fri Dec 15 05:21:50 2006
@@ -4,19 +4,23 @@
 	Version="8,00"
 	Name="winsound"
 	ProjectGUID="{51F35FAE-FB92-4B2C-9187-1542C065AD77}"
+	RootNamespace="winsound"
 	>
 	<Platforms>
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-debug\winsound"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\winsound"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -63,13 +67,14 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="winmm.lib"
-				OutputFile="./winsound_d.pyd"
+				OutputFile="$(OutDir)\winsound_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="$(OutDir)"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\./winsound_d.pdb"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./winsound_d.lib"
+				ImportLibrary=""
 				TargetMachine="1"
 			/>
 			<Tool
@@ -98,9 +103,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\x86-temp-release\winsound"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\winsound"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -121,19 +126,19 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
+				Optimization="0"
 				AdditionalIncludeDirectories="..\Include,..\PC"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -148,13 +153,15 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="winmm.lib"
-				OutputFile="./winsound.pyd"
+				OutputFile="$(OutDir)\winsound_d.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./winsound.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./winsound.lib"
-				TargetMachine="1"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -182,9 +189,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseItanium|Win32"
-			OutputDirectory=".\."
-			IntermediateDirectory=".\ia64-temp-release\winsound"
+			Name="Release|Win32"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\winsound"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -208,21 +215,16 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_ITANIUM"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -236,15 +238,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
 				AdditionalDependencies="winmm.lib"
-				OutputFile="./winsound.pyd"
+				OutputFile="$(OutDir)\winsound.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./winsound.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./winsound.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -272,9 +275,9 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="ReleaseAMD64|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="amd64-temp-release\winsound"
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\winsound"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
@@ -295,24 +298,20 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="..\Include,..\PC"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"
 				StringPooling="true"
-				BasicRuntimeChecks="0"
 				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
 				CompileAs="0"
 			/>
 			<Tool
@@ -326,15 +325,16 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
 				AdditionalDependencies="winmm.lib"
-				OutputFile="./winsound.pyd"
+				OutputFile="$(OutDir)\winsound.pyd"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\./winsound.pdb"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=""
 				BaseAddress="0x1D160000"
-				ImportLibrary=".\./winsound.lib"
-				TargetMachine="0"
+				ImportLibrary=""
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"

Modified: python/branches/p3yk-noslice/Parser/Python.asdl
==============================================================================
--- python/branches/p3yk-noslice/Parser/Python.asdl	(original)
+++ python/branches/p3yk-noslice/Parser/Python.asdl	Fri Dec 15 05:21:50 2006
@@ -36,11 +36,6 @@
 	      | Import(alias* names)
 	      | ImportFrom(identifier module, alias* names, int? level)
 
-	      -- Doesn't capture requirement that locals must be
-	      -- defined if globals is
-	      -- still supports use as a function!
-	      | Exec(expr body, expr? globals, expr? locals)
-
 	      | Global(identifier* names)
 	      | Expr(expr value)
 	      | Pass | Break | Continue
@@ -56,6 +51,7 @@
 	     | Lambda(arguments args, expr body)
 	     | IfExp(expr test, expr body, expr orelse)
 	     | Dict(expr* keys, expr* values)
+	     | Set(expr* elts)
 	     | ListComp(expr elt, comprehension* generators)
 	     | GeneratorExp(expr elt, comprehension* generators)
 	     -- the grammar constrains where yield expressions can occur
@@ -65,9 +61,9 @@
 	     | Compare(expr left, cmpop* ops, expr* comparators)
 	     | Call(expr func, expr* args, keyword* keywords,
 			 expr? starargs, expr? kwargs)
-	     | Repr(expr value)
 	     | Num(object n) -- a number as a PyObject.
 	     | Str(string s) -- need to specify raw, unicode, etc?
+	     | Ellipsis
 	     -- other literals? bools?
 
 	     -- the following expression can appear in assignment context
@@ -82,7 +78,7 @@
 
 	expr_context = Load | Store | Del | AugLoad | AugStore | Param
 
-	slice = Ellipsis | Slice(expr? lower, expr? upper, expr? step) 
+	slice = Slice(expr? lower, expr? upper, expr? step) 
 	      | ExtSlice(slice* dims) 
 	      | Index(expr value) 
 
@@ -104,8 +100,8 @@
 	excepthandler = (expr? type, expr? name, stmt* body, int lineno,
 	                 int col_offset)
 
-	arguments = (expr* args, identifier? vararg, 
-		     identifier? kwarg, expr* defaults)
+	arguments = (expr* args, identifier? vararg, expr* kwonlyargs,
+		         identifier? kwarg, expr* defaults, expr* kw_defaults)
 
         -- keyword arguments supplied to call
         keyword = (identifier arg, expr value)

Modified: python/branches/p3yk-noslice/Parser/asdl.py
==============================================================================
--- python/branches/p3yk-noslice/Parser/asdl.py	(original)
+++ python/branches/p3yk-noslice/Parser/asdl.py	Fri Dec 15 05:21:50 2006
@@ -98,7 +98,7 @@
 
     def t_default(self, s):
         r" . +"
-        raise ValueError, "unmatched input: %s" % `s`
+        raise ValueError, "unmatched input: %r" % s
 
 class ASDLParser(spark.GenericParser, object):
     def __init__(self):

Modified: python/branches/p3yk-noslice/Parser/asdl_c.py
==============================================================================
--- python/branches/p3yk-noslice/Parser/asdl_c.py	(original)
+++ python/branches/p3yk-noslice/Parser/asdl_c.py	Fri Dec 15 05:21:50 2006
@@ -47,7 +47,7 @@
         # XXX this should be fixed for real
         if i == -1 and 'GeneratorExp' in cur:
             i = size + 3
-        assert i != -1, "Impossible line %d to reflow: %s" % (size, `s`)
+        assert i != -1, "Impossible line %d to reflow: %r" % (size, s)
         lines.append(padding + cur[:i])
         if len(lines) == 1:
             # find new size based on brace

Modified: python/branches/p3yk-noslice/Parser/parser.c
==============================================================================
--- python/branches/p3yk-noslice/Parser/parser.c	(original)
+++ python/branches/p3yk-noslice/Parser/parser.c	Fri Dec 15 05:21:50 2006
@@ -183,7 +183,7 @@
 future_hack(parser_state *ps)
 {
 	node *n = ps->p_stack.s_top->s_parent;
-	node *ch;
+	node *ch, *cch;
 	int i;
 
 	/* from __future__ import ..., must have at least 4 children */
@@ -197,15 +197,17 @@
 	if (NCH(ch) == 1 && STR(CHILD(ch, 0)) &&
 	    strcmp(STR(CHILD(ch, 0)), "__future__") != 0)
 		return;
-	for (i = 3; i < NCH(n); i += 2) {
-		/* XXX: assume we don't have parentheses in import:
-		        from __future__ import (x, y, z)
-		*/
-		ch = CHILD(n, i);
-		if (NCH(ch) == 1)
-			ch = CHILD(ch, 0);
-		if (NCH(ch) >= 1 && TYPE(CHILD(ch, 0)) == NAME &&
-		    strcmp(STR(CHILD(ch, 0)), "with_statement") == 0) {
+	ch = CHILD(n, 3);
+	/* ch can be a star, a parenthesis or import_as_names */
+	if (TYPE(ch) == STAR)
+		return;
+	if (TYPE(ch) == LPAR)
+		ch = CHILD(n, 4);
+	
+	for (i = 0; i < NCH(ch); i += 2) {
+		cch = CHILD(ch, i);
+		if (NCH(cch) >= 1 && TYPE(CHILD(cch, 0)) == NAME &&
+		    strcmp(STR(CHILD(cch, 0)), "with_statement") == 0) {
 			ps->p_flags |= CO_FUTURE_WITH_STATEMENT;
 			break;
 		}

Modified: python/branches/p3yk-noslice/Parser/parsetok.c
==============================================================================
--- python/branches/p3yk-noslice/Parser/parsetok.c	(original)
+++ python/branches/p3yk-noslice/Parser/parsetok.c	Fri Dec 15 05:21:50 2006
@@ -82,9 +82,6 @@
 	return parsetok(tok, g, start, err_ret, flags);
 }
 
-/* Parse input coming from the given tokenizer structure.
-   Return error code. */
-
 #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
 static char with_msg[] =
 "%s:%d: Warning: 'with' will become a reserved keyword in Python 2.6\n";
@@ -101,6 +98,9 @@
 }
 #endif
 
+/* Parse input coming from the given tokenizer structure.
+   Return error code. */
+
 static node *
 parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
 	 int flags)

Modified: python/branches/p3yk-noslice/Parser/tokenizer.c
==============================================================================
--- python/branches/p3yk-noslice/Parser/tokenizer.c	(original)
+++ python/branches/p3yk-noslice/Parser/tokenizer.c	Fri Dec 15 05:21:50 2006
@@ -67,7 +67,6 @@
 	"EQUAL",
 	"DOT",
 	"PERCENT",
-	"BACKQUOTE",
 	"LBRACE",
 	"RBRACE",
 	"EQEQUAL",
@@ -897,7 +896,7 @@
 				tok->cur = tok->buf + cur;
 				tok->line_start = tok->cur;
 				/* replace "\r\n" with "\n" */
-				/* For Mac leave the \r, giving syntax error */
+				/* For Mac leave the \r, giving a syntax error */
 				pt = tok->inp - 2;
 				if (pt >= tok->buf && *pt == '\r') {
 					*pt++ = '\n';
@@ -955,7 +954,6 @@
 	case '=':	return EQUAL;
 	case '.':	return DOT;
 	case '%':	return PERCENT;
-	case '`':	return BACKQUOTE;
 	case '{':	return LBRACE;
 	case '}':	return RBRACE;
 	case '^':	return CIRCUMFLEX;
@@ -982,7 +980,6 @@
 		break;
 	case '<':
 		switch (c2) {
-		case '>':	return NOTEQUAL;
 		case '=':	return LESSEQUAL;
 		case '<':	return LEFTSHIFT;
 		}

Modified: python/branches/p3yk-noslice/Python/Python-ast.c
==============================================================================
--- python/branches/p3yk-noslice/Python/Python-ast.c	(original)
+++ python/branches/p3yk-noslice/Python/Python-ast.c	Fri Dec 15 05:21:50 2006
@@ -123,12 +123,6 @@
         "names",
         "level",
 };
-static PyTypeObject *Exec_type;
-static char *Exec_fields[]={
-        "body",
-        "globals",
-        "locals",
-};
 static PyTypeObject *Global_type;
 static char *Global_fields[]={
         "names",
@@ -178,6 +172,10 @@
         "keys",
         "values",
 };
+static PyTypeObject *Set_type;
+static char *Set_fields[]={
+        "elts",
+};
 static PyTypeObject *ListComp_type;
 static char *ListComp_fields[]={
         "elt",
@@ -206,10 +204,6 @@
         "starargs",
         "kwargs",
 };
-static PyTypeObject *Repr_type;
-static char *Repr_fields[]={
-        "value",
-};
 static PyTypeObject *Num_type;
 static char *Num_fields[]={
         "n",
@@ -218,6 +212,7 @@
 static char *Str_fields[]={
         "s",
 };
+static PyTypeObject *Ellipsis_type;
 static PyTypeObject *Attribute_type;
 static char *Attribute_fields[]={
         "value",
@@ -257,7 +252,6 @@
 static PyTypeObject *Param_type;
 static PyTypeObject *slice_type;
 static PyObject* ast2obj_slice(void*);
-static PyTypeObject *Ellipsis_type;
 static PyTypeObject *Slice_type;
 static char *Slice_fields[]={
         "lower",
@@ -339,8 +333,10 @@
 static char *arguments_fields[]={
         "args",
         "vararg",
+        "kwonlyargs",
         "kwarg",
         "defaults",
+        "kw_defaults",
 };
 static PyTypeObject *keyword_type;
 static PyObject* ast2obj_keyword(void*);
@@ -494,8 +490,6 @@
         ImportFrom_type = make_type("ImportFrom", stmt_type, ImportFrom_fields,
                                     3);
         if (!ImportFrom_type) return 0;
-        Exec_type = make_type("Exec", stmt_type, Exec_fields, 3);
-        if (!Exec_type) return 0;
         Global_type = make_type("Global", stmt_type, Global_fields, 1);
         if (!Global_type) return 0;
         Expr_type = make_type("Expr", stmt_type, Expr_fields, 1);
@@ -521,6 +515,8 @@
         if (!IfExp_type) return 0;
         Dict_type = make_type("Dict", expr_type, Dict_fields, 2);
         if (!Dict_type) return 0;
+        Set_type = make_type("Set", expr_type, Set_fields, 1);
+        if (!Set_type) return 0;
         ListComp_type = make_type("ListComp", expr_type, ListComp_fields, 2);
         if (!ListComp_type) return 0;
         GeneratorExp_type = make_type("GeneratorExp", expr_type,
@@ -532,12 +528,12 @@
         if (!Compare_type) return 0;
         Call_type = make_type("Call", expr_type, Call_fields, 5);
         if (!Call_type) return 0;
-        Repr_type = make_type("Repr", expr_type, Repr_fields, 1);
-        if (!Repr_type) return 0;
         Num_type = make_type("Num", expr_type, Num_fields, 1);
         if (!Num_type) return 0;
         Str_type = make_type("Str", expr_type, Str_fields, 1);
         if (!Str_type) return 0;
+        Ellipsis_type = make_type("Ellipsis", expr_type, NULL, 0);
+        if (!Ellipsis_type) return 0;
         Attribute_type = make_type("Attribute", expr_type, Attribute_fields, 3);
         if (!Attribute_type) return 0;
         Subscript_type = make_type("Subscript", expr_type, Subscript_fields, 3);
@@ -578,8 +574,6 @@
         slice_type = make_type("slice", AST_type, NULL, 0);
         if (!slice_type) return 0;
         if (!add_attributes(slice_type, NULL, 0)) return 0;
-        Ellipsis_type = make_type("Ellipsis", slice_type, NULL, 0);
-        if (!Ellipsis_type) return 0;
         Slice_type = make_type("Slice", slice_type, Slice_fields, 3);
         if (!Slice_type) return 0;
         ExtSlice_type = make_type("ExtSlice", slice_type, ExtSlice_fields, 1);
@@ -716,7 +710,7 @@
         excepthandler_type = make_type("excepthandler", AST_type,
                                        excepthandler_fields, 5);
         if (!excepthandler_type) return 0;
-        arguments_type = make_type("arguments", AST_type, arguments_fields, 4);
+        arguments_type = make_type("arguments", AST_type, arguments_fields, 6);
         if (!arguments_type) return 0;
         keyword_type = make_type("keyword", AST_type, keyword_fields, 2);
         if (!keyword_type) return 0;
@@ -1170,30 +1164,6 @@
 }
 
 stmt_ty
-Exec(expr_ty body, expr_ty globals, expr_ty locals, int lineno, int col_offset,
-     PyArena *arena)
-{
-        stmt_ty p;
-        if (!body) {
-                PyErr_SetString(PyExc_ValueError,
-                                "field body is required for Exec");
-                return NULL;
-        }
-        p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p));
-        if (!p) {
-                PyErr_NoMemory();
-                return NULL;
-        }
-        p->kind = Exec_kind;
-        p->v.Exec.body = body;
-        p->v.Exec.globals = globals;
-        p->v.Exec.locals = locals;
-        p->lineno = lineno;
-        p->col_offset = col_offset;
-        return p;
-}
-
-stmt_ty
 Global(asdl_seq * names, int lineno, int col_offset, PyArena *arena)
 {
         stmt_ty p;
@@ -1441,6 +1411,22 @@
 }
 
 expr_ty
+Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena)
+{
+        expr_ty p;
+        p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
+        if (!p) {
+                PyErr_NoMemory();
+                return NULL;
+        }
+        p->kind = Set_kind;
+        p->v.Set.elts = elts;
+        p->lineno = lineno;
+        p->col_offset = col_offset;
+        return p;
+}
+
+expr_ty
 ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset,
          PyArena *arena)
 {
@@ -1553,12 +1539,12 @@
 }
 
 expr_ty
-Repr(expr_ty value, int lineno, int col_offset, PyArena *arena)
+Num(object n, int lineno, int col_offset, PyArena *arena)
 {
         expr_ty p;
-        if (!value) {
+        if (!n) {
                 PyErr_SetString(PyExc_ValueError,
-                                "field value is required for Repr");
+                                "field n is required for Num");
                 return NULL;
         }
         p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
@@ -1566,20 +1552,20 @@
                 PyErr_NoMemory();
                 return NULL;
         }
-        p->kind = Repr_kind;
-        p->v.Repr.value = value;
+        p->kind = Num_kind;
+        p->v.Num.n = n;
         p->lineno = lineno;
         p->col_offset = col_offset;
         return p;
 }
 
 expr_ty
-Num(object n, int lineno, int col_offset, PyArena *arena)
+Str(string s, int lineno, int col_offset, PyArena *arena)
 {
         expr_ty p;
-        if (!n) {
+        if (!s) {
                 PyErr_SetString(PyExc_ValueError,
-                                "field n is required for Num");
+                                "field s is required for Str");
                 return NULL;
         }
         p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
@@ -1587,29 +1573,23 @@
                 PyErr_NoMemory();
                 return NULL;
         }
-        p->kind = Num_kind;
-        p->v.Num.n = n;
+        p->kind = Str_kind;
+        p->v.Str.s = s;
         p->lineno = lineno;
         p->col_offset = col_offset;
         return p;
 }
 
 expr_ty
-Str(string s, int lineno, int col_offset, PyArena *arena)
+Ellipsis(int lineno, int col_offset, PyArena *arena)
 {
         expr_ty p;
-        if (!s) {
-                PyErr_SetString(PyExc_ValueError,
-                                "field s is required for Str");
-                return NULL;
-        }
         p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
         if (!p) {
                 PyErr_NoMemory();
                 return NULL;
         }
-        p->kind = Str_kind;
-        p->v.Str.s = s;
+        p->kind = Ellipsis_kind;
         p->lineno = lineno;
         p->col_offset = col_offset;
         return p;
@@ -1758,19 +1738,6 @@
 }
 
 slice_ty
-Ellipsis(PyArena *arena)
-{
-        slice_ty p;
-        p = (slice_ty)PyArena_Malloc(arena, sizeof(*p));
-        if (!p) {
-                PyErr_NoMemory();
-                return NULL;
-        }
-        p->kind = Ellipsis_kind;
-        return p;
-}
-
-slice_ty
 Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena)
 {
         slice_ty p;
@@ -1863,8 +1830,8 @@
 }
 
 arguments_ty
-arguments(asdl_seq * args, identifier vararg, identifier kwarg, asdl_seq *
-          defaults, PyArena *arena)
+arguments(asdl_seq * args, identifier vararg, asdl_seq * kwonlyargs, identifier
+          kwarg, asdl_seq * defaults, asdl_seq * kw_defaults, PyArena *arena)
 {
         arguments_ty p;
         p = (arguments_ty)PyArena_Malloc(arena, sizeof(*p));
@@ -1874,8 +1841,10 @@
         }
         p->args = args;
         p->vararg = vararg;
+        p->kwonlyargs = kwonlyargs;
         p->kwarg = kwarg;
         p->defaults = defaults;
+        p->kw_defaults = kw_defaults;
         return p;
 }
 
@@ -2279,25 +2248,6 @@
                         goto failed;
                 Py_DECREF(value);
                 break;
-        case Exec_kind:
-                result = PyType_GenericNew(Exec_type, NULL, NULL);
-                if (!result) goto failed;
-                value = ast2obj_expr(o->v.Exec.body);
-                if (!value) goto failed;
-                if (PyObject_SetAttrString(result, "body", value) == -1)
-                        goto failed;
-                Py_DECREF(value);
-                value = ast2obj_expr(o->v.Exec.globals);
-                if (!value) goto failed;
-                if (PyObject_SetAttrString(result, "globals", value) == -1)
-                        goto failed;
-                Py_DECREF(value);
-                value = ast2obj_expr(o->v.Exec.locals);
-                if (!value) goto failed;
-                if (PyObject_SetAttrString(result, "locals", value) == -1)
-                        goto failed;
-                Py_DECREF(value);
-                break;
         case Global_kind:
                 result = PyType_GenericNew(Global_type, NULL, NULL);
                 if (!result) goto failed;
@@ -2451,6 +2401,15 @@
                         goto failed;
                 Py_DECREF(value);
                 break;
+        case Set_kind:
+                result = PyType_GenericNew(Set_type, NULL, NULL);
+                if (!result) goto failed;
+                value = ast2obj_list(o->v.Set.elts, ast2obj_expr);
+                if (!value) goto failed;
+                if (PyObject_SetAttrString(result, "elts", value) == -1)
+                        goto failed;
+                Py_DECREF(value);
+                break;
         case ListComp_kind:
                 result = PyType_GenericNew(ListComp_type, NULL, NULL);
                 if (!result) goto failed;
@@ -2544,15 +2503,6 @@
                         goto failed;
                 Py_DECREF(value);
                 break;
-        case Repr_kind:
-                result = PyType_GenericNew(Repr_type, NULL, NULL);
-                if (!result) goto failed;
-                value = ast2obj_expr(o->v.Repr.value);
-                if (!value) goto failed;
-                if (PyObject_SetAttrString(result, "value", value) == -1)
-                        goto failed;
-                Py_DECREF(value);
-                break;
         case Num_kind:
                 result = PyType_GenericNew(Num_type, NULL, NULL);
                 if (!result) goto failed;
@@ -2571,6 +2521,10 @@
                         goto failed;
                 Py_DECREF(value);
                 break;
+        case Ellipsis_kind:
+                result = PyType_GenericNew(Ellipsis_type, NULL, NULL);
+                if (!result) goto failed;
+                break;
         case Attribute_kind:
                 result = PyType_GenericNew(Attribute_type, NULL, NULL);
                 if (!result) goto failed;
@@ -2704,10 +2658,6 @@
         }
 
         switch (o->kind) {
-        case Ellipsis_kind:
-                result = PyType_GenericNew(Ellipsis_type, NULL, NULL);
-                if (!result) goto failed;
-                break;
         case Slice_kind:
                 result = PyType_GenericNew(Slice_type, NULL, NULL);
                 if (!result) goto failed;
@@ -2961,6 +2911,11 @@
         if (PyObject_SetAttrString(result, "vararg", value) == -1)
                 goto failed;
         Py_DECREF(value);
+        value = ast2obj_list(o->kwonlyargs, ast2obj_expr);
+        if (!value) goto failed;
+        if (PyObject_SetAttrString(result, "kwonlyargs", value) == -1)
+                goto failed;
+        Py_DECREF(value);
         value = ast2obj_identifier(o->kwarg);
         if (!value) goto failed;
         if (PyObject_SetAttrString(result, "kwarg", value) == -1)
@@ -2971,6 +2926,11 @@
         if (PyObject_SetAttrString(result, "defaults", value) == -1)
                 goto failed;
         Py_DECREF(value);
+        value = ast2obj_list(o->kw_defaults, ast2obj_expr);
+        if (!value) goto failed;
+        if (PyObject_SetAttrString(result, "kw_defaults", value) == -1)
+                goto failed;
+        Py_DECREF(value);
         return result;
 failed:
         Py_XDECREF(value);
@@ -3087,7 +3047,6 @@
             return;
         if (PyDict_SetItemString(d, "ImportFrom", (PyObject*)ImportFrom_type) <
             0) return;
-        if (PyDict_SetItemString(d, "Exec", (PyObject*)Exec_type) < 0) return;
         if (PyDict_SetItemString(d, "Global", (PyObject*)Global_type) < 0)
             return;
         if (PyDict_SetItemString(d, "Expr", (PyObject*)Expr_type) < 0) return;
@@ -3105,6 +3064,7 @@
             return;
         if (PyDict_SetItemString(d, "IfExp", (PyObject*)IfExp_type) < 0) return;
         if (PyDict_SetItemString(d, "Dict", (PyObject*)Dict_type) < 0) return;
+        if (PyDict_SetItemString(d, "Set", (PyObject*)Set_type) < 0) return;
         if (PyDict_SetItemString(d, "ListComp", (PyObject*)ListComp_type) < 0)
             return;
         if (PyDict_SetItemString(d, "GeneratorExp",
@@ -3113,9 +3073,10 @@
         if (PyDict_SetItemString(d, "Compare", (PyObject*)Compare_type) < 0)
             return;
         if (PyDict_SetItemString(d, "Call", (PyObject*)Call_type) < 0) return;
-        if (PyDict_SetItemString(d, "Repr", (PyObject*)Repr_type) < 0) return;
         if (PyDict_SetItemString(d, "Num", (PyObject*)Num_type) < 0) return;
         if (PyDict_SetItemString(d, "Str", (PyObject*)Str_type) < 0) return;
+        if (PyDict_SetItemString(d, "Ellipsis", (PyObject*)Ellipsis_type) < 0)
+            return;
         if (PyDict_SetItemString(d, "Attribute", (PyObject*)Attribute_type) <
             0) return;
         if (PyDict_SetItemString(d, "Subscript", (PyObject*)Subscript_type) <
@@ -3134,8 +3095,6 @@
             return;
         if (PyDict_SetItemString(d, "Param", (PyObject*)Param_type) < 0) return;
         if (PyDict_SetItemString(d, "slice", (PyObject*)slice_type) < 0) return;
-        if (PyDict_SetItemString(d, "Ellipsis", (PyObject*)Ellipsis_type) < 0)
-            return;
         if (PyDict_SetItemString(d, "Slice", (PyObject*)Slice_type) < 0) return;
         if (PyDict_SetItemString(d, "ExtSlice", (PyObject*)ExtSlice_type) < 0)
             return;

Modified: python/branches/p3yk-noslice/Python/ast.c
==============================================================================
--- python/branches/p3yk-noslice/Python/ast.c	(original)
+++ python/branches/p3yk-noslice/Python/ast.c	Fri Dec 15 05:21:50 2006
@@ -15,12 +15,6 @@
 
 #include <assert.h>
 
-/* XXX TO DO
-   - re-indent this file (should be done)
-   - internal error checking (freeing memory, etc.)
-   - syntax errors
-*/
-
 /* Data structure used internally */
 struct compiling {
     char *c_encoding; /* source encoding */
@@ -43,7 +37,7 @@
 static PyObject *parsestrplus(struct compiling *, const node *n);
 
 #ifndef LINENO
-#define LINENO(n)	((n)->n_lineno)
+#define LINENO(n)       ((n)->n_lineno)
 #endif
 
 static identifier
@@ -68,7 +62,7 @@
 {
     PyObject *u = Py_BuildValue("zi", errstr, LINENO(n));
     if (!u)
-	return 0;
+        return 0;
     PyErr_SetObject(PyExc_SyntaxError, u);
     Py_DECREF(u);
     return 0;
@@ -82,36 +76,36 @@
 
     assert(PyErr_Occurred());
     if (!PyErr_ExceptionMatches(PyExc_SyntaxError))
-	return;
+        return;
 
     PyErr_Fetch(&type, &value, &tback);
     errstr = PyTuple_GetItem(value, 0);
     if (!errstr)
-	return;
+        return;
     Py_INCREF(errstr);
     lineno = PyInt_AsLong(PyTuple_GetItem(value, 1));
     if (lineno == -1) {
-	Py_DECREF(errstr);
-	return;
+        Py_DECREF(errstr);
+        return;
     }
     Py_DECREF(value);
 
     loc = PyErr_ProgramText(filename, lineno);
     if (!loc) {
-	Py_INCREF(Py_None);
-	loc = Py_None;
+        Py_INCREF(Py_None);
+        loc = Py_None;
     }
     tmp = Py_BuildValue("(zlOO)", filename, lineno, Py_None, loc);
     Py_DECREF(loc);
     if (!tmp) {
-	Py_DECREF(errstr);
-	return;
+        Py_DECREF(errstr);
+        return;
     }
     value = PyTuple_Pack(2, errstr, tmp);
     Py_DECREF(errstr);
     Py_DECREF(tmp);
     if (!value)
-	return;
+        return;
     PyErr_Restore(type, value, tback);
 }
 
@@ -246,7 +240,7 @@
             if (TYPE(CHILD(n, 0)) == NEWLINE) {
                 stmts = asdl_seq_new(1, arena);
                 if (!stmts)
-		    goto error;
+                    goto error;
                 asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
                                             arena));
                 return Interactive(stmts, arena);
@@ -256,11 +250,11 @@
                 num = num_stmts(n);
                 stmts = asdl_seq_new(num, arena);
                 if (!stmts)
-		    goto error;
+                    goto error;
                 if (num == 1) {
-		    s = ast_for_stmt(&c, n);
-		    if (!s)
-			goto error;
+                    s = ast_for_stmt(&c, n);
+                    if (!s)
+                        goto error;
                     asdl_seq_SET(stmts, 0, s);
                 }
                 else {
@@ -347,38 +341,38 @@
 
     switch (e->kind) {
         case Attribute_kind:
-	    if (ctx == Store &&
-		    !strcmp(PyString_AS_STRING(e->v.Attribute.attr), "None")) {
-		    return ast_error(n, "assignment to None");
-	    }
-	    e->v.Attribute.ctx = ctx;
-	    break;
+            if (ctx == Store &&
+                    !strcmp(PyString_AS_STRING(e->v.Attribute.attr), "None")) {
+                    return ast_error(n, "assignment to None");
+            }
+            e->v.Attribute.ctx = ctx;
+            break;
         case Subscript_kind:
-	    e->v.Subscript.ctx = ctx;
-	    break;
+            e->v.Subscript.ctx = ctx;
+            break;
         case Name_kind:
-	    if (ctx == Store &&
-		!strcmp(PyString_AS_STRING(e->v.Name.id), "None")) {
-		    return ast_error(n, "assignment to None");
-	    }
-	    e->v.Name.ctx = ctx;
-	    break;
+            if (ctx == Store &&
+                !strcmp(PyString_AS_STRING(e->v.Name.id), "None")) {
+                    return ast_error(n, "assignment to None");
+            }
+            e->v.Name.ctx = ctx;
+            break;
         case List_kind:
-	    e->v.List.ctx = ctx;
-	    s = e->v.List.elts;
-	    break;
+            e->v.List.ctx = ctx;
+            s = e->v.List.elts;
+            break;
         case Tuple_kind:
             if (asdl_seq_LEN(e->v.Tuple.elts) == 0) 
                 return ast_error(n, "can't assign to ()");
-	    e->v.Tuple.ctx = ctx;
-	    s = e->v.Tuple.elts;
-	    break;
+            e->v.Tuple.ctx = ctx;
+            s = e->v.Tuple.elts;
+            break;
         case Lambda_kind:
             expr_name = "lambda";
             break;
         case Call_kind:
             expr_name = "function call";
-	    break;
+            break;
         case BoolOp_kind:
         case BinOp_kind:
         case UnaryOp_kind:
@@ -394,16 +388,17 @@
             expr_name = "list comprehension";
             break;
         case Dict_kind:
+	case Set_kind:
         case Num_kind:
         case Str_kind:
             expr_name = "literal";
             break;
+	case Ellipsis_kind:
+	    expr_name = "Ellipsis";
+	    break;
         case Compare_kind:
             expr_name = "comparison";
             break;
-        case Repr_kind:
-            expr_name = "repr";
-            break;
         case IfExp_kind:
             expr_name = "conditional expression";
             break;
@@ -427,12 +422,12 @@
        context for all the contained elements.  
     */
     if (s) {
-	int i;
+        int i;
 
-	for (i = 0; i < asdl_seq_LEN(s); i++) {
-	    if (!set_context((expr_ty)asdl_seq_GET(s, i), ctx, n))
-		return 0;
-	}
+        for (i = 0; i < asdl_seq_LEN(s); i++) {
+            if (!set_context((expr_ty)asdl_seq_GET(s, i), ctx, n))
+                return 0;
+        }
     }
     return 1;
 }
@@ -478,18 +473,18 @@
 static cmpop_ty
 ast_for_comp_op(const node *n)
 {
-    /* comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'
+    /* comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'
                |'is' 'not'
     */
     REQ(n, comp_op);
     if (NCH(n) == 1) {
-	n = CHILD(n, 0);
-	switch (TYPE(n)) {
+        n = CHILD(n, 0);
+        switch (TYPE(n)) {
             case LESS:
                 return Lt;
             case GREATER:
                 return Gt;
-            case EQEQUAL:			/* == */
+            case EQEQUAL:                       /* == */
                 return Eq;
             case LESSEQUAL:
                 return LtE;
@@ -506,11 +501,11 @@
                 PyErr_Format(PyExc_SystemError, "invalid comp_op: %s",
                              STR(n));
                 return (cmpop_ty)0;
-	}
+        }
     }
     else if (NCH(n) == 2) {
-	/* handle "not in" and "is not" */
-	switch (TYPE(CHILD(n, 0))) {
+        /* handle "not in" and "is not" */
+        switch (TYPE(CHILD(n, 0))) {
             case NAME:
                 if (strcmp(STR(CHILD(n, 1)), "in") == 0)
                     return NotIn;
@@ -520,7 +515,7 @@
                 PyErr_Format(PyExc_SystemError, "invalid comp_op: %s %s",
                              STR(CHILD(n, 0)), STR(CHILD(n, 1)));
                 return (cmpop_ty)0;
-	}
+        }
     }
     PyErr_Format(PyExc_SystemError, "invalid comp_op: has %d children",
                  NCH(n));
@@ -535,10 +530,11 @@
     expr_ty expression;
     int i;
     assert(TYPE(n) == testlist
-	   || TYPE(n) == listmaker
-	   || TYPE(n) == testlist_gexp
-	   || TYPE(n) == testlist_safe
-	   );
+           || TYPE(n) == listmaker
+           || TYPE(n) == testlist_gexp
+           || TYPE(n) == testlist_safe
+           || TYPE(n) == testlist1
+           );
 
     seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
     if (!seq)
@@ -566,20 +562,37 @@
     if (!args)
         return NULL;
 
+    /* fpdef: NAME | '(' fplist ')'
+       fplist: fpdef (',' fpdef)* [',']
+    */
     REQ(n, fplist);
     for (i = 0; i < len; i++) {
-        const node *child = CHILD(CHILD(n, 2*i), 0);
+        const node *fpdef_node = CHILD(n, 2*i);
+        const node *child;
         expr_ty arg;
+set_name:
+        /* fpdef_node is either a NAME or an fplist */
+        child = CHILD(fpdef_node, 0);
         if (TYPE(child) == NAME) {
-    		if (!strcmp(STR(child), "None")) {
-	    		ast_error(child, "assignment to None");
-		    	return NULL;
-		    }   
+                if (!strcmp(STR(child), "None")) {
+                        ast_error(child, "assignment to None");
+                        return NULL;
+                    }   
             arg = Name(NEW_IDENTIFIER(child), Store, LINENO(child),
                        child->n_col_offset, c->c_arena);
-	    }
+            }
         else {
-            arg = compiler_complex_args(c, CHILD(CHILD(n, 2*i), 1));
+            assert(TYPE(fpdef_node) == fpdef);
+            /* fpdef_node[0] is not a name, so it must be a '(', get CHILD[1] */
+            child = CHILD(fpdef_node, 1);
+            assert(TYPE(child) == fplist);
+            /* NCH == 1 means we have (x), we need to elide the extra parens */
+            if (NCH(child) == 1) {
+                fpdef_node = CHILD(child, 0);
+                assert(TYPE(fpdef_node) == fpdef);
+                goto set_name;
+            }
+            arg = compiler_complex_args(c, child);
         }
         asdl_seq_SET(args, i, arg);
     }
@@ -590,6 +603,63 @@
     return result;
 }
 
+/* returns -1 if failed to handle keyword only arguments
+   returns new position to keep processing if successful
+               (',' NAME ['=' test])* 
+                     ^^^
+   start pointing here
+ */
+static int
+handle_keywordonly_args(struct compiling *c, const node *n, int start,
+                        asdl_seq *kwonlyargs, asdl_seq *kwdefaults)
+{
+    node *ch;
+    expr_ty name;
+    int i = start;
+    int j = 0; /* index for kwdefaults and kwonlyargs */
+    assert(kwonlyargs != NULL);
+    assert(kwdefaults != NULL);
+    while (i < NCH(n)) {
+        ch = CHILD(n, i);
+        switch (TYPE(ch)) {
+            case NAME:
+                if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
+                    expr_ty expression = ast_for_expr(c, CHILD(n, i + 2));
+                    if (!expression) {
+                        ast_error(ch, "assignment to None");
+                        goto error;
+                    }
+                    asdl_seq_SET(kwdefaults, j, expression);
+                    i += 2; /* '=' and test */
+                }
+                else { /* setting NULL if no default value exists */
+                    asdl_seq_SET(kwdefaults, j, NULL);
+                }
+                if (!strcmp(STR(ch), "None")) {
+                    ast_error(ch, "assignment to None");
+                    goto error;
+                }
+                name = Name(NEW_IDENTIFIER(ch),
+                            Param, LINENO(ch), ch->n_col_offset,
+                            c->c_arena);
+                if (!name) {
+                    ast_error(ch, "expecting name");
+                    goto error;
+                }
+                asdl_seq_SET(kwonlyargs, j++, name);
+                i += 2; /* the name and the comma */
+                break;
+            case DOUBLESTAR:
+                return i;
+            default:
+                ast_error(ch, "unexpected node");
+                goto error;
+        }
+    }
+    return i;
+ error:
+    return -1;   
+}
 
 /* Create AST for argument list. */
 
@@ -597,35 +667,71 @@
 ast_for_arguments(struct compiling *c, const node *n)
 {
     /* parameters: '(' [varargslist] ')'
-       varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME]
-            | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+       varargslist: (fpdef ['=' test] ',')* 
+             ('*' [NAME] (',' fpdef ['=' test])* [',' '**' NAME] | '**' NAME)
+             | fpdef ['=' test] (',' fpdef ['=' test])* [',']
     */
-    int i, j, k, n_args = 0, n_defaults = 0, found_default = 0;
-    asdl_seq *args, *defaults;
+    int i, j, k, nposargs = 0, nkwonlyargs = 0;
+    int nposdefaults = 0, found_default = 0;
+    asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults;
     identifier vararg = NULL, kwarg = NULL;
     node *ch;
 
     if (TYPE(n) == parameters) {
-	if (NCH(n) == 2) /* () as argument list */
-	    return arguments(NULL, NULL, NULL, NULL, c->c_arena);
-	n = CHILD(n, 1);
+        if (NCH(n) == 2) /* () as argument list */
+            return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
+        n = CHILD(n, 1);
     }
     REQ(n, varargslist);
 
-    /* first count the number of normal args & defaults */
+    /* first count the number of positional args & defaults */
     for (i = 0; i < NCH(n); i++) {
-	ch = CHILD(n, i);
-	if (TYPE(ch) == fpdef)
-	    n_args++;
-	if (TYPE(ch) == EQUAL)
-	    n_defaults++;
-    }
-    args = (n_args ? asdl_seq_new(n_args, c->c_arena) : NULL);
-    if (!args && n_args)
-    	return NULL; /* Don't need to goto error; no objects allocated */
-    defaults = (n_defaults ? asdl_seq_new(n_defaults, c->c_arena) : NULL);
-    if (!defaults && n_defaults)
-    	return NULL; /* Don't need to goto error; no objects allocated */
+        ch = CHILD(n, i);
+        if (TYPE(ch) == STAR) {
+            if (TYPE(CHILD(n, i+1)) == NAME) {
+            /* skip NAME of vararg */
+            /* so that following can count only keyword only args */
+                i += 2;
+            }
+            else {
+                i++;
+            }
+            break; 
+        }
+        if (TYPE(ch) == fpdef) nposargs++;
+        if (TYPE(ch) == EQUAL) nposdefaults++;
+    }
+    /* count the number of keyword only args & 
+       defaults for keyword only args */
+    for ( ; i < NCH(n); ++i) {
+        ch = CHILD(n, i);
+        if (TYPE(ch) == DOUBLESTAR) break;
+        if (TYPE(ch) == NAME) nkwonlyargs++;
+    }
+
+    posargs = (nposargs ? asdl_seq_new(nposargs, c->c_arena) : NULL);
+    if (!posargs && nposargs)
+            return NULL; /* Don't need to goto error; no objects allocated */
+    kwonlyargs = (nkwonlyargs ?
+                   asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
+    if (!kwonlyargs && nkwonlyargs)
+            return NULL; /* Don't need to goto error; no objects allocated */
+    posdefaults = (nposdefaults ? 
+                    asdl_seq_new(nposdefaults, c->c_arena) : NULL);
+    if (!posdefaults && nposdefaults)
+            return NULL; /* Don't need to goto error; no objects allocated */
+    /* The length of kwonlyargs and kwdefaults are same 
+       since we set NULL as default for keyword only argument w/o default
+       - we have sequence data structure, but no dictionary */
+    kwdefaults = (nkwonlyargs ? 
+                   asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
+    if (!kwdefaults && nkwonlyargs)
+            return NULL; /* Don't need to goto error; no objects allocated */
+
+    if (nposargs + nkwonlyargs > 255) {
+		ast_error(n, "more than 255 arguments");
+		return NULL;
+    }
 
     /* fpdef: NAME | '(' fplist ')'
        fplist: fpdef (',' fpdef)* [',']
@@ -634,66 +740,94 @@
     j = 0;  /* index for defaults */
     k = 0;  /* index for args */
     while (i < NCH(n)) {
-	ch = CHILD(n, i);
-	switch (TYPE(ch)) {
+        ch = CHILD(n, i);
+        switch (TYPE(ch)) {
             case fpdef:
+            handle_fpdef:
                 /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is
                    anything other than EQUAL or a comma? */
                 /* XXX Should NCH(n) check be made a separate check? */
                 if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
                     expr_ty expression = ast_for_expr(c, CHILD(n, i + 2));
                     if (!expression)
-                            goto error;
-                    assert(defaults != NULL);
-                    asdl_seq_SET(defaults, j++, expression);
+                        goto error;
+                    assert(posdefaults != NULL);
+                    asdl_seq_SET(posdefaults, j++, expression);
+
                     i += 2;
-		    found_default = 1;
+                    found_default = 1;
+                }
+                else if (found_default) {
+                    ast_error(n, 
+                             "non-default argument follows default argument");
+                    goto error;
                 }
-		else if (found_default) {
-		    ast_error(n, 
-			     "non-default argument follows default argument");
-		    goto error;
-		}
                 if (NCH(ch) == 3) {
-		    ch = CHILD(ch, 1);
-		    /* def foo((x)): is not complex, special case. */
-		    if (NCH(ch) != 1) {
-			/* We have complex arguments, setup for unpacking. */
-			asdl_seq_SET(args, k++, compiler_complex_args(c, ch));
-		    } else {
-			/* def foo((x)): setup for checking NAME below. */
-			ch = CHILD(ch, 0);
-		    }
+                    ch = CHILD(ch, 1);
+                    /* def foo((x)): is not complex, special case. */
+                    if (NCH(ch) != 1) {
+                        /* We have complex arguments, setup for unpacking. */
+                        asdl_seq_SET(posargs, k++,
+                                     compiler_complex_args(c, ch));
+                    } else {
+                        /* def foo((x)): setup for checking NAME below. */
+                        /* Loop because there can be many parens and tuple
+                           unpacking mixed in. */
+                        ch = CHILD(ch, 0);
+                        assert(TYPE(ch) == fpdef);
+                        goto handle_fpdef;
+                    }
                 }
                 if (TYPE(CHILD(ch, 0)) == NAME) {
-		    expr_ty name;
-		    if (!strcmp(STR(CHILD(ch, 0)), "None")) {
-			    ast_error(CHILD(ch, 0), "assignment to None");
-			    goto error;
-		    }
+                    expr_ty name;
+                    if (!strcmp(STR(CHILD(ch, 0)), "None")) {
+                            ast_error(CHILD(ch, 0), "assignment to None");
+                            goto error;
+                    }
                     name = Name(NEW_IDENTIFIER(CHILD(ch, 0)),
                                 Param, LINENO(ch), ch->n_col_offset,
                                 c->c_arena);
                     if (!name)
                         goto error;
-                    asdl_seq_SET(args, k++, name);
-					 
-		}
+                    asdl_seq_SET(posargs, k++, name);
+
+                }
                 i += 2; /* the name and the comma */
                 break;
             case STAR:
-		if (!strcmp(STR(CHILD(n, i+1)), "None")) {
-			ast_error(CHILD(n, i+1), "assignment to None");
-			goto error;
-		}
-                vararg = NEW_IDENTIFIER(CHILD(n, i+1));
-                i += 3;
+                if (i+1 >= NCH(n)) {
+                    ast_error(CHILD(n, i), "no name for vararg");
+		    goto error;
+                }
+                if (!strcmp(STR(CHILD(n, i+1)), "None")) {
+                        ast_error(CHILD(n, i+1), "assignment to None");
+                        goto error;
+                }
+                if (TYPE(CHILD(n, i+1)) == COMMA) {
+                    int res = 0;    
+                    i += 2; /* now follows keyword only arguments */
+                    res = handle_keywordonly_args(c, n, i,
+                                                  kwonlyargs, kwdefaults);
+                    if (res == -1) goto error;
+                    i = res; /* res has new position to process */
+                }
+                else {
+                    vararg = NEW_IDENTIFIER(CHILD(n, i+1));
+                    i += 3;
+                    if (i < NCH(n) && TYPE(CHILD(n, i)) == NAME) {
+                        int res = 0;
+                        res = handle_keywordonly_args(c, n, i,
+                                                      kwonlyargs, kwdefaults);
+                        if (res == -1) goto error;
+                        i = res; /* res has new position to process */
+                    }
+                }
                 break;
             case DOUBLESTAR:
-		if (!strcmp(STR(CHILD(n, i+1)), "None")) {
-			ast_error(CHILD(n, i+1), "assignment to None");
-			goto error;
-		}
+                if (!strcmp(STR(CHILD(n, i+1)), "None")) {
+                        ast_error(CHILD(n, i+1), "assignment to None");
+                        goto error;
+                }
                 kwarg = NEW_IDENTIFIER(CHILD(n, i+1));
                 i += 3;
                 break;
@@ -702,11 +836,10 @@
                              "unexpected node in varargslist: %d @ %d",
                              TYPE(ch), i);
                 goto error;
-	}
+        }
     }
-
-    return arguments(args, vararg, kwarg, defaults, c->c_arena);
-
+    return arguments(posargs, vararg, kwonlyargs, kwarg, 
+                     posdefaults, kwdefaults, c->c_arena);
  error:
     Py_XDECREF(vararg);
     Py_XDECREF(kwarg);
@@ -731,15 +864,15 @@
         return NULL;
     e = Name(id, Load, lineno, col_offset, c->c_arena);
     if (!e)
-	return NULL;
+        return NULL;
 
     for (i = 2; i < NCH(n); i+=2) {
         id = NEW_IDENTIFIER(CHILD(n, i));
-	if (!id)
-	    return NULL;
-	e = Attribute(e, id, Load, lineno, col_offset, c->c_arena);
-	if (!e)
-	    return NULL;
+        if (!id)
+            return NULL;
+        e = Attribute(e, id, Load, lineno, col_offset, c->c_arena);
+        if (!e)
+            return NULL;
     }
 
     return e;
@@ -758,24 +891,24 @@
     
     name_expr = ast_for_dotted_name(c, CHILD(n, 1));
     if (!name_expr)
-	return NULL;
-	
+        return NULL;
+        
     if (NCH(n) == 3) { /* No arguments */
-	d = name_expr;
-	name_expr = NULL;
+        d = name_expr;
+        name_expr = NULL;
     }
     else if (NCH(n) == 5) { /* Call with no arguments */
-	d = Call(name_expr, NULL, NULL, NULL, NULL, LINENO(n),
+        d = Call(name_expr, NULL, NULL, NULL, NULL, LINENO(n),
                  n->n_col_offset, c->c_arena);
-	if (!d)
-	    return NULL;
-	name_expr = NULL;
+        if (!d)
+            return NULL;
+        name_expr = NULL;
     }
     else {
-	d = ast_for_call(c, CHILD(n, 3), name_expr);
-	if (!d)
-	    return NULL;
-	name_expr = NULL;
+        d = ast_for_call(c, CHILD(n, 3), name_expr);
+        if (!d)
+            return NULL;
+        name_expr = NULL;
     }
 
     return d;
@@ -792,12 +925,12 @@
     decorator_seq = asdl_seq_new(NCH(n), c->c_arena);
     if (!decorator_seq)
         return NULL;
-	
+        
     for (i = 0; i < NCH(n); i++) {
         d = ast_for_decorator(c, CHILD(n, i));
-	    if (!d)
-	        return NULL;
-	    asdl_seq_SET(decorator_seq, i, d);
+            if (!d)
+                return NULL;
+            asdl_seq_SET(decorator_seq, i, d);
     }
     return decorator_seq;
 }
@@ -815,28 +948,28 @@
     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;
+        decorator_seq = ast_for_decorators(c, CHILD(n, 0));
+        if (!decorator_seq)
+            return NULL;
+        name_i = 2;
     }
     else {
-	name_i = 1;
+        name_i = 1;
     }
 
     name = NEW_IDENTIFIER(CHILD(n, name_i));
     if (!name)
-	return NULL;
+        return NULL;
     else if (!strcmp(STR(CHILD(n, name_i)), "None")) {
-	ast_error(CHILD(n, name_i), "assignment to None");
-	return NULL;
+        ast_error(CHILD(n, name_i), "assignment to None");
+        return NULL;
     }
     args = ast_for_arguments(c, CHILD(n, name_i + 1));
     if (!args)
-	return NULL;
+        return NULL;
     body = ast_for_suite(c, CHILD(n, name_i + 3));
     if (!body)
-	return NULL;
+        return NULL;
 
     return FunctionDef(name, args, body, decorator_seq, LINENO(n),
                        n->n_col_offset, c->c_arena);
@@ -850,7 +983,7 @@
     expr_ty expression;
 
     if (NCH(n) == 3) {
-        args = arguments(NULL, NULL, NULL, NULL, c->c_arena);
+        args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
         if (!args)
             return NULL;
         expression = ast_for_expr(c, CHILD(n, 2));
@@ -878,17 +1011,22 @@
     assert(NCH(n) == 5);
     body = ast_for_expr(c, CHILD(n, 0));
     if (!body)
-    	return NULL;
+        return NULL;
     expression = ast_for_expr(c, CHILD(n, 2));
     if (!expression)
-    	return NULL;
+        return NULL;
     orelse = ast_for_expr(c, CHILD(n, 4));
     if (!orelse)
-	return NULL;
+        return NULL;
     return IfExp(expression, body, orelse, LINENO(n), n->n_col_offset,
                  c->c_arena);
 }
 
+/* XXX(nnorwitz): the listcomp and genexpr code should be refactored
+   so there is only a single version.  Possibly for loops can also re-use
+   the code.
+*/
+
 /* Count the number of 'for' loop in a list comprehension.
 
    Helper for ast_for_listcomp().
@@ -904,14 +1042,14 @@
     n_fors++;
     REQ(ch, list_for);
     if (NCH(ch) == 5)
-	ch = CHILD(ch, 4);
+        ch = CHILD(ch, 4);
     else
-	return n_fors;
+        return n_fors;
  count_list_iter:
     REQ(ch, list_iter);
     ch = CHILD(ch, 0);
     if (TYPE(ch) == list_for)
-	goto count_list_for;
+        goto count_list_for;
     else if (TYPE(ch) == list_if) {
         if (NCH(ch) == 3) {
             ch = CHILD(ch, 2);
@@ -939,12 +1077,12 @@
  count_list_iter:
     REQ(n, list_iter);
     if (TYPE(CHILD(n, 0)) == list_for)
-	return n_ifs;
+        return n_ifs;
     n = CHILD(n, 0);
     REQ(n, list_if);
     n_ifs++;
     if (NCH(n) == 2)
-	return n_ifs;
+        return n_ifs;
     n = CHILD(n, 2);
     goto count_list_iter;
 }
@@ -976,61 +1114,65 @@
 
     listcomps = asdl_seq_new(n_fors, c->c_arena);
     if (!listcomps)
-    	return NULL;
+        return NULL;
 
     ch = CHILD(n, 1);
     for (i = 0; i < n_fors; i++) {
-	comprehension_ty lc;
-	asdl_seq *t;
+        comprehension_ty lc;
+        asdl_seq *t;
         expr_ty expression;
+        node *for_ch;
 
-	REQ(ch, list_for);
+        REQ(ch, list_for);
 
-	t = ast_for_exprlist(c, CHILD(ch, 1), Store);
+        for_ch = CHILD(ch, 1);
+        t = ast_for_exprlist(c, for_ch, Store);
         if (!t)
             return NULL;
         expression = ast_for_testlist(c, CHILD(ch, 3));
         if (!expression)
             return NULL;
 
-	if (asdl_seq_LEN(t) == 1)
-	    lc = comprehension((expr_ty)asdl_seq_GET(t, 0), expression, NULL,
+        /* Check the # of children rather than the length of t, since
+           [x for x, in ... ] has 1 element in t, but still requires a Tuple. */
+        if (NCH(for_ch) == 1)
+            lc = comprehension((expr_ty)asdl_seq_GET(t, 0), expression, NULL,
                                c->c_arena);
-	else
-	    lc = comprehension(Tuple(t, Store, LINENO(ch), ch->n_col_offset,
+        else
+            lc = comprehension(Tuple(t, Store, LINENO(ch), ch->n_col_offset,
                                      c->c_arena),
                                expression, NULL, c->c_arena);
         if (!lc)
             return NULL;
 
-	if (NCH(ch) == 5) {
-	    int j, n_ifs;
-	    asdl_seq *ifs;
+        if (NCH(ch) == 5) {
+            int j, n_ifs;
+            asdl_seq *ifs;
 
-	    ch = CHILD(ch, 4);
-	    n_ifs = count_list_ifs(ch);
+            ch = CHILD(ch, 4);
+            n_ifs = count_list_ifs(ch);
             if (n_ifs == -1)
                 return NULL;
 
-	    ifs = asdl_seq_new(n_ifs, c->c_arena);
-	    if (!ifs)
-		return NULL;
+            ifs = asdl_seq_new(n_ifs, c->c_arena);
+            if (!ifs)
+                return NULL;
 
-	    for (j = 0; j < n_ifs; j++) {
+            for (j = 0; j < n_ifs; j++) {
             REQ(ch, list_iter);
-		    ch = CHILD(ch, 0);
-		    REQ(ch, list_if);
+                    ch = CHILD(ch, 0);
+                    REQ(ch, list_if);
 
-    		asdl_seq_SET(ifs, j, ast_for_expr(c, CHILD(ch, 1)));
-    		if (NCH(ch) == 3)
-	    	    ch = CHILD(ch, 2);
-	        }
-	        /* on exit, must guarantee that ch is a list_for */
-	        if (TYPE(ch) == list_iter)
-		        ch = CHILD(ch, 0);
+                asdl_seq_SET(ifs, j, ast_for_expr(c, CHILD(ch, 1)));
+                if (NCH(ch) == 3)
+                    ch = CHILD(ch, 2);
+                }
+                /* on exit, must guarantee that ch is a list_for */
+                if (TYPE(ch) == list_iter)
+                        ch = CHILD(ch, 0);
             lc->ifs = ifs;
-	    }
-	    asdl_seq_SET(listcomps, i, lc);
+            }
+            asdl_seq_SET(listcomps, i, lc);
     }
 
     return ListComp(elt, listcomps, LINENO(n), n->n_col_offset, c->c_arena);
@@ -1045,34 +1187,34 @@
 static int
 count_gen_fors(const node *n)
 {
-	int n_fors = 0;
-	node *ch = CHILD(n, 1);
+        int n_fors = 0;
+        node *ch = CHILD(n, 1);
 
  count_gen_for:
-	n_fors++;
-	REQ(ch, gen_for);
-	if (NCH(ch) == 5)
-		ch = CHILD(ch, 4);
-	else
-		return n_fors;
+        n_fors++;
+        REQ(ch, gen_for);
+        if (NCH(ch) == 5)
+                ch = CHILD(ch, 4);
+        else
+                return n_fors;
  count_gen_iter:
-	REQ(ch, gen_iter);
-	ch = CHILD(ch, 0);
-	if (TYPE(ch) == gen_for)
-		goto count_gen_for;
-	else if (TYPE(ch) == gen_if) {
-		if (NCH(ch) == 3) {
-			ch = CHILD(ch, 2);
-			goto count_gen_iter;
-		}
-		else
-		    return n_fors;
-	}
-
-	/* Should never be reached */
-	PyErr_SetString(PyExc_SystemError,
-			"logic error in count_gen_fors");
-	return -1;
+        REQ(ch, gen_iter);
+        ch = CHILD(ch, 0);
+        if (TYPE(ch) == gen_for)
+                goto count_gen_for;
+        else if (TYPE(ch) == gen_if) {
+                if (NCH(ch) == 3) {
+                        ch = CHILD(ch, 2);
+                        goto count_gen_iter;
+                }
+                else
+                    return n_fors;
+        }
+
+        /* Should never be reached */
+        PyErr_SetString(PyExc_SystemError,
+                        "logic error in count_gen_fors");
+        return -1;
 }
 
 /* Count the number of 'if' statements in a generator expression.
@@ -1083,19 +1225,19 @@
 static int
 count_gen_ifs(const node *n)
 {
-	int n_ifs = 0;
+        int n_ifs = 0;
 
-	while (1) {
-		REQ(n, gen_iter);
-		if (TYPE(CHILD(n, 0)) == gen_for)
-			return n_ifs;
-		n = CHILD(n, 0);
-		REQ(n, gen_if);
-		n_ifs++;
-		if (NCH(n) == 2)
-			return n_ifs;
-		n = CHILD(n, 2);
-	}
+        while (1) {
+                REQ(n, gen_iter);
+                if (TYPE(CHILD(n, 0)) == gen_for)
+                        return n_ifs;
+                n = CHILD(n, 0);
+                REQ(n, gen_if);
+                n_ifs++;
+                if (NCH(n) == 2)
+                        return n_ifs;
+                n = CHILD(n, 2);
+        }
 }
 
 /* TODO(jhylton): Combine with list comprehension code? */
@@ -1103,7 +1245,7 @@
 ast_for_genexp(struct compiling *c, const node *n)
 {
     /* testlist_gexp: test ( gen_for | (',' test)* [','] )
-       argument: [test '='] test [gen_for]	 # Really [keyword '='] test */
+       argument: [test '='] test [gen_for]       # Really [keyword '='] test */
     expr_ty elt;
     asdl_seq *genexps;
     int i, n_fors;
@@ -1129,17 +1271,21 @@
         comprehension_ty ge;
         asdl_seq *t;
         expr_ty expression;
+        node *for_ch;
         
         REQ(ch, gen_for);
         
-        t = ast_for_exprlist(c, CHILD(ch, 1), Store);
+        for_ch = CHILD(ch, 1);
+        t = ast_for_exprlist(c, for_ch, Store);
         if (!t)
             return NULL;
         expression = ast_for_expr(c, CHILD(ch, 3));
         if (!expression)
             return NULL;
 
-        if (asdl_seq_LEN(t) == 1)
+        /* Check the # of children rather than the length of t, since
+           (x for x, in ...) has 1 element in t, but still requires a Tuple. */
+        if (NCH(for_ch) == 1)
             ge = comprehension((expr_ty)asdl_seq_GET(t, 0), expression,
                                NULL, c->c_arena);
         else
@@ -1190,102 +1336,117 @@
 ast_for_atom(struct compiling *c, const node *n)
 {
     /* atom: '(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']'
-       | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
+       | '{' [dictsetmaker] '}' | NAME | NUMBER | STRING+
     */
     node *ch = CHILD(n, 0);
     
     switch (TYPE(ch)) {
     case NAME:
-	/* All names start in Load context, but may later be
-	   changed. */
-	return Name(NEW_IDENTIFIER(ch), Load, LINENO(n), n->n_col_offset, c->c_arena);
+        /* All names start in Load context, but may later be
+           changed. */
+        return Name(NEW_IDENTIFIER(ch), Load, LINENO(n), n->n_col_offset, c->c_arena);
     case STRING: {
-	PyObject *str = parsestrplus(c, n);
-	if (!str)
-	    return NULL;
+        PyObject *str = parsestrplus(c, n);
+        if (!str)
+            return NULL;
 
-	PyArena_AddPyObject(c->c_arena, str);
-	return Str(str, LINENO(n), n->n_col_offset, c->c_arena);
+        PyArena_AddPyObject(c->c_arena, str);
+        return Str(str, LINENO(n), n->n_col_offset, c->c_arena);
     }
     case NUMBER: {
-	PyObject *pynum = parsenumber(STR(ch));
-	if (!pynum)
-	    return NULL;
+        PyObject *pynum = parsenumber(STR(ch));
+        if (!pynum)
+            return NULL;
 
-	PyArena_AddPyObject(c->c_arena, pynum);
-	return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena);
+        PyArena_AddPyObject(c->c_arena, pynum);
+        return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena);
     }
+    case DOT:
+    	/* Ellipsis */
+	return Ellipsis(LINENO(n), n->n_col_offset, c->c_arena);
     case LPAR: /* some parenthesized expressions */
-	ch = CHILD(n, 1);
-	
-	if (TYPE(ch) == RPAR)
-	    return Tuple(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
-	
-	if (TYPE(ch) == yield_expr)
-	    return ast_for_expr(c, ch);
-	
-	if ((NCH(ch) > 1) && (TYPE(CHILD(ch, 1)) == gen_for))
-	    return ast_for_genexp(c, ch);
-	
-	return ast_for_testlist_gexp(c, ch);
+        ch = CHILD(n, 1);
+        
+        if (TYPE(ch) == RPAR)
+            return Tuple(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
+        
+        if (TYPE(ch) == yield_expr)
+            return ast_for_expr(c, ch);
+        
+        if ((NCH(ch) > 1) && (TYPE(CHILD(ch, 1)) == gen_for))
+            return ast_for_genexp(c, ch);
+        
+        return ast_for_testlist_gexp(c, ch);
     case LSQB: /* list (or list comprehension) */
-	ch = CHILD(n, 1);
-	
-	if (TYPE(ch) == RSQB)
-	    return List(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
-	
-	REQ(ch, listmaker);
-	if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) {
-	    asdl_seq *elts = seq_for_testlist(c, ch);
-	    if (!elts)
-		return NULL;
+        ch = CHILD(n, 1);
+        
+        if (TYPE(ch) == RSQB)
+            return List(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
+        
+        REQ(ch, listmaker);
+        if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) {
+            asdl_seq *elts = seq_for_testlist(c, ch);
+            if (!elts)
+                return NULL;
 
-	    return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena);
-	}
-	else
-	    return ast_for_listcomp(c, ch);
+            return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena);
+        }
+        else
+            return ast_for_listcomp(c, ch);
     case LBRACE: {
-	/* dictmaker: test ':' test (',' test ':' test)* [','] */
+	/* dictsetmaker: test ':' test (',' test ':' test)* [','] |
+	 *               test (',' test)* [',']  */
 	int i, size;
 	asdl_seq *keys, *values;
 	
 	ch = CHILD(n, 1);
-	size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
-	keys = asdl_seq_new(size, c->c_arena);
-	if (!keys)
-	    return NULL;
-	
-	values = asdl_seq_new(size, c->c_arena);
-	if (!values)
-	    return NULL;
-	
-	for (i = 0; i < NCH(ch); i += 4) {
-	    expr_ty expression;
-	    
-	    expression = ast_for_expr(c, CHILD(ch, i));
-	    if (!expression)
-		return NULL;
+	if (NCH(ch) == 1 || (NCH(ch) > 0 && STR(CHILD(ch, 1))[0] == ',')) {
+            /* it's a set */
+            size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
+            keys = asdl_seq_new(size, c->c_arena);
+            if (!keys)
+                return NULL;
 
-	    asdl_seq_SET(keys, i / 4, expression);
+            for (i = 0; i < NCH(ch); i += 2) {
+                expr_ty expression;
+                expression = ast_for_expr(c, CHILD(ch, i));
+                if (!expression)
+                    return NULL;
+                asdl_seq_SET(keys, i / 2, expression);
+            }
+            return Set(keys, LINENO(n), n->n_col_offset, c->c_arena);
+        } else {
+            /* it's a dict */
+            size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
+            keys = asdl_seq_new(size, c->c_arena);
+            if (!keys)
+                return NULL;
+            
+            values = asdl_seq_new(size, c->c_arena);
+            if (!values)
+                return NULL;
+            
+            for (i = 0; i < NCH(ch); i += 4) {
+                expr_ty expression;
+                
+                expression = ast_for_expr(c, CHILD(ch, i));
+                if (!expression)
+                    return NULL;
 
-	    expression = ast_for_expr(c, CHILD(ch, i + 2));
-	    if (!expression)
-		return NULL;
+                asdl_seq_SET(keys, i / 4, expression);
 
-	    asdl_seq_SET(values, i / 4, expression);
-	}
-	return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena);
-    }
-    case BACKQUOTE: { /* repr */
-	expr_ty expression = ast_for_testlist(c, CHILD(n, 1));
-	if (!expression)
-	    return NULL;
+                expression = ast_for_expr(c, CHILD(ch, i + 2));
+                if (!expression)
+                    return NULL;
 
-	return Repr(expression, LINENO(n), n->n_col_offset, c->c_arena);
+                asdl_seq_SET(values, i / 4, expression);
+            }
+            return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena);
+        }
     }
     default:
-	PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch));
-	return NULL;
+        PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch));
+        return NULL;
     }
 }
 
@@ -1298,13 +1459,10 @@
     REQ(n, subscript);
 
     /*
-       subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop]
+       subscript: test | [test] ':' [test] [sliceop]
        sliceop: ':' [test]
     */
     ch = CHILD(n, 0);
-    if (TYPE(ch) == DOT)
-	return Ellipsis(c->c_arena);
-
     if (NCH(n) == 1 && TYPE(ch) == test) {
         /* 'step' variable hold no significance in terms of being used over
            other vars */
@@ -1312,31 +1470,31 @@
         if (!step)
             return NULL;
             
-	return Index(step, c->c_arena);
+        return Index(step, c->c_arena);
     }
 
     if (TYPE(ch) == test) {
-	lower = ast_for_expr(c, ch);
+        lower = ast_for_expr(c, ch);
         if (!lower)
             return NULL;
     }
 
     /* If there's an upper bound it's in the second or third position. */
     if (TYPE(ch) == COLON) {
-	if (NCH(n) > 1) {
-	    node *n2 = CHILD(n, 1);
+        if (NCH(n) > 1) {
+            node *n2 = CHILD(n, 1);
 
-	    if (TYPE(n2) == test) {
-		upper = ast_for_expr(c, n2);
+            if (TYPE(n2) == test) {
+                upper = ast_for_expr(c, n2);
                 if (!upper)
                     return NULL;
             }
-	}
+        }
     } else if (NCH(n) > 2) {
-	node *n2 = CHILD(n, 2);
+        node *n2 = CHILD(n, 2);
 
-	if (TYPE(n2) == test) {
-	    upper = ast_for_expr(c, n2);
+        if (TYPE(n2) == test) {
+            upper = ast_for_expr(c, n2);
             if (!upper)
                 return NULL;
         }
@@ -1367,13 +1525,13 @@
 static expr_ty
 ast_for_binop(struct compiling *c, const node *n)
 {
-	/* Must account for a sequence of expressions.
-	   How should A op B op C by represented?  
-	   BinOp(BinOp(A, op, B), op, C).
-	*/
+        /* Must account for a sequence of expressions.
+           How should A op B op C by represented?  
+           BinOp(BinOp(A, op, B), op, C).
+        */
 
-	int i, nops;
-	expr_ty expr1, expr2, result;
+        int i, nops;
+        expr_ty expr1, expr2, result;
         operator_ty newoperator;
 
         expr1 = ast_for_expr(c, CHILD(n, 0));
@@ -1388,17 +1546,17 @@
         if (!newoperator)
             return NULL;
 
-	result = BinOp(expr1, newoperator, expr2, LINENO(n), n->n_col_offset,
+        result = BinOp(expr1, newoperator, expr2, LINENO(n), n->n_col_offset,
                        c->c_arena);
-	if (!result)
+        if (!result)
             return NULL;
 
-	nops = (NCH(n) - 1) / 2;
-	for (i = 1; i < nops; i++) {
-		expr_ty tmp_result, tmp;
-		const node* next_oper = CHILD(n, i * 2 + 1);
+        nops = (NCH(n) - 1) / 2;
+        for (i = 1; i < nops; i++) {
+                expr_ty tmp_result, tmp;
+                const node* next_oper = CHILD(n, i * 2 + 1);
 
-		newoperator = get_operator(next_oper);
+                newoperator = get_operator(next_oper);
                 if (!newoperator)
                     return NULL;
 
@@ -1407,13 +1565,13 @@
                     return NULL;
 
                 tmp_result = BinOp(result, newoperator, tmp, 
-				   LINENO(next_oper), next_oper->n_col_offset,
+                                   LINENO(next_oper), next_oper->n_col_offset,
                                    c->c_arena);
-		if (!tmp) 
-			return NULL;
-		result = tmp_result;
-	}
-	return result;
+                if (!tmp) 
+                        return NULL;
+                result = tmp_result;
+        }
+        return result;
 }
 
 static expr_ty
@@ -1560,8 +1718,8 @@
         tmp = ast_for_trailer(c, ch, e);
         if (!tmp)
             return NULL;
-	tmp->lineno = e->lineno;
-	tmp->col_offset = e->col_offset;
+        tmp->lineno = e->lineno;
+        tmp->col_offset = e->col_offset;
         e = tmp;
     }
     if (TYPE(CHILD(n, NCH(n) - 1)) == factor) {
@@ -1619,8 +1777,8 @@
                 return ast_for_lambdef(c, CHILD(n, 0));
             else if (NCH(n) > 1)
                 return ast_for_ifexpr(c, n);
-	    /* Fallthrough */
-	case or_test:
+            /* Fallthrough */
+        case or_test:
         case and_test:
             if (NCH(n) == 1) {
                 n = CHILD(n, 0);
@@ -1661,7 +1819,7 @@
             else {
                 expr_ty expression;
                 asdl_int_seq *ops;
-		asdl_seq *cmps;
+                asdl_seq *cmps;
                 ops = asdl_int_seq_new(NCH(n) / 2, c->c_arena);
                 if (!ops)
                     return NULL;
@@ -1675,12 +1833,12 @@
                     newoperator = ast_for_comp_op(CHILD(n, i));
                     if (!newoperator) {
                         return NULL;
-		    }
+                    }
 
                     expression = ast_for_expr(c, CHILD(n, i + 1));
                     if (!expression) {
                         return NULL;
-		    }
+                    }
                         
                     asdl_seq_SET(ops, i / 2, newoperator);
                     asdl_seq_SET(cmps, i / 2, expression);
@@ -1688,7 +1846,7 @@
                 expression = ast_for_expr(c, CHILD(n, 0));
                 if (!expression) {
                     return NULL;
-		}
+                }
                     
                 return Compare(expression, ops, cmps, LINENO(n),
                                n->n_col_offset, c->c_arena);
@@ -1711,20 +1869,20 @@
             }
             return ast_for_binop(c, n);
         case yield_expr: {
-	    expr_ty exp = NULL;
-	    if (NCH(n) == 2) {
-		exp = ast_for_testlist(c, CHILD(n, 1));
-		if (!exp)
-		    return NULL;
-	    }
-	    return Yield(exp, LINENO(n), n->n_col_offset, c->c_arena);
-	}
+            expr_ty exp = NULL;
+            if (NCH(n) == 2) {
+                exp = ast_for_testlist(c, CHILD(n, 1));
+                if (!exp)
+                    return NULL;
+            }
+            return Yield(exp, LINENO(n), n->n_col_offset, c->c_arena);
+        }
         case factor:
             if (NCH(n) == 1) {
                 n = CHILD(n, 0);
                 goto loop;
             }
-	    return ast_for_factor(c, n);
+            return ast_for_factor(c, n);
         case power:
             return ast_for_power(c, n);
         default:
@@ -1741,7 +1899,7 @@
     /*
       arglist: (argument ',')* (argument [',']| '*' test [',' '**' test]
                | '**' test)
-      argument: [test '='] test [gen_for]	 # Really [keyword '='] test
+      argument: [test '='] test [gen_for]        # Really [keyword '='] test
     */
 
     int i, nargs, nkeywords, ngens;
@@ -1755,20 +1913,20 @@
     nkeywords = 0;
     ngens = 0;
     for (i = 0; i < NCH(n); i++) {
-	node *ch = CHILD(n, i);
-	if (TYPE(ch) == argument) {
-	    if (NCH(ch) == 1)
-		nargs++;
-	    else if (TYPE(CHILD(ch, 1)) == gen_for)
-		ngens++;
+        node *ch = CHILD(n, i);
+        if (TYPE(ch) == argument) {
+            if (NCH(ch) == 1)
+                nargs++;
+            else if (TYPE(CHILD(ch, 1)) == gen_for)
+                ngens++;
             else
-		nkeywords++;
-	}
+                nkeywords++;
+        }
     }
     if (ngens > 1 || (ngens && (nargs || nkeywords))) {
         ast_error(n, "Generator expression must be parenthesized "
-		  "if not sole argument");
-	return NULL;
+                  "if not sole argument");
+        return NULL;
     }
 
     if (nargs + nkeywords + ngens > 255) {
@@ -1785,32 +1943,32 @@
     nargs = 0;
     nkeywords = 0;
     for (i = 0; i < NCH(n); i++) {
-	node *ch = CHILD(n, i);
-	if (TYPE(ch) == argument) {
-	    expr_ty e;
-	    if (NCH(ch) == 1) {
-		if (nkeywords) {
-		    ast_error(CHILD(ch, 0),
-			      "non-keyword arg after keyword arg");
-		    return NULL;
-		}
-		e = ast_for_expr(c, CHILD(ch, 0));
+        node *ch = CHILD(n, i);
+        if (TYPE(ch) == argument) {
+            expr_ty e;
+            if (NCH(ch) == 1) {
+                if (nkeywords) {
+                    ast_error(CHILD(ch, 0),
+                              "non-keyword arg after keyword arg");
+                    return NULL;
+                }
+                e = ast_for_expr(c, CHILD(ch, 0));
                 if (!e)
                     return NULL;
-		asdl_seq_SET(args, nargs++, e);
-	    }  
-	    else if (TYPE(CHILD(ch, 1)) == gen_for) {
-        	e = ast_for_genexp(c, ch);
+                asdl_seq_SET(args, nargs++, e);
+            }  
+            else if (TYPE(CHILD(ch, 1)) == gen_for) {
+                e = ast_for_genexp(c, ch);
                 if (!e)
                     return NULL;
-		asdl_seq_SET(args, nargs++, e);
+                asdl_seq_SET(args, nargs++, e);
             }
-	    else {
-		keyword_ty kw;
-		identifier key;
+            else {
+                keyword_ty kw;
+                identifier key;
 
-		/* CHILD(ch, 0) is test, but must be an identifier? */ 
-		e = ast_for_expr(c, CHILD(ch, 0));
+                /* CHILD(ch, 0) is test, but must be an identifier? */ 
+                e = ast_for_expr(c, CHILD(ch, 0));
                 if (!e)
                     return NULL;
                 /* f(lambda x: x[0] = 3) ends up getting parsed with
@@ -1825,24 +1983,24 @@
                   ast_error(CHILD(ch, 0), "keyword can't be an expression");
                   return NULL;
                 }
-		key = e->v.Name.id;
-		e = ast_for_expr(c, CHILD(ch, 2));
+                key = e->v.Name.id;
+                e = ast_for_expr(c, CHILD(ch, 2));
                 if (!e)
                     return NULL;
-		kw = keyword(key, e, c->c_arena);
+                kw = keyword(key, e, c->c_arena);
                 if (!kw)
                     return NULL;
-		asdl_seq_SET(keywords, nkeywords++, kw);
-	    }
-	}
-	else if (TYPE(ch) == STAR) {
-	    vararg = ast_for_expr(c, CHILD(n, i+1));
-	    i++;
-	}
-	else if (TYPE(ch) == DOUBLESTAR) {
-	    kwarg = ast_for_expr(c, CHILD(n, i+1));
-	    i++;
-	}
+                asdl_seq_SET(keywords, nkeywords++, kw);
+            }
+        }
+        else if (TYPE(ch) == STAR) {
+            vararg = ast_for_expr(c, CHILD(n, i+1));
+            i++;
+        }
+        else if (TYPE(ch) == DOUBLESTAR) {
+            kwarg = ast_for_expr(c, CHILD(n, i+1));
+            i++;
+        }
     }
 
     return Call(func, args, keywords, vararg, kwarg, func->lineno, func->col_offset, c->c_arena);
@@ -1866,12 +2024,12 @@
                TYPE(n) == testlist1);
     }
     if (NCH(n) == 1)
-	return ast_for_expr(c, CHILD(n, 0));
+        return ast_for_expr(c, CHILD(n, 0));
     else {
         asdl_seq *tmp = seq_for_testlist(c, n);
         if (!tmp)
             return NULL;
-	return Tuple(tmp, Load, LINENO(n), n->n_col_offset, c->c_arena);
+        return Tuple(tmp, Load, LINENO(n), n->n_col_offset, c->c_arena);
     }
 }
 
@@ -1882,7 +2040,7 @@
     /* argument: test [ gen_for ] */
     assert(TYPE(n) == testlist_gexp || TYPE(n) == argument);
     if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == gen_for)
-	return ast_for_genexp(c, n);
+        return ast_for_genexp(c, n);
     return ast_for_testlist(c, n);
 }
 
@@ -1916,23 +2074,23 @@
                 | ('=' (yield_expr|testlist))*)
        testlist: test (',' test)* [',']
        augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^='
-	        | '<<=' | '>>=' | '**=' | '//='
+                | '<<=' | '>>=' | '**=' | '//='
        test: ... here starts the operator precendence dance
      */
 
     if (NCH(n) == 1) {
-	expr_ty e = ast_for_testlist(c, CHILD(n, 0));
+        expr_ty e = ast_for_testlist(c, CHILD(n, 0));
         if (!e)
             return NULL;
 
-	return Expr(e, LINENO(n), n->n_col_offset, c->c_arena);
+        return Expr(e, LINENO(n), n->n_col_offset, c->c_arena);
     }
     else if (TYPE(CHILD(n, 1)) == augassign) {
         expr_ty expr1, expr2;
         operator_ty newoperator;
-	node *ch = CHILD(n, 0);
+        node *ch = CHILD(n, 0);
 
-	expr1 = ast_for_testlist(c, ch);
+        expr1 = ast_for_testlist(c, ch);
         if (!expr1)
             return NULL;
         /* TODO(nas): Remove duplicated error checks (set_context does it) */
@@ -1961,13 +2119,13 @@
                           "assignment");
                 return NULL;
         }
-	set_context(expr1, Store, ch);
+        set_context(expr1, Store, ch);
 
-	ch = CHILD(n, 2);
-	if (TYPE(ch) == testlist)
-	    expr2 = ast_for_testlist(c, ch);
-	else
-	    expr2 = ast_for_expr(c, ch);
+        ch = CHILD(n, 2);
+        if (TYPE(ch) == testlist)
+            expr2 = ast_for_testlist(c, ch);
+        else
+            expr2 = ast_for_expr(c, ch);
         if (!expr2)
             return NULL;
 
@@ -1975,45 +2133,45 @@
         if (!newoperator)
             return NULL;
 
-	return AugAssign(expr1, newoperator, expr2, LINENO(n), n->n_col_offset, c->c_arena);
+        return AugAssign(expr1, newoperator, expr2, LINENO(n), n->n_col_offset, c->c_arena);
     }
     else {
-	int i;
-	asdl_seq *targets;
-	node *value;
+        int i;
+        asdl_seq *targets;
+        node *value;
         expr_ty expression;
 
-	/* a normal assignment */
-	REQ(CHILD(n, 1), EQUAL);
-	targets = asdl_seq_new(NCH(n) / 2, c->c_arena);
-	if (!targets)
-	    return NULL;
-	for (i = 0; i < NCH(n) - 2; i += 2) {
-	    expr_ty e;
-	    node *ch = CHILD(n, i);
-	    if (TYPE(ch) == yield_expr) {
-		ast_error(ch, "assignment to yield expression not possible");
-		return NULL;
-	    }
-	    e = ast_for_testlist(c, ch);
+        /* a normal assignment */
+        REQ(CHILD(n, 1), EQUAL);
+        targets = asdl_seq_new(NCH(n) / 2, c->c_arena);
+        if (!targets)
+            return NULL;
+        for (i = 0; i < NCH(n) - 2; i += 2) {
+            expr_ty e;
+            node *ch = CHILD(n, i);
+            if (TYPE(ch) == yield_expr) {
+                ast_error(ch, "assignment to yield expression not possible");
+                return NULL;
+            }
+            e = ast_for_testlist(c, ch);
+
+            /* set context to assign */
+            if (!e) 
+              return NULL;
+
+            if (!set_context(e, Store, CHILD(n, i)))
+              return NULL;
 
-	    /* set context to assign */
-	    if (!e) 
-	      return NULL;
-
-	    if (!set_context(e, Store, CHILD(n, i)))
-	      return NULL;
-
-	    asdl_seq_SET(targets, i / 2, e);
-	}
-	value = CHILD(n, NCH(n) - 1);
-	if (TYPE(value) == testlist)
-	    expression = ast_for_testlist(c, value);
-	else
-	    expression = ast_for_expr(c, value);
-	if (!expression)
-	    return NULL;
-	return Assign(targets, expression, LINENO(n), n->n_col_offset, c->c_arena);
+            asdl_seq_SET(targets, i / 2, e);
+        }
+        value = CHILD(n, NCH(n) - 1);
+        if (TYPE(value) == testlist)
+            expression = ast_for_testlist(c, value);
+        else
+            expression = ast_for_expr(c, value);
+        if (!expression)
+            return NULL;
+        return Assign(targets, expression, LINENO(n), n->n_col_offset, c->c_arena);
     }
 }
 
@@ -2030,19 +2188,19 @@
 
     REQ(n, print_stmt);
     if (NCH(n) >= 2 && TYPE(CHILD(n, 1)) == RIGHTSHIFT) {
-	dest = ast_for_expr(c, CHILD(n, 2));
+        dest = ast_for_expr(c, CHILD(n, 2));
         if (!dest)
             return NULL;
-	    start = 4;
+            start = 4;
     }
     seq = asdl_seq_new((NCH(n) + 1 - start) / 2, c->c_arena);
     if (!seq)
-    	return NULL;
+        return NULL;
     for (i = start, j = 0; i < NCH(n); i += 2, ++j) {
         expression = ast_for_expr(c, CHILD(n, i));
         if (!expression)
             return NULL;
-    	asdl_seq_SET(seq, j, expression);
+        asdl_seq_SET(seq, j, expression);
     }
     nl = (TYPE(CHILD(n, NCH(n) - 1)) == COMMA) ? false : true;
     return Print(dest, seq, nl, LINENO(n), n->n_col_offset, c->c_arena);
@@ -2059,14 +2217,14 @@
 
     seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
     if (!seq)
-	return NULL;
+        return NULL;
     for (i = 0; i < NCH(n); i += 2) {
-	e = ast_for_expr(c, CHILD(n, i));
-	if (!e)
-	    return NULL;
-	asdl_seq_SET(seq, i / 2, e);
-	if (context && !set_context(e, context, CHILD(n, i)))
-	    return NULL;
+        e = ast_for_expr(c, CHILD(n, i));
+        if (!e)
+            return NULL;
+        asdl_seq_SET(seq, i / 2, e);
+        if (context && !set_context(e, context, CHILD(n, i)))
+            return NULL;
     }
     return seq;
 }
@@ -2108,9 +2266,9 @@
         case continue_stmt:
             return Continue(LINENO(n), n->n_col_offset, c->c_arena);
         case yield_stmt: { /* will reduce to yield_expr */
-	    expr_ty exp = ast_for_expr(c, CHILD(ch, 0));
-	    if (!exp)
-		return NULL;
+            expr_ty exp = ast_for_expr(c, CHILD(ch, 0));
+            if (!exp)
+                return NULL;
             return Expr(exp, LINENO(n), n->n_col_offset, c->c_arena);
         }
         case return_stmt:
@@ -2183,10 +2341,6 @@
         case import_as_name:
             str = NULL;
             if (NCH(n) == 3) {
-                if (strcmp(STR(CHILD(n, 1)), "as") != 0) {
-                    ast_error(n, "must use 'as' in import");
-                    return NULL;
-                }
                 str = NEW_IDENTIFIER(CHILD(n, 2));
             }
             return alias(NEW_IDENTIFIER(CHILD(n, 0)), str, c->c_arena);
@@ -2199,10 +2353,6 @@
                 alias_ty a = alias_for_import_name(c, CHILD(n, 0));
                 if (!a)
                     return NULL;
-                if (strcmp(STR(CHILD(n, 1)), "as") != 0) {
-                    ast_error(n, "must use 'as' in import");
-                    return NULL;
-                }
                 assert(!a->asname);
                 a->asname = NEW_IDENTIFIER(CHILD(n, 2));
                 return a;
@@ -2237,13 +2387,13 @@
                 --s;
                 *s = '\0';
                 PyString_InternInPlace(&str);
-		PyArena_AddPyObject(c->c_arena, str);
+                PyArena_AddPyObject(c->c_arena, str);
                 return alias(str, NULL, c->c_arena);
             }
             break;
         case STAR:
-	    str = PyString_InternFromString("*");
-	    PyArena_AddPyObject(c->c_arena, str);
+            str = PyString_InternFromString("*");
+            PyArena_AddPyObject(c->c_arena, str);
             return alias(str, NULL, c->c_arena);
         default:
             PyErr_Format(PyExc_SystemError,
@@ -2275,69 +2425,69 @@
     n = CHILD(n, 0);
     if (TYPE(n) == import_name) {
         n = CHILD(n, 1);
-	REQ(n, dotted_as_names);
-	aliases = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
-	if (!aliases)
-		return NULL;
-	for (i = 0; i < NCH(n); i += 2) {
+        REQ(n, dotted_as_names);
+        aliases = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
+        if (!aliases)
+                return NULL;
+        for (i = 0; i < NCH(n); i += 2) {
             alias_ty import_alias = alias_for_import_name(c, CHILD(n, i));
             if (!import_alias)
                 return NULL;
-	    asdl_seq_SET(aliases, i / 2, import_alias);
+            asdl_seq_SET(aliases, i / 2, import_alias);
         }
-	return Import(aliases, lineno, col_offset, c->c_arena);
+        return Import(aliases, lineno, col_offset, c->c_arena);
     }
     else if (TYPE(n) == import_from) {
         int n_children;
-	int idx, ndots = 0;
-	alias_ty mod = NULL;
-	identifier modname;
-	
+        int idx, ndots = 0;
+        alias_ty mod = NULL;
+        identifier modname;
+        
        /* Count the number of dots (for relative imports) and check for the
           optional module name */
-	for (idx = 1; idx < NCH(n); idx++) {
-	    if (TYPE(CHILD(n, idx)) == dotted_name) {
-	    	mod = alias_for_import_name(c, CHILD(n, idx));
-	    	idx++;
-	    	break;
-	    } else if (TYPE(CHILD(n, idx)) != DOT) {
-	        break;
-	    }
-	    ndots++;
-	}
-	idx++; /* skip over the 'import' keyword */
+        for (idx = 1; idx < NCH(n); idx++) {
+            if (TYPE(CHILD(n, idx)) == dotted_name) {
+                mod = alias_for_import_name(c, CHILD(n, idx));
+                idx++;
+                break;
+            } else if (TYPE(CHILD(n, idx)) != DOT) {
+                break;
+            }
+            ndots++;
+        }
+        idx++; /* skip over the 'import' keyword */
         switch (TYPE(CHILD(n, idx))) {
         case STAR:
             /* from ... import * */
-	    n = CHILD(n, idx);
-	    n_children = 1;
-	    if (ndots) {
-	        ast_error(n, "'import *' not allowed with 'from .'");
-	        return NULL;
-	    }
-	    break;
-	case LPAR:
-	    /* from ... import (x, y, z) */
-	    n = CHILD(n, idx + 1);
-	    n_children = NCH(n);
-	    break;
-	case import_as_names:
-	    /* from ... import x, y, z */
-	    n = CHILD(n, idx);
-	    n_children = NCH(n);
+            n = CHILD(n, idx);
+            n_children = 1;
+            if (ndots) {
+                ast_error(n, "'import *' not allowed with 'from .'");
+                return NULL;
+            }
+            break;
+        case LPAR:
+            /* from ... import (x, y, z) */
+            n = CHILD(n, idx + 1);
+            n_children = NCH(n);
+            break;
+        case import_as_names:
+            /* from ... import x, y, z */
+            n = CHILD(n, idx);
+            n_children = NCH(n);
             if (n_children % 2 == 0) {
                 ast_error(n, "trailing comma not allowed without"
                              " surrounding parentheses");
                 return NULL;
             }
-	    break;
-	default:
-	    ast_error(n, "Unexpected node-type in from-import");
-	    return NULL;
-	}
+            break;
+        default:
+            ast_error(n, "Unexpected node-type in from-import");
+            return NULL;
+        }
 
-	aliases = asdl_seq_new((n_children + 1) / 2, c->c_arena);
-	if (!aliases)
+        aliases = asdl_seq_new((n_children + 1) / 2, c->c_arena);
+        if (!aliases)
             return NULL;
 
         /* handle "from ... import *" special b/c there's no children */
@@ -2345,14 +2495,14 @@
             alias_ty import_alias = alias_for_import_name(c, n);
             if (!import_alias)
                 return NULL;
-	        asdl_seq_SET(aliases, 0, import_alias);
+                asdl_seq_SET(aliases, 0, import_alias);
         }
         else {
-    	    for (i = 0; i < NCH(n); i += 2) {
+            for (i = 0; i < NCH(n); i += 2) {
                 alias_ty import_alias = alias_for_import_name(c, CHILD(n, i));
                 if (!import_alias)
                     return NULL;
-	            asdl_seq_SET(aliases, i / 2, import_alias);
+                    asdl_seq_SET(aliases, i / 2, import_alias);
             }
         }
         if (mod != NULL)
@@ -2379,45 +2529,14 @@
     REQ(n, global_stmt);
     s = asdl_seq_new(NCH(n) / 2, c->c_arena);
     if (!s)
-    	return NULL;
-    for (i = 1; i < NCH(n); i += 2) {
-	name = NEW_IDENTIFIER(CHILD(n, i));
-	if (!name)
-	    return NULL;
-	asdl_seq_SET(s, i / 2, name);
-    }
-    return Global(s, LINENO(n), n->n_col_offset, c->c_arena);
-}
-
-static stmt_ty
-ast_for_exec_stmt(struct compiling *c, const node *n)
-{
-    expr_ty expr1, globals = NULL, locals = NULL;
-    int n_children = NCH(n);
-    if (n_children != 2 && n_children != 4 && n_children != 6) {
-        PyErr_Format(PyExc_SystemError,
-                     "poorly formed 'exec' statement: %d parts to statement",
-                     n_children);
-        return NULL;
-    }
-
-    /* exec_stmt: 'exec' expr ['in' test [',' test]] */
-    REQ(n, exec_stmt);
-    expr1 = ast_for_expr(c, CHILD(n, 1));
-    if (!expr1)
         return NULL;
-    if (n_children >= 4) {
-        globals = ast_for_expr(c, CHILD(n, 3));
-        if (!globals)
-            return NULL;
-    }
-    if (n_children == 6) {
-        locals = ast_for_expr(c, CHILD(n, 5));
-        if (!locals)
+    for (i = 1; i < NCH(n); i += 2) {
+        name = NEW_IDENTIFIER(CHILD(n, i));
+        if (!name)
             return NULL;
+        asdl_seq_SET(s, i / 2, name);
     }
-
-    return Exec(expr1, globals, locals, LINENO(n), n->n_col_offset, c->c_arena);
+    return Global(s, LINENO(n), n->n_col_offset, c->c_arena);
 }
 
 static stmt_ty
@@ -2429,7 +2548,7 @@
         expr_ty expression = ast_for_expr(c, CHILD(n, 1));
         if (!expression)
             return NULL;
-	return Assert(expression, NULL, LINENO(n), n->n_col_offset, c->c_arena);
+        return Assert(expression, NULL, LINENO(n), n->n_col_offset, c->c_arena);
     }
     else if (NCH(n) == 4) {
         expr_ty expr1, expr2;
@@ -2441,7 +2560,7 @@
         if (!expr2)
             return NULL;
             
-	return Assert(expr1, expr2, LINENO(n), n->n_col_offset, c->c_arena);
+        return Assert(expr1, expr2, LINENO(n), n->n_col_offset, c->c_arena);
     }
     PyErr_Format(PyExc_SystemError,
                  "improper number of parts to 'assert' statement: %d",
@@ -2463,53 +2582,53 @@
     total = num_stmts(n);
     seq = asdl_seq_new(total, c->c_arena);
     if (!seq)
-    	return NULL;
+        return NULL;
     if (TYPE(CHILD(n, 0)) == simple_stmt) {
-	n = CHILD(n, 0);
-	/* simple_stmt always ends with a NEWLINE,
-	   and may have a trailing SEMI 
-	*/
-	end = NCH(n) - 1;
-	if (TYPE(CHILD(n, end - 1)) == SEMI)
-	    end--;
+        n = CHILD(n, 0);
+        /* simple_stmt always ends with a NEWLINE,
+           and may have a trailing SEMI 
+        */
+        end = NCH(n) - 1;
+        if (TYPE(CHILD(n, end - 1)) == SEMI)
+            end--;
         /* loop by 2 to skip semi-colons */
-	for (i = 0; i < end; i += 2) {
-	    ch = CHILD(n, i);
-	    s = ast_for_stmt(c, ch);
-	    if (!s)
-		return NULL;
-	    asdl_seq_SET(seq, pos++, s);
-	}
+        for (i = 0; i < end; i += 2) {
+            ch = CHILD(n, i);
+            s = ast_for_stmt(c, ch);
+            if (!s)
+                return NULL;
+            asdl_seq_SET(seq, pos++, s);
+        }
     }
     else {
-	for (i = 2; i < (NCH(n) - 1); i++) {
-	    ch = CHILD(n, i);
-	    REQ(ch, stmt);
-	    num = num_stmts(ch);
-	    if (num == 1) {
-		/* small_stmt or compound_stmt with only one child */
-		s = ast_for_stmt(c, ch);
-		if (!s)
-		    return NULL;
-		asdl_seq_SET(seq, pos++, s);
-	    }
-	    else {
-		int j;
-		ch = CHILD(ch, 0);
-		REQ(ch, simple_stmt);
-		for (j = 0; j < NCH(ch); j += 2) {
-		    /* statement terminates with a semi-colon ';' */
-		    if (NCH(CHILD(ch, j)) == 0) {
-			assert((j + 1) == NCH(ch));
-			break;
-		    }
-		    s = ast_for_stmt(c, CHILD(ch, j));
-		    if (!s)
-			return NULL;
-		    asdl_seq_SET(seq, pos++, s);
-		}
-	    }
-	}
+        for (i = 2; i < (NCH(n) - 1); i++) {
+            ch = CHILD(n, i);
+            REQ(ch, stmt);
+            num = num_stmts(ch);
+            if (num == 1) {
+                /* small_stmt or compound_stmt with only one child */
+                s = ast_for_stmt(c, ch);
+                if (!s)
+                    return NULL;
+                asdl_seq_SET(seq, pos++, s);
+            }
+            else {
+                int j;
+                ch = CHILD(ch, 0);
+                REQ(ch, simple_stmt);
+                for (j = 0; j < NCH(ch); j += 2) {
+                    /* statement terminates with a semi-colon ';' */
+                    if (NCH(CHILD(ch, j)) == 0) {
+                        assert((j + 1) == NCH(ch));
+                        break;
+                    }
+                    s = ast_for_stmt(c, CHILD(ch, j));
+                    if (!s)
+                        return NULL;
+                    asdl_seq_SET(seq, pos++, s);
+                }
+            }
+        }
     }
     assert(pos == seq->size);
     return seq;
@@ -2536,7 +2655,7 @@
         if (!suite_seq)
             return NULL;
             
-	return If(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, c->c_arena);
+        return If(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, c->c_arena);
     }
 
     s = STR(CHILD(n, 4));
@@ -2558,28 +2677,28 @@
         if (!seq2)
             return NULL;
 
-	return If(expression, seq1, seq2, LINENO(n), n->n_col_offset, c->c_arena);
+        return If(expression, seq1, seq2, LINENO(n), n->n_col_offset, c->c_arena);
     }
     else if (s[2] == 'i') {
-	int i, n_elif, has_else = 0;
-	asdl_seq *orelse = NULL;
-	n_elif = NCH(n) - 4;
+        int i, n_elif, has_else = 0;
+        asdl_seq *orelse = NULL;
+        n_elif = NCH(n) - 4;
         /* must reference the child n_elif+1 since 'else' token is third,
            not fourth, child from the end. */
-	if (TYPE(CHILD(n, (n_elif + 1))) == NAME
-	    && STR(CHILD(n, (n_elif + 1)))[2] == 's') {
-	    has_else = 1;
-	    n_elif -= 3;
-	}
-	n_elif /= 4;
+        if (TYPE(CHILD(n, (n_elif + 1))) == NAME
+            && STR(CHILD(n, (n_elif + 1)))[2] == 's') {
+            has_else = 1;
+            n_elif -= 3;
+        }
+        n_elif /= 4;
 
-	if (has_else) {
+        if (has_else) {
             expr_ty expression;
             asdl_seq *seq1, *seq2;
 
-	    orelse = asdl_seq_new(1, c->c_arena);
-	    if (!orelse)
-		return NULL;
+            orelse = asdl_seq_new(1, c->c_arena);
+            if (!orelse)
+                return NULL;
             expression = ast_for_expr(c, CHILD(n, NCH(n) - 6));
             if (!expression)
                 return NULL;
@@ -2590,20 +2709,20 @@
             if (!seq2)
                 return NULL;
 
-	    asdl_seq_SET(orelse, 0, If(expression, seq1, seq2, 
-				       LINENO(CHILD(n, NCH(n) - 6)), CHILD(n, NCH(n) - 6)->n_col_offset,
+            asdl_seq_SET(orelse, 0, If(expression, seq1, seq2, 
+                                       LINENO(CHILD(n, NCH(n) - 6)), CHILD(n, NCH(n) - 6)->n_col_offset,
                                        c->c_arena));
-	    /* the just-created orelse handled the last elif */
-	    n_elif--;
-	}
+            /* the just-created orelse handled the last elif */
+            n_elif--;
+        }
 
-	for (i = 0; i < n_elif; i++) {
-	    int off = 5 + (n_elif - i - 1) * 4;
+        for (i = 0; i < n_elif; i++) {
+            int off = 5 + (n_elif - i - 1) * 4;
             expr_ty expression;
             asdl_seq *suite_seq;
-	    asdl_seq *newobj = asdl_seq_new(1, c->c_arena);
-	    if (!newobj)
-		return NULL;
+            asdl_seq *newobj = asdl_seq_new(1, c->c_arena);
+            if (!newobj)
+                return NULL;
             expression = ast_for_expr(c, CHILD(n, off));
             if (!expression)
                 return NULL;
@@ -2611,14 +2730,14 @@
             if (!suite_seq)
                 return NULL;
 
-	    asdl_seq_SET(newobj, 0,
-			 If(expression, suite_seq, orelse, 
-			    LINENO(CHILD(n, off)), CHILD(n, off)->n_col_offset, c->c_arena));
-	    orelse = newobj;
-	}
-	return If(ast_for_expr(c, CHILD(n, 1)),
-		  ast_for_suite(c, CHILD(n, 3)),
-		  orelse, LINENO(n), n->n_col_offset, c->c_arena);
+            asdl_seq_SET(newobj, 0,
+                         If(expression, suite_seq, orelse, 
+                            LINENO(CHILD(n, off)), CHILD(n, off)->n_col_offset, c->c_arena));
+            orelse = newobj;
+        }
+        return If(ast_for_expr(c, CHILD(n, 1)),
+                  ast_for_suite(c, CHILD(n, 3)),
+                  orelse, LINENO(n), n->n_col_offset, c->c_arena);
     }
 
     PyErr_Format(PyExc_SystemError,
@@ -2642,7 +2761,7 @@
         suite_seq = ast_for_suite(c, CHILD(n, 3));
         if (!suite_seq)
             return NULL;
-	return While(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, c->c_arena);
+        return While(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, c->c_arena);
     }
     else if (NCH(n) == 7) {
         expr_ty expression;
@@ -2658,7 +2777,7 @@
         if (!seq2)
             return NULL;
 
-	return While(expression, seq1, seq2, LINENO(n), n->n_col_offset, c->c_arena);
+        return While(expression, seq1, seq2, LINENO(n), n->n_col_offset, c->c_arena);
     }
 
     PyErr_Format(PyExc_SystemError,
@@ -2678,7 +2797,7 @@
     REQ(n, for_stmt);
 
     if (NCH(n) == 9) {
-	seq = ast_for_suite(c, CHILD(n, 8));
+        seq = ast_for_suite(c, CHILD(n, 8));
         if (!seq)
             return NULL;
     }
@@ -2690,9 +2809,9 @@
     /* Check the # of children rather than the length of _target, since
        for x, in ... has 1 element in _target, but still requires a Tuple. */
     if (NCH(node_target) == 1)
-	target = (expr_ty)asdl_seq_GET(_target, 0);
+        target = (expr_ty)asdl_seq_GET(_target, 0);
     else
-	target = Tuple(_target, Store, LINENO(n), n->n_col_offset, c->c_arena);
+        target = Tuple(_target, Store, LINENO(n), n->n_col_offset, c->c_arena);
 
     expression = ast_for_testlist(c, CHILD(n, 3));
     if (!expression)
@@ -2717,7 +2836,7 @@
         if (!suite_seq)
             return NULL;
 
-	return excepthandler(NULL, NULL, suite_seq, LINENO(exc),
+        return excepthandler(NULL, NULL, suite_seq, LINENO(exc),
                              exc->n_col_offset, c->c_arena);
     }
     else if (NCH(exc) == 2) {
@@ -2731,16 +2850,16 @@
         if (!suite_seq)
             return NULL;
 
-	return excepthandler(expression, NULL, suite_seq, LINENO(exc),
+        return excepthandler(expression, NULL, suite_seq, LINENO(exc),
                              exc->n_col_offset, c->c_arena);
     }
     else if (NCH(exc) == 4) {
         asdl_seq *suite_seq;
         expr_ty expression;
-	expr_ty e = ast_for_expr(c, CHILD(exc, 3));
-	if (!e)
+        expr_ty e = ast_for_expr(c, CHILD(exc, 3));
+        if (!e)
             return NULL;
-	if (!set_context(e, Store, CHILD(exc, 3)))
+        if (!set_context(e, Store, CHILD(exc, 3)))
             return NULL;
         expression = ast_for_expr(c, CHILD(exc, 1));
         if (!expression)
@@ -2749,7 +2868,7 @@
         if (!suite_seq)
             return NULL;
 
-	return excepthandler(expression, e, suite_seq, LINENO(exc),
+        return excepthandler(expression, e, suite_seq, LINENO(exc),
                              exc->n_col_offset, c->c_arena);
     }
 
@@ -2804,8 +2923,8 @@
     }
     
     if (n_except > 0) {
-	int i;
-	stmt_ty except_st;
+        int i;
+        stmt_ty except_st;
         /* process except statements to create a try ... except */
         asdl_seq *handlers = asdl_seq_new(n_except, c->c_arena);
         if (handlers == NULL)
@@ -2819,17 +2938,17 @@
             asdl_seq_SET(handlers, i, e);
         }
 
-	except_st = TryExcept(body, handlers, orelse, LINENO(n),
+        except_st = TryExcept(body, handlers, orelse, LINENO(n),
                               n->n_col_offset, c->c_arena);
         if (!finally)
-	    return except_st;
+            return except_st;
 
         /* if a 'finally' is present too, we nest the TryExcept within a
            TryFinally to emulate try ... except ... finally */
-	body = asdl_seq_new(1, c->c_arena);
-	if (body == NULL)
-	    return NULL;
-	asdl_seq_SET(body, 0, except_st);
+        body = asdl_seq_new(1, c->c_arena);
+        if (body == NULL)
+            return NULL;
+        asdl_seq_SET(body, 0, except_st);
     }
 
     /* must be a try ... finally (except clauses are in body, if any exist) */
@@ -2841,10 +2960,6 @@
 ast_for_with_var(struct compiling *c, const node *n)
 {
     REQ(n, with_var);
-    if (strcmp(STR(CHILD(n, 0)), "as") != 0) {
-        ast_error(n, "expected \"with [expr] as [var]\"");
-        return NULL;
-    }
     return ast_for_expr(c, CHILD(n, 1));
 }
 
@@ -2864,9 +2979,9 @@
         if (!optional_vars) {
             return NULL;
         }
-	if (!set_context(optional_vars, Store, n)) {
-	    return NULL;
-	}
+        if (!set_context(optional_vars, Store, n)) {
+            return NULL;
+        }
         suite_index = 4;
     }
 
@@ -2875,7 +2990,7 @@
         return NULL;
     }
     return With(context_expr, optional_vars, suite_seq, LINENO(n), 
-		n->n_col_offset, c->c_arena);
+                n->n_col_offset, c->c_arena);
 }
 
 static stmt_ty
@@ -2887,23 +3002,23 @@
     REQ(n, classdef);
 
     if (!strcmp(STR(CHILD(n, 1)), "None")) {
-	    ast_error(n, "assignment to None");
-	    return NULL;
+            ast_error(n, "assignment to None");
+            return NULL;
     }
 
     if (NCH(n) == 4) {
         s = ast_for_suite(c, CHILD(n, 3));
         if (!s)
             return NULL;
-	return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, LINENO(n),
+        return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, 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),
+        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);
     }
 
@@ -2923,21 +3038,20 @@
 ast_for_stmt(struct compiling *c, const node *n)
 {
     if (TYPE(n) == stmt) {
-	assert(NCH(n) == 1);
-	n = CHILD(n, 0);
+        assert(NCH(n) == 1);
+        n = CHILD(n, 0);
     }
     if (TYPE(n) == simple_stmt) {
-	assert(num_stmts(n) == 1);
-	n = CHILD(n, 0);
+        assert(num_stmts(n) == 1);
+        n = CHILD(n, 0);
     }
     if (TYPE(n) == small_stmt) {
 	REQ(n, small_stmt);
 	n = CHILD(n, 0);
 	/* small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt
-	             | flow_stmt | import_stmt | global_stmt | exec_stmt
-                     | assert_stmt
-	*/
-	switch (TYPE(n)) {
+	             | flow_stmt | import_stmt | global_stmt | assert_stmt
+        */
+        switch (TYPE(n)) {
             case expr_stmt:
                 return ast_for_expr_stmt(c, n);
             case print_stmt:
@@ -2952,8 +3066,6 @@
                 return ast_for_import_stmt(c, n);
             case global_stmt:
                 return ast_for_global_stmt(c, n);
-            case exec_stmt:
-                return ast_for_exec_stmt(c, n);
             case assert_stmt:
                 return ast_for_assert_stmt(c, n);
             default:
@@ -2965,11 +3077,11 @@
     }
     else {
         /* compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt
-	                | funcdef | classdef
-	*/
-	node *ch = CHILD(n, 0);
-	REQ(n, compound_stmt);
-	switch (TYPE(ch)) {
+                        | funcdef | classdef
+        */
+        node *ch = CHILD(n, 0);
+        REQ(n, compound_stmt);
+        switch (TYPE(ch)) {
             case if_stmt:
                 return ast_for_if_stmt(c, ch);
             case while_stmt:
@@ -2989,144 +3101,144 @@
                              "unhandled small_stmt: TYPE=%d NCH=%d\n",
                              TYPE(n), NCH(n));
                 return NULL;
-	}
+        }
     }
 }
 
 static PyObject *
 parsenumber(const char *s)
 {
-	const char *end;
-	long x;
-	double dx;
+        const char *end;
+        long x;
+        double dx;
 #ifndef WITHOUT_COMPLEX
-	Py_complex c;
-	int imflag;
+        Py_complex c;
+        int imflag;
 #endif
 
-	errno = 0;
-	end = s + strlen(s) - 1;
+        errno = 0;
+        end = s + strlen(s) - 1;
 #ifndef WITHOUT_COMPLEX
-	imflag = *end == 'j' || *end == 'J';
+        imflag = *end == 'j' || *end == 'J';
 #endif
-	if (*end == 'l' || *end == 'L')
-		return PyLong_FromString((char *)s, (char **)0, 0);
-	if (s[0] == '0') {
-		x = (long) PyOS_strtoul((char *)s, (char **)&end, 0);
- 		if (x < 0 && errno == 0) {
-	 			return PyLong_FromString((char *)s,
-							 (char **)0,
-							 0);
-		}
-	}
-	else
-		x = PyOS_strtol((char *)s, (char **)&end, 0);
-	if (*end == '\0') {
-		if (errno != 0)
-			return PyLong_FromString((char *)s, (char **)0, 0);
-		return PyInt_FromLong(x);
-	}
-	/* XXX Huge floats may silently fail */
+        if (*end == 'l' || *end == 'L')
+                return PyLong_FromString((char *)s, (char **)0, 0);
+        if (s[0] == '0') {
+                x = (long) PyOS_strtoul((char *)s, (char **)&end, 0);
+                if (x < 0 && errno == 0) {
+                                return PyLong_FromString((char *)s,
+                                                         (char **)0,
+                                                         0);
+                }
+        }
+        else
+                x = PyOS_strtol((char *)s, (char **)&end, 0);
+        if (*end == '\0') {
+                if (errno != 0)
+                        return PyLong_FromString((char *)s, (char **)0, 0);
+                return PyInt_FromLong(x);
+        }
+        /* XXX Huge floats may silently fail */
 #ifndef WITHOUT_COMPLEX
-	if (imflag) {
-		c.real = 0.;
-		PyFPE_START_PROTECT("atof", return 0)
-		c.imag = PyOS_ascii_atof(s);
-		PyFPE_END_PROTECT(c)
-		return PyComplex_FromCComplex(c);
-	}
-	else
+        if (imflag) {
+                c.real = 0.;
+                PyFPE_START_PROTECT("atof", return 0)
+                c.imag = PyOS_ascii_atof(s);
+                PyFPE_END_PROTECT(c)
+                return PyComplex_FromCComplex(c);
+        }
+        else
 #endif
-	{
-		PyFPE_START_PROTECT("atof", return 0)
-		dx = PyOS_ascii_atof(s);
-		PyFPE_END_PROTECT(dx)
-		return PyFloat_FromDouble(dx);
-	}
+        {
+                PyFPE_START_PROTECT("atof", return 0)
+                dx = PyOS_ascii_atof(s);
+                PyFPE_END_PROTECT(dx)
+                return PyFloat_FromDouble(dx);
+        }
 }
 
 static PyObject *
 decode_utf8(const char **sPtr, const char *end, char* encoding)
 {
 #ifndef Py_USING_UNICODE
-	Py_FatalError("decode_utf8 should not be called in this build.");
+        Py_FatalError("decode_utf8 should not be called in this build.");
         return NULL;
 #else
-	PyObject *u, *v;
-	char *s, *t;
-	t = s = (char *)*sPtr;
-	/* while (s < end && *s != '\\') s++; */ /* inefficient for u".." */
-	while (s < end && (*s & 0x80)) s++;
-	*sPtr = s;
-	u = PyUnicode_DecodeUTF8(t, s - t, NULL);
-	if (u == NULL)
-		return NULL;
-	v = PyUnicode_AsEncodedString(u, encoding, NULL);
-	Py_DECREF(u);
-	return v;
+        PyObject *u, *v;
+        char *s, *t;
+        t = s = (char *)*sPtr;
+        /* while (s < end && *s != '\\') s++; */ /* inefficient for u".." */
+        while (s < end && (*s & 0x80)) s++;
+        *sPtr = s;
+        u = PyUnicode_DecodeUTF8(t, s - t, NULL);
+        if (u == NULL)
+                return NULL;
+        v = PyUnicode_AsEncodedString(u, encoding, NULL);
+        Py_DECREF(u);
+        return v;
 #endif
 }
 
 static PyObject *
 decode_unicode(const char *s, size_t len, int rawmode, const char *encoding)
 {
-	PyObject *v, *u;
-	char *buf;
-	char *p;
-	const char *end;
-	if (encoding == NULL) {
-	     	buf = (char *)s;
-		u = NULL;
-	} else if (strcmp(encoding, "iso-8859-1") == 0) {
-	     	buf = (char *)s;
-		u = NULL;
-	} else {
-		/* "\XX" may become "\u005c\uHHLL" (12 bytes) */
-		u = PyString_FromStringAndSize((char *)NULL, len * 4);
-		if (u == NULL)
-			return NULL;
-		p = buf = PyString_AsString(u);
-		end = s + len;
-		while (s < end) {
-			if (*s == '\\') {
-				*p++ = *s++;
-				if (*s & 0x80) {
-					strcpy(p, "u005c");
-					p += 5;
-				}
-			}
-			if (*s & 0x80) { /* XXX inefficient */
-				PyObject *w;
-				char *r;
-				Py_ssize_t rn, i;
-				w = decode_utf8(&s, end, "utf-16-be");
-				if (w == NULL) {
-					Py_DECREF(u);
-					return NULL;
-				}
-				r = PyString_AsString(w);
-				rn = PyString_Size(w);
-				assert(rn % 2 == 0);
-				for (i = 0; i < rn; i += 2) {
-					sprintf(p, "\\u%02x%02x",
-						r[i + 0] & 0xFF,
-						r[i + 1] & 0xFF);
-					p += 6;
-				}
-				Py_DECREF(w);
-			} else {
-				*p++ = *s++;
-			}
-		}
-		len = p - buf;
-		s = buf;
-	}
-	if (rawmode)
-		v = PyUnicode_DecodeRawUnicodeEscape(s, len, NULL);
-	else
-		v = PyUnicode_DecodeUnicodeEscape(s, len, NULL);
-	Py_XDECREF(u);
-	return v;
+        PyObject *v, *u;
+        char *buf;
+        char *p;
+        const char *end;
+        if (encoding == NULL) {
+                buf = (char *)s;
+                u = NULL;
+        } else if (strcmp(encoding, "iso-8859-1") == 0) {
+                buf = (char *)s;
+                u = NULL;
+        } else {
+                /* "\XX" may become "\u005c\uHHLL" (12 bytes) */
+                u = PyString_FromStringAndSize((char *)NULL, len * 4);
+                if (u == NULL)
+                        return NULL;
+                p = buf = PyString_AsString(u);
+                end = s + len;
+                while (s < end) {
+                        if (*s == '\\') {
+                                *p++ = *s++;
+                                if (*s & 0x80) {
+                                        strcpy(p, "u005c");
+                                        p += 5;
+                                }
+                        }
+                        if (*s & 0x80) { /* XXX inefficient */
+                                PyObject *w;
+                                char *r;
+                                Py_ssize_t rn, i;
+                                w = decode_utf8(&s, end, "utf-16-be");
+                                if (w == NULL) {
+                                        Py_DECREF(u);
+                                        return NULL;
+                                }
+                                r = PyString_AsString(w);
+                                rn = PyString_Size(w);
+                                assert(rn % 2 == 0);
+                                for (i = 0; i < rn; i += 2) {
+                                        sprintf(p, "\\u%02x%02x",
+                                                r[i + 0] & 0xFF,
+                                                r[i + 1] & 0xFF);
+                                        p += 6;
+                                }
+                                Py_DECREF(w);
+                        } else {
+                                *p++ = *s++;
+                        }
+                }
+                len = p - buf;
+                s = buf;
+        }
+        if (rawmode)
+                v = PyUnicode_DecodeRawUnicodeEscape(s, len, NULL);
+        else
+                v = PyUnicode_DecodeUnicodeEscape(s, len, NULL);
+        Py_XDECREF(u);
+        return v;
 }
 
 /* s is a Python string literal, including the bracketing quote characters,
@@ -3136,75 +3248,75 @@
 static PyObject *
 parsestr(const char *s, const char *encoding)
 {
-	size_t len;
-	int quote = Py_CHARMASK(*s);
-	int rawmode = 0;
-	int need_encoding;
-	int unicode = 0;
-
-	if (isalpha(quote) || quote == '_') {
-		if (quote == 'u' || quote == 'U') {
-			quote = *++s;
-			unicode = 1;
-		}
-		if (quote == 'r' || quote == 'R') {
-			quote = *++s;
-			rawmode = 1;
-		}
-	}
-	if (quote != '\'' && quote != '\"') {
-		PyErr_BadInternalCall();
-		return NULL;
-	}
-	s++;
-	len = strlen(s);
-	if (len > INT_MAX) {
-		PyErr_SetString(PyExc_OverflowError, 
-				"string to parse is too long");
-		return NULL;
-	}
-	if (s[--len] != quote) {
-		PyErr_BadInternalCall();
-		return NULL;
-	}
-	if (len >= 4 && s[0] == quote && s[1] == quote) {
-		s += 2;
-		len -= 2;
-		if (s[--len] != quote || s[--len] != quote) {
-			PyErr_BadInternalCall();
-			return NULL;
-		}
-	}
+        size_t len;
+        int quote = Py_CHARMASK(*s);
+        int rawmode = 0;
+        int need_encoding;
+        int unicode = 0;
+
+        if (isalpha(quote) || quote == '_') {
+                if (quote == 'u' || quote == 'U') {
+                        quote = *++s;
+                        unicode = 1;
+                }
+                if (quote == 'r' || quote == 'R') {
+                        quote = *++s;
+                        rawmode = 1;
+                }
+        }
+        if (quote != '\'' && quote != '\"') {
+                PyErr_BadInternalCall();
+                return NULL;
+        }
+        s++;
+        len = strlen(s);
+        if (len > INT_MAX) {
+                PyErr_SetString(PyExc_OverflowError, 
+                                "string to parse is too long");
+                return NULL;
+        }
+        if (s[--len] != quote) {
+                PyErr_BadInternalCall();
+                return NULL;
+        }
+        if (len >= 4 && s[0] == quote && s[1] == quote) {
+                s += 2;
+                len -= 2;
+                if (s[--len] != quote || s[--len] != quote) {
+                        PyErr_BadInternalCall();
+                        return NULL;
+                }
+        }
 #ifdef Py_USING_UNICODE
-	if (unicode || Py_UnicodeFlag) {
-		return decode_unicode(s, len, rawmode, encoding);
-	}
+        if (unicode || Py_UnicodeFlag) {
+                return decode_unicode(s, len, rawmode, encoding);
+        }
 #endif
-	need_encoding = (encoding != NULL &&
-			 strcmp(encoding, "utf-8") != 0 &&
-			 strcmp(encoding, "iso-8859-1") != 0);
-	if (rawmode || strchr(s, '\\') == NULL) {
-		if (need_encoding) {
+        need_encoding = (encoding != NULL &&
+                         strcmp(encoding, "utf-8") != 0 &&
+                         strcmp(encoding, "iso-8859-1") != 0);
+        if (rawmode || strchr(s, '\\') == NULL) {
+                if (need_encoding) {
 #ifndef Py_USING_UNICODE
-			/* This should not happen - we never see any other
-			   encoding. */
-			Py_FatalError(
+                        /* This should not happen - we never see any other
+                           encoding. */
+                        Py_FatalError(
                             "cannot deal with encodings in this build.");
 #else
-			PyObject *v, *u = PyUnicode_DecodeUTF8(s, len, NULL);
-			if (u == NULL)
-				return NULL;
-			v = PyUnicode_AsEncodedString(u, encoding, NULL);
-			Py_DECREF(u);
-			return v;
+                        PyObject *v, *u = PyUnicode_DecodeUTF8(s, len, NULL);
+                        if (u == NULL)
+                                return NULL;
+                        v = PyUnicode_AsEncodedString(u, encoding, NULL);
+                        Py_DECREF(u);
+                        return v;
 #endif
-		} else {
-			return PyString_FromStringAndSize(s, len);
-		}
-	}
+                } else {
+                        return PyString_FromStringAndSize(s, len);
+                }
+        }
 
-	return PyString_DecodeEscape(s, len, NULL, unicode,
-				     need_encoding ? encoding : NULL);
+        return PyString_DecodeEscape(s, len, NULL, unicode,
+                                     need_encoding ? encoding : NULL);
 }
 
 /* Build a Python string object out of a STRING atom.  This takes care of
@@ -3214,36 +3326,36 @@
 static PyObject *
 parsestrplus(struct compiling *c, const node *n)
 {
-	PyObject *v;
-	int i;
-	REQ(CHILD(n, 0), STRING);
-	if ((v = parsestr(STR(CHILD(n, 0)), c->c_encoding)) != NULL) {
-		/* String literal concatenation */
-		for (i = 1; i < NCH(n); i++) {
-			PyObject *s;
-			s = parsestr(STR(CHILD(n, i)), c->c_encoding);
-			if (s == NULL)
-				goto onError;
-			if (PyString_Check(v) && PyString_Check(s)) {
-				PyString_ConcatAndDel(&v, s);
-				if (v == NULL)
-				    goto onError;
-			}
+        PyObject *v;
+        int i;
+        REQ(CHILD(n, 0), STRING);
+        if ((v = parsestr(STR(CHILD(n, 0)), c->c_encoding)) != NULL) {
+                /* String literal concatenation */
+                for (i = 1; i < NCH(n); i++) {
+                        PyObject *s;
+                        s = parsestr(STR(CHILD(n, i)), c->c_encoding);
+                        if (s == NULL)
+                                goto onError;
+                        if (PyString_Check(v) && PyString_Check(s)) {
+                                PyString_ConcatAndDel(&v, s);
+                                if (v == NULL)
+                                    goto onError;
+                        }
 #ifdef Py_USING_UNICODE
-			else {
-				PyObject *temp = PyUnicode_Concat(v, s);
-				Py_DECREF(s);
-				Py_DECREF(v);
-				v = temp;
-				if (v == NULL)
-				    goto onError;
-			}
+                        else {
+                                PyObject *temp = PyUnicode_Concat(v, s);
+                                Py_DECREF(s);
+                                Py_DECREF(v);
+                                v = temp;
+                                if (v == NULL)
+                                    goto onError;
+                        }
 #endif
-		}
-	}
-	return v;
+                }
+        }
+        return v;
 
  onError:
-	Py_XDECREF(v);
-	return NULL;
+        Py_XDECREF(v);
+        return NULL;
 }

Modified: python/branches/p3yk-noslice/Python/bltinmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Python/bltinmodule.c	(original)
+++ python/branches/p3yk-noslice/Python/bltinmodule.c	Fri Dec 15 05:21:50 2006
@@ -403,7 +403,7 @@
 "compile(source, filename, mode[, flags[, dont_inherit]]) -> code object\n\
 \n\
 Compile the source string (a Python module, statement or expression)\n\
-into a code object that can be executed by the exec statement or eval().\n\
+into a code object that can be executed by exec() or eval().\n\
 The filename will be used for run-time error messages.\n\
 The mode must be 'exec' to compile a module, 'single' to compile a\n\
 single (interactive) statement, or 'eval' to compile an expression.\n\
@@ -539,10 +539,118 @@
 Evaluate the source in the context of globals and locals.\n\
 The source may be a string representing a Python expression\n\
 or a code object as returned by compile().\n\
-The globals must be a dictionary and locals can be any mappping,\n\
+The globals must be a dictionary and locals can be any mapping,\n\
 defaulting to the current globals and locals.\n\
 If only globals is given, locals defaults to it.\n");
 
+static PyObject *
+builtin_exec(PyObject *self, PyObject *args)
+{
+	PyObject *v;
+	PyObject *prog, *globals = Py_None, *locals = Py_None;
+	int plain = 0;
+
+	if (!PyArg_ParseTuple(args, "O|OO:exec", &prog, &globals, &locals))
+		return NULL;
+	
+	if (globals == Py_None) {
+		globals = PyEval_GetGlobals();
+		if (locals == Py_None) {
+			locals = PyEval_GetLocals();
+			plain = 1;
+		}
+		if (!globals || !locals) {
+			PyErr_SetString(PyExc_SystemError,
+					"globals and locals cannot be NULL");
+			return NULL;
+		}
+	}
+	else if (locals == Py_None)
+		locals = globals;
+	if (!PyString_Check(prog) &&
+	    !PyUnicode_Check(prog) &&
+	    !PyCode_Check(prog) &&
+	    !PyFile_Check(prog)) {
+		PyErr_Format(PyExc_TypeError,
+			"exec() arg 1 must be a string, file, or code "
+			"object, not %.100s", prog->ob_type->tp_name);
+		return NULL;
+	}
+	if (!PyDict_Check(globals)) {
+		PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.100s",
+			     globals->ob_type->tp_name);
+		return NULL;
+	}
+	if (!PyMapping_Check(locals)) {
+		PyErr_Format(PyExc_TypeError,
+		    "arg 3 must be a mapping or None, not %.100s",
+		    locals->ob_type->tp_name);
+		return NULL;
+	}
+	if (PyDict_GetItemString(globals, "__builtins__") == NULL) {
+		if (PyDict_SetItemString(globals, "__builtins__",
+					 PyEval_GetBuiltins()) != 0)
+			return NULL;
+	}
+
+	if (PyCode_Check(prog)) {
+		if (PyCode_GetNumFree((PyCodeObject *)prog) > 0) {
+			PyErr_SetString(PyExc_TypeError,
+				"code object passed to exec() may not "
+				"contain free variables");
+			return NULL;
+		}
+		v = PyEval_EvalCode((PyCodeObject *) prog, globals, locals);
+	}
+	else if (PyFile_Check(prog)) {
+		FILE *fp = PyFile_AsFile(prog);
+		char *name = PyString_AsString(PyFile_Name(prog));
+		PyCompilerFlags cf;
+		cf.cf_flags = 0;
+		if (PyEval_MergeCompilerFlags(&cf))
+			v = PyRun_FileFlags(fp, name, Py_file_input, globals,
+					    locals, &cf);
+		else
+			v = PyRun_File(fp, name, Py_file_input, globals,
+				       locals);
+	}
+	else {
+		PyObject *tmp = NULL;
+		char *str;
+		PyCompilerFlags cf;
+		cf.cf_flags = 0;
+#ifdef Py_USING_UNICODE
+		if (PyUnicode_Check(prog)) {
+			tmp = PyUnicode_AsUTF8String(prog);
+			if (tmp == NULL)
+				return NULL;
+			prog = tmp;
+			cf.cf_flags |= PyCF_SOURCE_IS_UTF8;
+		}
+#endif
+		if (PyString_AsStringAndSize(prog, &str, NULL))
+			return NULL;
+		if (PyEval_MergeCompilerFlags(&cf))
+			v = PyRun_StringFlags(str, Py_file_input, globals,
+					      locals, &cf);
+		else
+			v = PyRun_String(str, Py_file_input, globals, locals);
+		Py_XDECREF(tmp);
+	}
+	if (v == NULL)
+		return NULL;
+	Py_DECREF(v);
+	Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(exec_doc,
+"exec(object[, globals[, locals]])\n\
+\n\
+Read and execute code from a object, which can be a string, a code\n\
+object or a file object.\n\
+The globals and locals are dictionaries, defaulting to the current\n\
+globals and locals.  If only globals is given, locals defaults to it.");
+
 
 static PyObject *
 builtin_execfile(PyObject *self, PyObject *args)
@@ -1305,6 +1413,73 @@
 
 
 
+static PyObject *
+builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
+{
+	static char *kwlist[] = {"sep", "end", "file", 0};
+	PyObject *dummy_args = PyTuple_New(0);
+	PyObject *sep = NULL, *end = NULL, *file = NULL;
+	int i, err;
+
+	if (dummy_args == NULL)
+		return NULL;
+	if (!PyArg_ParseTupleAndKeywords(dummy_args, kwds, "|OOO:Print",
+					 kwlist, &sep, &end, &file))
+                return NULL;
+	if (file == NULL || file == Py_None)
+		file = PySys_GetObject("stdout");
+
+	if (sep && sep != Py_None && !PyString_Check(sep) &&
+	    !PyUnicode_Check(sep)) {
+		PyErr_Format(PyExc_TypeError,
+			     "sep must be None, str or unicode, not %.200s",
+			     sep->ob_type->tp_name);
+		return NULL;
+	}
+	if (end && end != Py_None && !PyString_Check(end) &&
+	    !PyUnicode_Check(end)) {
+		PyErr_Format(PyExc_TypeError,
+			     "end must be None, str or unicode, not %.200s",
+			     end->ob_type->tp_name);
+		return NULL;
+	}
+
+	for (i = 0; i < PyTuple_Size(args); i++) {
+		if (i > 0) {
+			if (sep == NULL || sep == Py_None)
+				err = PyFile_WriteString(" ", file);
+			else
+				err = PyFile_WriteObject(sep, file,
+							 Py_PRINT_RAW);
+			if (err)
+				return NULL;
+		}
+		err = PyFile_WriteObject(PyTuple_GetItem(args, i), file,
+					 Py_PRINT_RAW);
+		if (err)
+			return NULL;
+	}
+
+	if (end == NULL || end == Py_None)
+		err = PyFile_WriteString("\n", file);
+	else
+		err = PyFile_WriteObject(end, file, Py_PRINT_RAW);
+	if (err)
+		return NULL;
+
+	Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(print_doc,
+"Print(value, ..., file=None, sep=' ', end='\\n')\n\
+\n\
+Prints the values to a stream, or to sys.stdout by default.\n\
+Optional keyword arguments:\n\
+file: a file-like object (stream); defaults to the current sys.stdout.\n\
+sep:  string inserted between values, default a space.\n\
+end:  string appended after the last value, default a newline.");
+
+
 /* Return number of items in range (lo, hi, step), when arguments are
  * PyInt or PyLong objects.  step > 0 required.  Return a value < 0 if
  * & only if the true value is too large to fit in a signed long.
@@ -1324,9 +1499,10 @@
 	PyObject *tmp1 = NULL, *tmp2 = NULL, *tmp3 = NULL;
 		/* holds sub-expression evaluations */
 
-	/* if (lo >= hi), return length of 0. */
-	if (PyObject_Compare(lo, hi) >= 0)
-		return 0;
+	/* If (lo >= hi), return length of 0 (or error). */
+	n = PyObject_RichCompareBool(lo, hi, Py_LT);
+	if (n <= 0)
+		return n;
 
 	if ((one = PyLong_FromLong(1L)) == NULL)
 		goto Fail;
@@ -1378,7 +1554,7 @@
 	PyObject *v = NULL;
 	long bign;
 	int i, n;
-	int cmp_result;
+	int step_pos;
 
 	PyObject *zero = PyLong_FromLong(0);
 
@@ -1439,18 +1615,22 @@
 		goto Fail;
 	}
 
-	if (PyObject_Cmp(istep, zero, &cmp_result) == -1)
-		goto Fail;
-	if (cmp_result == 0) {
-		PyErr_SetString(PyExc_ValueError,
-				"range() step argument must not be zero");
+	step_pos = PyObject_RichCompareBool(istep, zero, Py_GT);
+	if (step_pos < 0)
 		goto Fail;
-	}
-
-	if (cmp_result > 0)
+	if (step_pos)
 		bign = get_len_of_range_longs(ilow, ihigh, istep);
 	else {
-		PyObject *neg_istep = PyNumber_Negative(istep);
+		int step_zero = PyObject_RichCompareBool(istep, zero, Py_EQ);
+		PyObject *neg_istep;
+		if (step_zero < 0)
+			goto Fail;
+		if (step_zero) {
+			PyErr_SetString(PyExc_ValueError,
+				"range() step argument must not be zero");
+			goto Fail;
+		}
+		neg_istep = PyNumber_Negative(istep);
 		if (neg_istep == NULL)
 			goto Fail;
 		bign = get_len_of_range_longs(ihigh, ilow, neg_istep);
@@ -1792,10 +1972,11 @@
 }
 
 PyDoc_STRVAR(sum_doc,
-"sum(sequence, start=0) -> value\n\
+"sum(sequence[, start]) -> value\n\
 \n\
 Returns the sum of a sequence of numbers (NOT strings) plus the value\n\
-of parameter 'start'.  When the sequence is empty, returns start.");
+of parameter 'start' (which defaults to 0).  When the sequence is\n\
+empty, returns start.");
 
 
 static PyObject *
@@ -1850,116 +2031,20 @@
 static PyObject*
 builtin_zip(PyObject *self, PyObject *args)
 {
-	PyObject *ret;
-	const Py_ssize_t itemsize = PySequence_Length(args);
-	Py_ssize_t i;
-	PyObject *itlist;  /* tuple of iterators */
-	Py_ssize_t len;	   /* guess at result length */
-
-	if (itemsize == 0)
-		return PyList_New(0);
-
 	/* args must be a tuple */
 	assert(PyTuple_Check(args));
 
-	/* Guess at result length:  the shortest of the input lengths.
-	   If some argument refuses to say, we refuse to guess too, lest
-	   an argument like xrange(sys.maxint) lead us astray.*/
-	len = -1;	/* unknown */
-	for (i = 0; i < itemsize; ++i) {
-		PyObject *item = PyTuple_GET_ITEM(args, i);
-		Py_ssize_t thislen = _PyObject_LengthHint(item);
-		if (thislen < 0) {
-			if (!PyErr_ExceptionMatches(PyExc_TypeError)  &&
-			    !PyErr_ExceptionMatches(PyExc_AttributeError)) {
-				return NULL;
-			}
-			PyErr_Clear();
-			len = -1;
-			break;
-		}
-		else if (len < 0 || thislen < len)
-			len = thislen;
-	}
-
-	/* allocate result list */
-	if (len < 0)
-		len = 10;	/* arbitrary */
-	if ((ret = PyList_New(len)) == NULL)
-		return NULL;
-
-	/* obtain iterators */
-	itlist = PyTuple_New(itemsize);
-	if (itlist == NULL)
-		goto Fail_ret;
-	for (i = 0; i < itemsize; ++i) {
-		PyObject *item = PyTuple_GET_ITEM(args, i);
-		PyObject *it = PyObject_GetIter(item);
-		if (it == NULL) {
-			if (PyErr_ExceptionMatches(PyExc_TypeError))
-				PyErr_Format(PyExc_TypeError,
-				    "zip argument #%zd must support iteration",
-				    i+1);
-			goto Fail_ret_itlist;
-		}
-		PyTuple_SET_ITEM(itlist, i, it);
-	}
-
-	/* build result into ret list */
-	for (i = 0; ; ++i) {
-		int j;
-		PyObject *next = PyTuple_New(itemsize);
-		if (!next)
-			goto Fail_ret_itlist;
-
-		for (j = 0; j < itemsize; j++) {
-			PyObject *it = PyTuple_GET_ITEM(itlist, j);
-			PyObject *item = PyIter_Next(it);
-			if (!item) {
-				if (PyErr_Occurred()) {
-					Py_DECREF(ret);
-					ret = NULL;
-				}
-				Py_DECREF(next);
-				Py_DECREF(itlist);
-				goto Done;
-			}
-			PyTuple_SET_ITEM(next, j, item);
-		}
-
-		if (i < len)
-			PyList_SET_ITEM(ret, i, next);
-		else {
-			int status = PyList_Append(ret, next);
-			Py_DECREF(next);
-			++len;
-			if (status < 0)
-				goto Fail_ret_itlist;
-		}
-	}
-
-Done:
-	if (ret != NULL && i < len) {
-		/* The list is too big. */
-		if (PyList_SetSlice(ret, i, len, NULL) < 0)
-			return NULL;
-	}
-	return ret;
-
-Fail_ret_itlist:
-	Py_DECREF(itlist);
-Fail_ret:
-	Py_DECREF(ret);
-	return NULL;
+	return _PyZip_CreateIter(args);
 }
 
 
 PyDoc_STRVAR(zip_doc,
-"zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]\n\
+"zip(it1 [, it2 [...]]) -> iter([(it1[0], it2[0] ...), ...])\n\
 \n\
-Return a list of tuples, where each tuple contains the i-th element\n\
-from each of the argument sequences.  The returned list is truncated\n\
-in length to the length of the shortest argument sequence.");
+Return an iterator yielding tuples, where each tuple contains the\n\
+corresponding element from each of the argument iterables.\n\
+The returned iterator ends when the shortest argument iterable is exhausted.\n\
+NOTE: This is implemented using itertools.izip().");
 
 
 static PyMethodDef builtin_methods[] = {
@@ -1975,6 +2060,7 @@
  	{"dir",		builtin_dir,        METH_VARARGS, dir_doc},
  	{"divmod",	builtin_divmod,     METH_VARARGS, divmod_doc},
  	{"eval",	builtin_eval,       METH_VARARGS, eval_doc},
+	{"exec",        builtin_exec,       METH_VARARGS, exec_doc},
  	{"execfile",	builtin_execfile,   METH_VARARGS, execfile_doc},
  	{"filter",	builtin_filter,     METH_VARARGS, filter_doc},
  	{"getattr",	builtin_getattr,    METH_VARARGS, getattr_doc},
@@ -1996,6 +2082,7 @@
  	{"open",	(PyCFunction)builtin_open,       METH_VARARGS | METH_KEYWORDS, open_doc},
  	{"ord",		builtin_ord,        METH_O, ord_doc},
  	{"pow",		builtin_pow,        METH_VARARGS, pow_doc},
+ 	{"Print",	(PyCFunction)builtin_print,      METH_VARARGS | METH_KEYWORDS, print_doc},
  	{"range",	builtin_range,      METH_VARARGS, range_doc},
  	{"reload",	builtin_reload,     METH_O, reload_doc},
  	{"repr",	builtin_repr,       METH_O, repr_doc},

Modified: python/branches/p3yk-noslice/Python/ceval.c
==============================================================================
--- python/branches/p3yk-noslice/Python/ceval.c	(original)
+++ python/branches/p3yk-noslice/Python/ceval.c	Fri Dec 15 05:21:50 2006
@@ -115,8 +115,6 @@
 static PyObject * import_from(PyObject *, PyObject *);
 static int import_all_from(PyObject *, PyObject *);
 static PyObject * build_class(PyObject *, PyObject *, PyObject *);
-static int exec_statement(PyFrameObject *,
-			  PyObject *, PyObject *, PyObject *);
 static void set_exc_info(PyThreadState *, PyObject *, PyObject *, PyObject *);
 static void reset_exc_info(PyThreadState *);
 static void format_exc_check_arg(PyObject *, char *, PyObject *);
@@ -183,10 +181,10 @@
 PyObject *
 PyEval_GetCallStats(PyObject *self)
 {
-	return Py_BuildValue("iiiiiiiiii",
+	return Py_BuildValue("iiiiiiiiiii",
 			     pcall[0], pcall[1], pcall[2], pcall[3],
 			     pcall[4], pcall[5], pcall[6], pcall[7],
-			     pcall[8], pcall[9]);
+			     pcall[8], pcall[9], pcall[10]);
 }
 #else
 #define PCALL(O)
@@ -493,7 +491,7 @@
 			  (PyObject **)NULL, 0,
 			  (PyObject **)NULL, 0,
 			  (PyObject **)NULL, 0,
-			  NULL);
+			  NULL, NULL);
 }
 
 
@@ -576,7 +574,6 @@
    It's a case-by-case judgement.  I'll use intr1 for the following
    cases:
 
-   EXEC_STMT
    IMPORT_STAR
    IMPORT_FROM
    CALL_FUNCTION (and friends)
@@ -1036,14 +1033,6 @@
 			STACKADJ(-1);
 			break;
 
-		case UNARY_CONVERT:
-			v = TOP();
-			x = PyObject_Repr(v);
-			Py_DECREF(v);
-			SET_TOP(x);
-			if (x != NULL) continue;
-			break;
-
 		case UNARY_INVERT:
 			v = TOP();
 			x = PyNumber_Invert(v);
@@ -1562,19 +1551,6 @@
 			why = WHY_YIELD;
 			goto fast_yield;
 
-		case EXEC_STMT:
-			w = TOP();
-			v = SECOND();
-			u = THIRD();
-			STACKADJ(-3);
-			READ_TIMESTAMP(intr0);
-			err = exec_statement(f, u, v, w);
-			READ_TIMESTAMP(intr1);
-			Py_DECREF(u);
-			Py_DECREF(v);
-			Py_DECREF(w);
-			break;
-
 		case POP_BLOCK:
 			{
 				PyTryBlock *b = PyFrame_BlockPop(f);
@@ -1885,6 +1861,24 @@
 			}
 			break;
 
+		case BUILD_SET:
+			x = PySet_New(NULL);
+			if (x != NULL) {
+				for (; --oparg >= 0;) {
+					w = POP();
+					if (err == 0)
+						err = PySet_Add(x, w);
+					Py_DECREF(w);
+				}
+				if (err != 0) {
+					Py_DECREF(x);
+					break;
+				}
+				PUSH(x);
+				continue;
+			}
+			break;
+
 		case BUILD_MAP:
 			x = PyDict_New();
 			PUSH(x);
@@ -2228,26 +2222,46 @@
 		}
 
 		case MAKE_FUNCTION:
+		{
+		    int posdefaults = oparg & 0xff;
+		    int kwdefaults = (oparg>>8) & 0xff;
+
 			v = POP(); /* code object */
 			x = PyFunction_New(v, f->f_globals);
 			Py_DECREF(v);
 			/* XXX Maybe this should be a separate opcode? */
-			if (x != NULL && oparg > 0) {
-				v = PyTuple_New(oparg);
+			if (x != NULL && posdefaults > 0) {
+				v = PyTuple_New(posdefaults);
 				if (v == NULL) {
 					Py_DECREF(x);
 					x = NULL;
 					break;
 				}
-				while (--oparg >= 0) {
+				while (--posdefaults >= 0) {
 					w = POP();
-					PyTuple_SET_ITEM(v, oparg, w);
+					PyTuple_SET_ITEM(v, posdefaults, w);
 				}
 				err = PyFunction_SetDefaults(x, v);
 				Py_DECREF(v);
 			}
+			if (x != NULL && kwdefaults > 0) {
+				v = PyDict_New();
+				if (v == NULL) {
+					Py_DECREF(x);
+					x = NULL;
+					break;
+				}
+				while (--kwdefaults >= 0) {
+					w = POP(); /* default value */
+					u = POP(); /* kw only arg name */
+					PyDict_SetItem(v, u, w);
+				}
+				err = PyFunction_SetKwDefaults(x, v);
+				Py_DECREF(v);
+			}
 			PUSH(x);
 			break;
+		}
 
 		case MAKE_CLOSURE:
 		{
@@ -2515,7 +2529,7 @@
 PyObject *
 PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
 	   PyObject **args, int argcount, PyObject **kws, int kwcount,
-	   PyObject **defs, int defcount, PyObject *closure)
+	   PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure)
 {
 	register PyFrameObject *f;
 	register PyObject *retval = NULL;
@@ -2539,6 +2553,7 @@
 	freevars = f->f_localsplus + co->co_nlocals;
 
 	if (co->co_argcount > 0 ||
+	    co->co_kwonlyargcount > 0 ||
 	    co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) {
 		int i;
 		int n = argcount;
@@ -2547,7 +2562,7 @@
 			kwdict = PyDict_New();
 			if (kwdict == NULL)
 				goto fail;
-			i = co->co_argcount;
+			i = co->co_argcount + co->co_kwonlyargcount;
 			if (co->co_flags & CO_VARARGS)
 				i++;
 			SETLOCAL(i, kwdict);
@@ -2556,7 +2571,7 @@
 			if (!(co->co_flags & CO_VARARGS)) {
 				PyErr_Format(PyExc_TypeError,
 				    "%.200s() takes %s %d "
-				    "%sargument%s (%d given)",
+				    "%spositional argument%s (%d given)",
 				    PyString_AsString(co->co_name),
 				    defcount ? "at most" : "exactly",
 				    co->co_argcount,
@@ -2576,7 +2591,7 @@
 			u = PyTuple_New(argcount - n);
 			if (u == NULL)
 				goto fail;
-			SETLOCAL(co->co_argcount, u);
+			SETLOCAL(co->co_argcount + co->co_kwonlyargcount, u);
 			for (i = n; i < argcount; i++) {
 				x = args[i];
 				Py_INCREF(x);
@@ -2594,7 +2609,9 @@
 				goto fail;
 			}
 			/* XXX slow -- speed up using dictionary? */
-			for (j = 0; j < co->co_argcount; j++) {
+			for (j = 0;
+			     j < co->co_argcount + co->co_kwonlyargcount;
+			     j++) {
 				PyObject *nm = PyTuple_GET_ITEM(
 					co->co_varnames, j);
 				int cmp = PyObject_RichCompareBool(
@@ -2607,7 +2624,7 @@
 			/* Check errors from Compare */
 			if (PyErr_Occurred())
 				goto fail;
-			if (j >= co->co_argcount) {
+			if (j >= co->co_argcount + co->co_kwonlyargcount) {
 				if (kwdict == NULL) {
 					PyErr_Format(PyExc_TypeError,
 					    "%.200s() got an unexpected "
@@ -2632,13 +2649,38 @@
 				SETLOCAL(j, value);
 			}
 		}
+		if (co->co_kwonlyargcount > 0) {
+			for (i = co->co_argcount;
+			     i < co->co_argcount + co->co_kwonlyargcount;
+			     i++) {
+				PyObject *name, *def;
+				if (GETLOCAL(i) != NULL)
+					continue;
+				name = PyTuple_GET_ITEM(co->co_varnames, i);
+				def = NULL;
+				if (kwdefs != NULL)
+					def = PyDict_GetItem(kwdefs, name);
+				if (def != NULL) {
+					Py_INCREF(def);
+					SETLOCAL(i, def);
+					continue;
+				}
+				PyErr_Format(PyExc_TypeError,
+					"%.200s() needs "
+					"keyword only argument %s",
+					PyString_AsString(co->co_name),
+					PyString_AsString(name));
+				goto fail;
+			}
+		}
 		if (argcount < co->co_argcount) {
 			int m = co->co_argcount - defcount;
 			for (i = argcount; i < m; i++) {
 				if (GETLOCAL(i) == NULL) {
 					PyErr_Format(PyExc_TypeError,
 					    "%.200s() takes %s %d "
-					    "%sargument%s (%d given)",
+					    "%spositional argument%s "
+					    "(%d given)",
 					    PyString_AsString(co->co_name),
 					    ((co->co_flags & CO_VARARGS) ||
 					     defcount) ? "at least"
@@ -3503,12 +3545,14 @@
 	PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
 	PyObject *globals = PyFunction_GET_GLOBALS(func);
 	PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+	PyObject *kwdefs = PyFunction_GET_KW_DEFAULTS(func);
 	PyObject **d = NULL;
 	int nd = 0;
 
 	PCALL(PCALL_FUNCTION);
 	PCALL(PCALL_FAST_FUNCTION);
-	if (argdefs == NULL && co->co_argcount == n && nk==0 &&
+	if (argdefs == NULL && co->co_argcount == n &&
+	    co->co_kwonlyargcount == 0 && nk==0 &&
 	    co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
 		PyFrameObject *f;
 		PyObject *retval = NULL;
@@ -3546,7 +3590,7 @@
 	}
 	return PyEval_EvalCodeEx(co, globals,
 				 (PyObject *)NULL, (*pp_stack)-n, na,
-				 (*pp_stack)-2*nk, nk, d, nd,
+				 (*pp_stack)-2*nk, nk, d, nd, kwdefs,
 				 PyFunction_GET_CLOSURE(func));
 }
 
@@ -3867,8 +3911,10 @@
 		value = PyObject_GetAttr(v, name);
 		if (value == NULL)
 			err = -1;
-		else
+		else if (PyDict_CheckExact(locals))
 			err = PyDict_SetItem(locals, name, value);
+		else
+			err = PyObject_SetItem(locals, name, value);
 		Py_DECREF(name);
 		Py_XDECREF(value);
 		if (err != 0)
@@ -3930,107 +3976,6 @@
 	return result;
 }
 
-static int
-exec_statement(PyFrameObject *f, PyObject *prog, PyObject *globals,
-	       PyObject *locals)
-{
-	int n;
-	PyObject *v;
-	int plain = 0;
-
-	if (PyTuple_Check(prog) && globals == Py_None && locals == Py_None &&
-	    ((n = PyTuple_Size(prog)) == 2 || n == 3)) {
-		/* Backward compatibility hack */
-		globals = PyTuple_GetItem(prog, 1);
-		if (n == 3)
-			locals = PyTuple_GetItem(prog, 2);
-		prog = PyTuple_GetItem(prog, 0);
-	}
-	if (globals == Py_None) {
-		globals = PyEval_GetGlobals();
-		if (locals == Py_None) {
-			locals = PyEval_GetLocals();
-			plain = 1;
-		}
-		if (!globals || !locals) {
-			PyErr_SetString(PyExc_SystemError,
-					"globals and locals cannot be NULL");
-			return -1;
-		}
-	}
-	else if (locals == Py_None)
-		locals = globals;
-	if (!PyString_Check(prog) &&
-	    !PyUnicode_Check(prog) &&
-	    !PyCode_Check(prog) &&
-	    !PyFile_Check(prog)) {
-		PyErr_SetString(PyExc_TypeError,
-			"exec: arg 1 must be a string, file, or code object");
-		return -1;
-	}
-	if (!PyDict_Check(globals)) {
-		PyErr_SetString(PyExc_TypeError,
-		    "exec: arg 2 must be a dictionary or None");
-		return -1;
-	}
-	if (!PyMapping_Check(locals)) {
-		PyErr_SetString(PyExc_TypeError,
-		    "exec: arg 3 must be a mapping or None");
-		return -1;
-	}
-	if (PyDict_GetItemString(globals, "__builtins__") == NULL)
-		PyDict_SetItemString(globals, "__builtins__", f->f_builtins);
-	if (PyCode_Check(prog)) {
-		if (PyCode_GetNumFree((PyCodeObject *)prog) > 0) {
-			PyErr_SetString(PyExc_TypeError,
-		"code object passed to exec may not contain free variables");
-			return -1;
-		}
-		v = PyEval_EvalCode((PyCodeObject *) prog, globals, locals);
-	}
-	else if (PyFile_Check(prog)) {
-		FILE *fp = PyFile_AsFile(prog);
-		char *name = PyString_AsString(PyFile_Name(prog));
-		PyCompilerFlags cf;
-		cf.cf_flags = 0;
-		if (PyEval_MergeCompilerFlags(&cf))
-			v = PyRun_FileFlags(fp, name, Py_file_input, globals,
-					    locals, &cf);
-		else
-			v = PyRun_File(fp, name, Py_file_input, globals,
-				       locals);
-	}
-	else {
-		PyObject *tmp = NULL;
-		char *str;
-		PyCompilerFlags cf;
-		cf.cf_flags = 0;
-#ifdef Py_USING_UNICODE
-		if (PyUnicode_Check(prog)) {
-			tmp = PyUnicode_AsUTF8String(prog);
-			if (tmp == NULL)
-				return -1;
-			prog = tmp;
-			cf.cf_flags |= PyCF_SOURCE_IS_UTF8;
-		}
-#endif
-		if (PyString_AsStringAndSize(prog, &str, NULL))
-			return -1;
-		if (PyEval_MergeCompilerFlags(&cf))
-			v = PyRun_StringFlags(str, Py_file_input, globals,
-					      locals, &cf);
-		else
-			v = PyRun_String(str, Py_file_input, globals, locals);
-		Py_XDECREF(tmp);
-	}
-	if (plain)
-		PyFrame_LocalsToFast(f, 0);
-	if (v == NULL)
-		return -1;
-	Py_DECREF(v);
-	return 0;
-}
-
 static void
 format_exc_check_arg(PyObject *exc, char *format_str, PyObject *obj)
 {

Modified: python/branches/p3yk-noslice/Python/compile.c
==============================================================================
--- python/branches/p3yk-noslice/Python/compile.c	(original)
+++ python/branches/p3yk-noslice/Python/compile.c	Fri Dec 15 05:21:50 2006
@@ -6,9 +6,10 @@
  * object:
  *   1. Checks for future statements.  See future.c
  *   2. Builds a symbol table.	See symtable.c.
- *   3. Generate code for basic blocks.	 See compiler_mod() in this file.
+ *   3. Generate code for basic blocks.  See compiler_mod() in this file.
  *   4. Assemble the basic blocks into final code.  See assemble() in
- *   this file.	 
+ *      this file.	 
+ *   5. Optimize the byte code (peephole optimizations).  See peephole.c
  *
  * Note that compiler_mod() suggests module, but the module ast type
  * (mod_ty) has cases for expressions and interactive statements.
@@ -16,7 +17,8 @@
  * CAUTION: The VISIT_* macros abort the current function when they
  * encounter a problem. So don't invoke them when there is memory
  * which needs to be released. Code blocks are OK, as the compiler
- * structure takes care of releasing those.
+ * structure takes care of releasing those.  Use the arena to manage
+ * objects.
  */
 
 #include "Python.h"
@@ -32,16 +34,6 @@
 
 int Py_OptimizeFlag = 0;
 
-/*
-  ISSUES:
-
-  opcode_stack_effect() function should be reviewed since stack depth bugs
-  could be really hard to find later.
-
-  Dead code is being generated (i.e. after unconditional jumps).
-    XXX(nnorwitz): not sure this is still true
-*/
-
 #define DEFAULT_BLOCK_SIZE 16
 #define DEFAULT_BLOCKS 8
 #define DEFAULT_CODE_SIZE 128
@@ -115,11 +107,12 @@
 	PyObject *u_private;	/* for private name mangling */
 
 	int u_argcount;	   /* number of arguments for block */ 
-    /* Pointer to the most recently allocated block.  By following b_list
-       members, you can reach all early allocated blocks. */
+	int u_kwonlyargcount; /* number of keyword only arguments for block */
+	/* Pointer to the most recently allocated block.  By following b_list
+	   members, you can reach all early allocated blocks. */
 	basicblock *u_blocks;
 	basicblock *u_curblock; /* pointer to current block */
-	int u_tmpname;	   /* temporary variables for list comps */
+	int u_tmpname;		/* temporary variables for list comps */
 
 	int u_nfblocks;
 	struct fblockinfo u_fblock[CO_MAXBLOCKS];
@@ -152,17 +145,6 @@
 	PyArena *c_arena;	 /* pointer to memory allocation arena */
 };
 
-struct assembler {
-	PyObject *a_bytecode;  /* string containing bytecode */
-	int a_offset;	       /* offset into bytecode */
-	int a_nblocks;	       /* number of reachable blocks */
-	basicblock **a_postorder; /* list of blocks in dfs postorder */
-	PyObject *a_lnotab;    /* string containing lnotab */
-	int a_lnotab_off;      /* offset into lnotab */
-	int a_lineno;	       /* last lineno of emitted instruction */
-	int a_lineno_off;      /* bytecode offset of last lineno */
-};
-
 static int compiler_enter_scope(struct compiler *, identifier, void *, int);
 static void compiler_free(struct compiler *);
 static basicblock *compiler_new_block(struct compiler *);
@@ -187,6 +169,8 @@
 				basicblock *);
 static void compiler_pop_fblock(struct compiler *, enum fblocktype,
 				basicblock *);
+/* Returns true if there is a loop on the fblock stack. */
+static int compiler_in_loop(struct compiler *);
 
 static int inplace_binop(struct compiler *, operator_ty);
 static int expr_constant(expr_ty e);
@@ -394,47 +378,6 @@
 	return dest;
 }
 
-/*
-
-Leave this debugging code for just a little longer.
-
-static void
-compiler_display_symbols(PyObject *name, PyObject *symbols)
-{
-PyObject *key, *value;
-int flags;
-Py_ssize_t pos = 0;
-
-fprintf(stderr, "block %s\n", PyString_AS_STRING(name));
-while (PyDict_Next(symbols, &pos, &key, &value)) {
-flags = PyInt_AsLong(value);
-fprintf(stderr, "var %s:", PyString_AS_STRING(key));
-if (flags & DEF_GLOBAL)
-fprintf(stderr, " declared_global");
-if (flags & DEF_LOCAL)
-fprintf(stderr, " local");
-if (flags & DEF_PARAM)
-fprintf(stderr, " param");
-if (flags & DEF_STAR)
-fprintf(stderr, " stararg");
-if (flags & DEF_DOUBLESTAR)
-fprintf(stderr, " starstar");
-if (flags & DEF_INTUPLE)
-fprintf(stderr, " tuple");
-if (flags & DEF_FREE)
-fprintf(stderr, " free");
-if (flags & DEF_FREE_GLOBAL)
-fprintf(stderr, " global");
-if (flags & DEF_FREE_CLASS)
-fprintf(stderr, " free/class");
-if (flags & DEF_IMPORT)
-fprintf(stderr, " import");
-fprintf(stderr, "\n");
-}
-	fprintf(stderr, "\n");
-}
-*/
-
 static void
 compiler_unit_check(struct compiler_unit *u)
 {
@@ -494,6 +437,7 @@
 	}
 	memset(u, 0, sizeof(struct compiler_unit));
 	u->u_argcount = 0;
+	u->u_kwonlyargcount = 0;
 	u->u_ste = PySymtable_Lookup(c->c_st, key);
 	if (!u->u_ste) {
 		compiler_unit_free(u);
@@ -608,7 +552,7 @@
 		return NULL;
 	}
 	memset((void *)b, 0, sizeof(basicblock));
-    /* Extend the singly linked list of blocks with new block. */
+	/* Extend the singly linked list of blocks with new block. */
 	b->b_list = u->u_blocks;
 	u->u_blocks = b;
 	return b;
@@ -647,7 +591,7 @@
 /* Returns the offset of the next instruction in the current block's
    b_instr array.  Resizes the b_instr as necessary.
    Returns -1 on failure.
- */
+*/
 
 static int
 compiler_next_instr(struct compiler *c, basicblock *b)
@@ -691,7 +635,7 @@
    already been set.  If it has been set, the call has no effect.
 
    Every time a new node is b
-   */
+*/
 
 static void
 compiler_set_lineno(struct compiler *c, int off)
@@ -721,7 +665,6 @@
 		case UNARY_POSITIVE:
 		case UNARY_NEGATIVE:
 		case UNARY_NOT:
-		case UNARY_CONVERT:
 		case UNARY_INVERT:
 			return 0;
 
@@ -788,8 +731,6 @@
 			return -1;
 		case IMPORT_STAR:
 			return -1;
-		case EXEC_STMT:
-			return -3;
 		case YIELD_VALUE:
 			return 0;
 
@@ -825,6 +766,7 @@
 			return 1;
 		case BUILD_TUPLE:
 		case BUILD_LIST:
+		case BUILD_SET:
 			return 1-oparg;
 		case BUILD_MAP:
 			return 1;
@@ -871,9 +813,9 @@
 			return -NARGS(oparg)-1;
 		case CALL_FUNCTION_VAR_KW:
 			return -NARGS(oparg)-2;
-#undef NARGS
 		case MAKE_FUNCTION:
-			return -oparg;
+			return -NARGS(oparg);
+#undef NARGS
 		case BUILD_SLICE:
 			if (oparg == 3)
 				return -2;
@@ -932,6 +874,8 @@
 
 	v = PyDict_GetItem(dict, t);
 	if (!v) {
+                if (PyErr_Occurred())
+                        return -1;
 		arg = PyDict_Size(dict);
 		v = PyInt_FromLong(arg);
 		if (!v) {
@@ -1024,8 +968,8 @@
    from the current block to the new block.
 */
 
-/* XXX The returns inside these macros make it impossible to decref
-   objects created in the local function.
+/* The returns inside these macros make it impossible to decref objects
+   created in the local function.  Local objects should use the arena.
 */
 
 
@@ -1320,6 +1264,25 @@
 }
 
 static int
+compiler_visit_kwonlydefaults(struct compiler *c, asdl_seq *kwonlyargs,
+	                      asdl_seq *kw_defaults)
+{
+	int i, default_count = 0;
+	for (i = 0; i < asdl_seq_LEN(kwonlyargs); i++) {
+		expr_ty arg = asdl_seq_GET(kwonlyargs, i);
+		expr_ty default_ = asdl_seq_GET(kw_defaults, i);
+		if (default_) {
+			ADDOP_O(c, LOAD_CONST, arg->v.Name.id, consts);
+			if (!compiler_visit_expr(c, default_)) {
+			    return -1;
+			}
+			default_count++;
+		}
+	}
+	return default_count;
+}
+
+static int
 compiler_function(struct compiler *c, stmt_ty s)
 {
 	PyCodeObject *co;
@@ -1327,14 +1290,22 @@
 	arguments_ty args = s->v.FunctionDef.args;
 	asdl_seq* decos = s->v.FunctionDef.decorators;
 	stmt_ty st;
-	int i, n, docstring;
+	int i, n, docstring, kw_default_count = 0, arglength;
 
 	assert(s->kind == FunctionDef_kind);
 
 	if (!compiler_decorators(c, decos))
 		return 0;
+	if (args->kwonlyargs) {
+		int res = compiler_visit_kwonlydefaults(c, args->kwonlyargs,
+						        args->kw_defaults);
+		if (res < 0)
+			return 0;
+		kw_default_count = res;
+	}
 	if (args->defaults)
 		VISIT_SEQ(c, expr, args->defaults);
+
 	if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s,
 				  s->lineno))
 		return 0;
@@ -1352,6 +1323,7 @@
 	compiler_arguments(c, args);
 
 	c->u->u_argcount = asdl_seq_LEN(args->args);
+	c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs);
 	n = asdl_seq_LEN(s->v.FunctionDef.body);
 	/* if there was a docstring, we need to skip the first statement */
 	for (i = docstring; i < n; i++) {
@@ -1363,7 +1335,9 @@
 	if (co == NULL)
 		return 0;
 
-	compiler_make_closure(c, co, asdl_seq_LEN(args->defaults));
+	arglength = asdl_seq_LEN(args->defaults);
+	arglength |= kw_default_count << 8;
+	compiler_make_closure(c, co, arglength);
 	Py_DECREF(co);
 
 	for (i = 0; i < asdl_seq_LEN(decos); i++) {
@@ -1458,6 +1432,7 @@
 {
 	PyCodeObject *co;
 	static identifier name;
+	int kw_default_count = 0, arglength;
 	arguments_ty args = e->v.Lambda.args;
 	assert(e->kind == Lambda_kind);
 
@@ -1467,6 +1442,12 @@
 			return 0;
 	}
 
+	if (args->kwonlyargs) {
+		int res = compiler_visit_kwonlydefaults(c, args->kwonlyargs,
+						        args->kw_defaults);
+		if (res < 0) return 0;
+		kw_default_count = res;
+	}
 	if (args->defaults)
 		VISIT_SEQ(c, expr, args->defaults);
 	if (!compiler_enter_scope(c, name, (void *)e, e->lineno))
@@ -1476,6 +1457,7 @@
 	compiler_arguments(c, args);
 	
 	c->u->u_argcount = asdl_seq_LEN(args->args);
+	c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs);
 	VISIT_IN_SCOPE(c, expr, e->v.Lambda.body);
 	ADDOP_IN_SCOPE(c, RETURN_VALUE);
 	co = assemble(c, 1);
@@ -1483,7 +1465,9 @@
 	if (co == NULL)
 		return 0;
 
-	compiler_make_closure(c, co, asdl_seq_LEN(args->defaults));
+	arglength = asdl_seq_LEN(args->defaults);
+	arglength |= kw_default_count << 8;
+	compiler_make_closure(c, co, arglength);
 	Py_DECREF(co);
 
 	return 1;
@@ -1653,6 +1637,8 @@
 compiler_continue(struct compiler *c)
 {
 	static const char LOOP_ERROR_MSG[] = "'continue' not properly in loop";
+	static const char IN_FINALLY_ERROR_MSG[] = 
+			"'continue' not supported inside 'finally' clause";
 	int i;
 
 	if (!c->u->u_nfblocks)
@@ -1664,15 +1650,18 @@
 		break;
 	case EXCEPT:
 	case FINALLY_TRY:
-		while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP)
-			;
+		while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP) {
+			/* Prevent continue anywhere under a finally
+			      even if hidden in a sub-try or except. */
+			if (c->u->u_fblock[i].fb_type == FINALLY_END)
+				return compiler_error(c, IN_FINALLY_ERROR_MSG);
+		}
 		if (i == -1)
 			return compiler_error(c, LOOP_ERROR_MSG);
 		ADDOP_JABS(c, CONTINUE_LOOP, c->u->u_fblock[i].fb_block);
 		break;
 	case FINALLY_END:
-		return compiler_error(c,
-			"'continue' not supported inside 'finally' clause");
+		return compiler_error(c, IN_FINALLY_ERROR_MSG);
 	}
 
 	return 1;
@@ -2015,7 +2004,7 @@
 {
 	int i, n;
 
-    /* Always assign a lineno to the next instruction for a stmt. */
+	/* Always assign a lineno to the next instruction for a stmt. */
 	c->u->u_lineno = s->lineno;
 	c->u->u_lineno_set = false;
 
@@ -2083,21 +2072,6 @@
 		return compiler_import(c, s);
 	case ImportFrom_kind:
 		return compiler_from_import(c, s);
-	case Exec_kind:
-		VISIT(c, expr, s->v.Exec.body);
-		if (s->v.Exec.globals) {
-			VISIT(c, expr, s->v.Exec.globals);
-			if (s->v.Exec.locals) {
-				VISIT(c, expr, s->v.Exec.locals);
-			} else {
-				ADDOP(c, DUP_TOP);
-			}
-		} else {
-			ADDOP_O(c, LOAD_CONST, Py_None, consts);
-			ADDOP(c, DUP_TOP);
-		}
-		ADDOP(c, EXEC_STMT);
-		break;
 	case Global_kind:
 		break;
 	case Expr_kind:
@@ -2114,7 +2088,7 @@
 	case Pass_kind:
 		break;
 	case Break_kind:
-		if (!c->u->u_nfblocks)
+                if (!compiler_in_loop(c))
 			return compiler_error(c, "'break' outside loop");
 		ADDOP(c, BREAK_LOOP);
 		break;
@@ -2468,7 +2442,6 @@
 	}
 	return 1;
 }
-#undef CMPCAST
 
 static int
 compiler_call(struct compiler *c, expr_ty e)
@@ -2568,7 +2541,7 @@
 	} 
 	ADDOP_JABS(c, JUMP_ABSOLUTE, start);
 	compiler_use_next_block(c, anchor);
-	/* delete the append method added to locals */
+	/* delete the temporary list name added to locals */
 	if (gen_index == 1)
 	    if (!compiler_nameop(c, tmpname, Del))
 		return 0;
@@ -2581,15 +2554,9 @@
 {
 	identifier tmp;
 	int rc = 0;
-	static identifier append;
 	asdl_seq *generators = e->v.ListComp.generators;
 
 	assert(e->kind == ListComp_kind);
-	if (!append) {
-		append = PyString_InternFromString("append");
-		if (!append)
-			return 0;
-	}
 	tmp = compiler_new_tmpname(c);
 	if (!tmp)
 		return 0;
@@ -2734,6 +2701,8 @@
 expr_constant(expr_ty e)
 {
 	switch (e->kind) {
+	case Ellipsis_kind:
+		return 1;
 	case Num_kind:
 		return PyObject_IsTrue(e->v.Num.n);
 	case Str_kind:
@@ -2888,9 +2857,9 @@
 {
 	int i, n;
 
-    /* If expr e has a different line number than the last expr/stmt,
-       set a new line number for the next instruction.
-       */
+	/* If expr e has a different line number than the last expr/stmt,
+           set a new line number for the next instruction.
+        */
 	if (e->lineno > c->u->u_lineno) {
 		c->u->u_lineno = e->lineno;
 		c->u->u_lineno_set = false;
@@ -2927,6 +2896,11 @@
 			ADDOP(c, STORE_SUBSCR);
 		}
 		break;
+	case Set_kind:
+		n = asdl_seq_LEN(e->v.Set.elts);
+		VISIT_SEQ(c, expr, e->v.Set.elts);
+		ADDOP_I(c, BUILD_SET, n);
+		break;
 	case ListComp_kind:
 		return compiler_listcomp(c, e);
 	case GeneratorExp_kind:
@@ -2934,14 +2908,6 @@
 	case Yield_kind:
 		if (c->u->u_ste->ste_type != FunctionBlock)
 			return compiler_error(c, "'yield' outside function");
-		/*
-		for (i = 0; i < c->u->u_nfblocks; i++) {
-			if (c->u->u_fblock[i].fb_type == FINALLY_TRY)
-				return compiler_error(
-					c, "'yield' not allowed in a 'try' "
-					"block with a 'finally' clause");
-		}
-		*/
 		if (e->v.Yield.value) {
 			VISIT(c, expr, e->v.Yield.value);
 		}
@@ -2954,16 +2920,15 @@
 		return compiler_compare(c, e);
 	case Call_kind:
 		return compiler_call(c, e);
-	case Repr_kind:
-		VISIT(c, expr, e->v.Repr.value);
-		ADDOP(c, UNARY_CONVERT);
-		break;
 	case Num_kind:
 		ADDOP_O(c, LOAD_CONST, e->v.Num.n, consts);
 		break;
 	case Str_kind:
 		ADDOP_O(c, LOAD_CONST, e->v.Str.s, consts);
 		break;
+	case Ellipsis_kind:
+		ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts);
+		break;
 	/* The following exprs can be assignment targets. */
 	case Attribute_kind:
 		if (e->v.Attribute.ctx != AugStore)
@@ -3080,8 +3045,11 @@
 compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b)
 {
 	struct fblockinfo *f;
-	if (c->u->u_nfblocks >= CO_MAXBLOCKS)
+	if (c->u->u_nfblocks >= CO_MAXBLOCKS) {
+		PyErr_SetString(PyExc_SystemError,
+				"too many statically nested blocks");
 		return 0;
+	}
 	f = &c->u->u_fblock[c->u->u_nfblocks++];
 	f->fb_type = t;
 	f->fb_block = b;
@@ -3098,6 +3066,16 @@
 	assert(u->u_fblock[u->u_nfblocks].fb_block == b);
 }
 
+static int
+compiler_in_loop(struct compiler *c) {
+        int i;
+        struct compiler_unit *u = c->u;
+        for (i = 0; i < u->u_nfblocks; ++i) {
+                if (u->u_fblock[i].fb_type == LOOP)
+                        return 1;
+        }
+        return 0;
+}
 /* Raises a SyntaxError and returns 0.
    If something goes wrong, a different exception may be raised.
 */
@@ -3191,9 +3169,6 @@
 			    expr_context_ty ctx)
 {
 	switch (s->kind) {
-	case Ellipsis_kind:
-		ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts);
-		break;
 	case Slice_kind:
 		return compiler_slice(c, s, ctx);
 	case Index_kind:
@@ -3208,7 +3183,6 @@
 	return 1;
 }
 
-
 static int
 compiler_visit_slice(struct compiler *c, slice_ty s, expr_context_ty ctx)
 {
@@ -3220,12 +3194,6 @@
 			VISIT(c, expr, s->v.Index.value);
 		}
 		break;
-	case Ellipsis_kind:
-		kindname = "ellipsis";
-		if (ctx != AugStore) {
-			ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts);
-		}
-		break;
 	case Slice_kind:
 		kindname = "slice";
 		if (ctx != AugStore) {
@@ -3254,12 +3222,26 @@
 	return compiler_handle_subscr(c, kindname, ctx);
 }
 
+
+/* End of the compiler section, beginning of the assembler section */
+
 /* do depth-first search of basic block graph, starting with block.
    post records the block indices in post-order.
 
    XXX must handle implicit jumps from one block to next
 */
 
+struct assembler {
+	PyObject *a_bytecode;  /* string containing bytecode */
+	int a_offset;	       /* offset into bytecode */
+	int a_nblocks;	       /* number of reachable blocks */
+	basicblock **a_postorder; /* list of blocks in dfs postorder */
+	PyObject *a_lnotab;    /* string containing lnotab */
+	int a_lnotab_off;      /* offset into lnotab */
+	int a_lineno;	       /* last lineno of emitted instruction */
+	int a_lineno_off;      /* bytecode offset of last lineno */
+};
+
 static void
 dfs(struct compiler *c, basicblock *b, struct assembler *a)
 {
@@ -3729,7 +3711,8 @@
 	Py_DECREF(consts);
 	consts = tmp;
 
-	co = PyCode_New(c->u->u_argcount, nlocals, stackdepth(c), flags,
+	co = PyCode_New(c->u->u_argcount, c->u->u_kwonlyargcount,
+			nlocals, stackdepth(c), flags,
 			bytecode, consts, names, varnames,
 			freevars, cellvars,
 			filename, c->u->u_name,

Modified: python/branches/p3yk-noslice/Python/errors.c
==============================================================================
--- python/branches/p3yk-noslice/Python/errors.c	(original)
+++ python/branches/p3yk-noslice/Python/errors.c	Fri Dec 15 05:21:50 2006
@@ -560,7 +560,8 @@
 			goto failure;
 	}
 	if (PyDict_GetItemString(dict, "__module__") == NULL) {
-		modulename = PyString_FromStringAndSize(name, (int)(dot-name));
+		modulename = PyString_FromStringAndSize(name,
+						     (Py_ssize_t)(dot-name));
 		if (modulename == NULL)
 			goto failure;
 		if (PyDict_SetItemString(dict, "__module__", modulename) != 0)

Modified: python/branches/p3yk-noslice/Python/frozen.c
==============================================================================
--- python/branches/p3yk-noslice/Python/frozen.c	(original)
+++ python/branches/p3yk-noslice/Python/frozen.c	Fri Dec 15 05:21:50 2006
@@ -12,13 +12,14 @@
    the appropriate bytes from M___main__.c. */
 
 static unsigned char M___hello__[] = {
-	99,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
-	0,115,9,0,0,0,100,0,0,71,72,100,1,0,83,40,
-	2,0,0,0,115,14,0,0,0,72,101,108,108,111,32,119,
-	111,114,108,100,46,46,46,78,40,0,0,0,0,40,0,0,
-	0,0,40,0,0,0,0,40,0,0,0,0,115,8,0,0,
-	0,104,101,108,108,111,46,112,121,115,1,0,0,0,63,1,
-	0,0,0,115,0,0,0,0,
+        99,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
+        0,64,0,0,0,115,9,0,0,0,100,0,0,71,72,100,
+        1,0,83,40,2,0,0,0,115,14,0,0,0,72,101,108,
+        108,111,32,119,111,114,108,100,46,46,46,78,40,0,0,0,
+        0,40,0,0,0,0,40,0,0,0,0,40,0,0,0,0,
+        115,8,0,0,0,104,101,108,108,111,46,112,121,115,8,0,
+        0,0,60,109,111,100,117,108,101,62,1,0,0,0,115,0,
+        0,0,0,
 };
 
 #define SIZE (int)sizeof(M___hello__)

Modified: python/branches/p3yk-noslice/Python/getargs.c
==============================================================================
--- python/branches/p3yk-noslice/Python/getargs.c	(original)
+++ python/branches/p3yk-noslice/Python/getargs.c	Fri Dec 15 05:21:50 2006
@@ -816,7 +816,7 @@
 #endif
 			else
 				return converterr("string", arg, msgbuf, bufsize);
-			if ((int)strlen(*p) != PyString_Size(arg))
+			if ((Py_ssize_t)strlen(*p) != PyString_Size(arg))
 				return converterr("string without null bytes",
 						  arg, msgbuf, bufsize);
 		}
@@ -883,7 +883,7 @@
 				format++;
 			}
 			else if (*p != NULL &&
-				 (int)strlen(*p) != PyString_Size(arg))
+				 (Py_ssize_t)strlen(*p) != PyString_Size(arg))
 				return converterr(
 					"string without null bytes or None", 
 					arg, msgbuf, bufsize);
@@ -1030,7 +1030,8 @@
 			   PyMem_Free()ing it after usage
 
 			*/
-			if ((int)strlen(PyString_AS_STRING(s)) != size) {
+			if ((Py_ssize_t)strlen(PyString_AS_STRING(s))
+								!= size) {
 				Py_DECREF(s);
 				return converterr(
 					"(encoded string without NULL bytes)",
@@ -1746,7 +1747,7 @@
 /* For type constructors that don't take keyword args
  *
  * Sets a TypeError and returns 0 if the kwds dict is 
- * not emtpy, returns 1 otherwise
+ * not empty, returns 1 otherwise
  */
 int
 _PyArg_NoKeywords(const char *funcname, PyObject *kw)

Modified: python/branches/p3yk-noslice/Python/graminit.c
==============================================================================
--- python/branches/p3yk-noslice/Python/graminit.c	(original)
+++ python/branches/p3yk-noslice/Python/graminit.c	Fri Dec 15 05:21:50 2006
@@ -146,14 +146,16 @@
 	{27, 5},
 	{0, 1},
 };
-static arc arcs_7_2[1] = {
+static arc arcs_7_2[3] = {
 	{19, 6},
+	{27, 7},
+	{0, 2},
 };
 static arc arcs_7_3[1] = {
-	{19, 7},
+	{19, 8},
 };
 static arc arcs_7_4[1] = {
-	{26, 8},
+	{26, 9},
 };
 static arc arcs_7_5[4] = {
 	{24, 1},
@@ -162,30 +164,41 @@
 	{0, 5},
 };
 static arc arcs_7_6[2] = {
-	{27, 9},
+	{27, 7},
 	{0, 6},
 };
-static arc arcs_7_7[1] = {
-	{0, 7},
+static arc arcs_7_7[2] = {
+	{19, 10},
+	{29, 3},
 };
-static arc arcs_7_8[2] = {
-	{27, 5},
+static arc arcs_7_8[1] = {
 	{0, 8},
 };
-static arc arcs_7_9[1] = {
-	{29, 3},
+static arc arcs_7_9[2] = {
+	{27, 5},
+	{0, 9},
+};
+static arc arcs_7_10[3] = {
+	{27, 7},
+	{25, 11},
+	{0, 10},
+};
+static arc arcs_7_11[1] = {
+	{26, 6},
 };
-static state states_7[10] = {
+static state states_7[12] = {
 	{3, arcs_7_0},
 	{3, arcs_7_1},
-	{1, arcs_7_2},
+	{3, 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},
+	{2, arcs_7_7},
+	{1, arcs_7_8},
+	{2, arcs_7_9},
+	{3, arcs_7_10},
+	{1, arcs_7_11},
 };
 static arc arcs_8_0[2] = {
 	{19, 1},
@@ -253,7 +266,7 @@
 	{2, arcs_11_2},
 	{1, arcs_11_3},
 };
-static arc arcs_12_0[9] = {
+static arc arcs_12_0[8] = {
 	{33, 1},
 	{34, 1},
 	{35, 1},
@@ -262,29 +275,28 @@
 	{38, 1},
 	{39, 1},
 	{40, 1},
-	{41, 1},
 };
 static arc arcs_12_1[1] = {
 	{0, 1},
 };
 static state states_12[2] = {
-	{9, arcs_12_0},
+	{8, arcs_12_0},
 	{1, arcs_12_1},
 };
 static arc arcs_13_0[1] = {
 	{9, 1},
 };
 static arc arcs_13_1[3] = {
-	{42, 2},
+	{41, 2},
 	{25, 3},
 	{0, 1},
 };
 static arc arcs_13_2[2] = {
-	{43, 4},
+	{42, 4},
 	{9, 4},
 };
 static arc arcs_13_3[2] = {
-	{43, 5},
+	{42, 5},
 	{9, 5},
 };
 static arc arcs_13_4[1] = {
@@ -303,6 +315,7 @@
 	{2, arcs_13_5},
 };
 static arc arcs_14_0[12] = {
+	{43, 1},
 	{44, 1},
 	{45, 1},
 	{46, 1},
@@ -314,7 +327,6 @@
 	{52, 1},
 	{53, 1},
 	{54, 1},
-	{55, 1},
 };
 static arc arcs_14_1[1] = {
 	{0, 1},
@@ -324,11 +336,11 @@
 	{1, arcs_14_1},
 };
 static arc arcs_15_0[1] = {
-	{56, 1},
+	{55, 1},
 };
 static arc arcs_15_1[3] = {
 	{26, 2},
-	{57, 3},
+	{56, 3},
 	{0, 1},
 };
 static arc arcs_15_2[2] = {
@@ -369,10 +381,10 @@
 	{2, arcs_15_8},
 };
 static arc arcs_16_0[1] = {
-	{58, 1},
+	{57, 1},
 };
 static arc arcs_16_1[1] = {
-	{59, 2},
+	{58, 2},
 };
 static arc arcs_16_2[1] = {
 	{0, 2},
@@ -383,7 +395,7 @@
 	{1, arcs_16_2},
 };
 static arc arcs_17_0[1] = {
-	{60, 1},
+	{59, 1},
 };
 static arc arcs_17_1[1] = {
 	{0, 1},
@@ -393,11 +405,11 @@
 	{1, arcs_17_1},
 };
 static arc arcs_18_0[5] = {
+	{60, 1},
 	{61, 1},
 	{62, 1},
 	{63, 1},
 	{64, 1},
-	{65, 1},
 };
 static arc arcs_18_1[1] = {
 	{0, 1},
@@ -407,7 +419,7 @@
 	{1, arcs_18_1},
 };
 static arc arcs_19_0[1] = {
-	{66, 1},
+	{65, 1},
 };
 static arc arcs_19_1[1] = {
 	{0, 1},
@@ -417,7 +429,7 @@
 	{1, arcs_19_1},
 };
 static arc arcs_20_0[1] = {
-	{67, 1},
+	{66, 1},
 };
 static arc arcs_20_1[1] = {
 	{0, 1},
@@ -427,7 +439,7 @@
 	{1, arcs_20_1},
 };
 static arc arcs_21_0[1] = {
-	{68, 1},
+	{67, 1},
 };
 static arc arcs_21_1[2] = {
 	{9, 2},
@@ -442,7 +454,7 @@
 	{1, arcs_21_2},
 };
 static arc arcs_22_0[1] = {
-	{43, 1},
+	{42, 1},
 };
 static arc arcs_22_1[1] = {
 	{0, 1},
@@ -452,7 +464,7 @@
 	{1, arcs_22_1},
 };
 static arc arcs_23_0[1] = {
-	{69, 1},
+	{68, 1},
 };
 static arc arcs_23_1[2] = {
 	{26, 2},
@@ -485,8 +497,8 @@
 	{1, arcs_23_6},
 };
 static arc arcs_24_0[2] = {
+	{69, 1},
 	{70, 1},
-	{71, 1},
 };
 static arc arcs_24_1[1] = {
 	{0, 1},
@@ -496,10 +508,10 @@
 	{1, arcs_24_1},
 };
 static arc arcs_25_0[1] = {
-	{72, 1},
+	{71, 1},
 };
 static arc arcs_25_1[1] = {
-	{73, 2},
+	{72, 2},
 };
 static arc arcs_25_2[1] = {
 	{0, 2},
@@ -510,30 +522,30 @@
 	{1, arcs_25_2},
 };
 static arc arcs_26_0[1] = {
-	{74, 1},
+	{73, 1},
 };
 static arc arcs_26_1[2] = {
-	{75, 2},
+	{74, 2},
 	{12, 3},
 };
 static arc arcs_26_2[3] = {
-	{75, 2},
+	{74, 2},
 	{12, 3},
-	{72, 4},
+	{71, 4},
 };
 static arc arcs_26_3[1] = {
-	{72, 4},
+	{71, 4},
 };
 static arc arcs_26_4[3] = {
 	{28, 5},
 	{13, 6},
-	{76, 5},
+	{75, 5},
 };
 static arc arcs_26_5[1] = {
 	{0, 5},
 };
 static arc arcs_26_6[1] = {
-	{76, 7},
+	{75, 7},
 };
 static arc arcs_26_7[1] = {
 	{15, 5},
@@ -552,7 +564,7 @@
 	{19, 1},
 };
 static arc arcs_27_1[2] = {
-	{78, 2},
+	{77, 2},
 	{0, 1},
 };
 static arc arcs_27_2[1] = {
@@ -571,7 +583,7 @@
 	{12, 1},
 };
 static arc arcs_28_1[2] = {
-	{78, 2},
+	{77, 2},
 	{0, 1},
 };
 static arc arcs_28_2[1] = {
@@ -587,14 +599,14 @@
 	{1, arcs_28_3},
 };
 static arc arcs_29_0[1] = {
-	{77, 1},
+	{76, 1},
 };
 static arc arcs_29_1[2] = {
 	{27, 2},
 	{0, 1},
 };
 static arc arcs_29_2[2] = {
-	{77, 1},
+	{76, 1},
 	{0, 2},
 };
 static state states_29[3] = {
@@ -603,7 +615,7 @@
 	{2, arcs_29_2},
 };
 static arc arcs_30_0[1] = {
-	{79, 1},
+	{78, 1},
 };
 static arc arcs_30_1[2] = {
 	{27, 0},
@@ -617,7 +629,7 @@
 	{19, 1},
 };
 static arc arcs_31_1[2] = {
-	{75, 0},
+	{74, 0},
 	{0, 1},
 };
 static state states_31[2] = {
@@ -625,7 +637,7 @@
 	{2, arcs_31_1},
 };
 static arc arcs_32_0[1] = {
-	{80, 1},
+	{79, 1},
 };
 static arc arcs_32_1[1] = {
 	{19, 2},
@@ -640,78 +652,82 @@
 	{2, arcs_32_2},
 };
 static arc arcs_33_0[1] = {
-	{81, 1},
+	{80, 1},
 };
 static arc arcs_33_1[1] = {
-	{82, 2},
+	{26, 2},
 };
 static arc arcs_33_2[2] = {
-	{83, 3},
+	{27, 3},
 	{0, 2},
 };
 static arc arcs_33_3[1] = {
 	{26, 4},
 };
-static arc arcs_33_4[2] = {
-	{27, 5},
+static arc arcs_33_4[1] = {
 	{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[5] = {
 	{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},
+	{1, arcs_33_4},
 };
-static arc arcs_34_0[1] = {
+static arc arcs_34_0[7] = {
+	{81, 1},
+	{82, 1},
+	{83, 1},
 	{84, 1},
+	{85, 1},
+	{17, 1},
+	{86, 1},
 };
 static arc arcs_34_1[1] = {
+	{0, 1},
+};
+static state states_34[2] = {
+	{7, arcs_34_0},
+	{1, arcs_34_1},
+};
+static arc arcs_35_0[1] = {
+	{87, 1},
+};
+static arc arcs_35_1[1] = {
 	{26, 2},
 };
-static arc arcs_34_2[2] = {
-	{27, 3},
-	{0, 2},
+static arc arcs_35_2[1] = {
+	{21, 3},
 };
-static arc arcs_34_3[1] = {
-	{26, 4},
+static arc arcs_35_3[1] = {
+	{22, 4},
 };
-static arc arcs_34_4[1] = {
+static arc arcs_35_4[3] = {
+	{88, 1},
+	{89, 5},
 	{0, 4},
 };
-static state states_34[5] = {
-	{1, arcs_34_0},
-	{1, arcs_34_1},
-	{2, arcs_34_2},
-	{1, arcs_34_3},
-	{1, arcs_34_4},
+static arc arcs_35_5[1] = {
+	{21, 6},
 };
-static arc arcs_35_0[7] = {
-	{85, 1},
-	{86, 1},
-	{87, 1},
-	{88, 1},
-	{89, 1},
-	{17, 1},
-	{90, 1},
+static arc arcs_35_6[1] = {
+	{22, 7},
 };
-static arc arcs_35_1[1] = {
-	{0, 1},
+static arc arcs_35_7[1] = {
+	{0, 7},
 };
-static state states_35[2] = {
-	{7, arcs_35_0},
+static state states_35[8] = {
+	{1, arcs_35_0},
 	{1, arcs_35_1},
+	{1, arcs_35_2},
+	{1, arcs_35_3},
+	{3, arcs_35_4},
+	{1, arcs_35_5},
+	{1, arcs_35_6},
+	{1, arcs_35_7},
 };
 static arc arcs_36_0[1] = {
-	{91, 1},
+	{90, 1},
 };
 static arc arcs_36_1[1] = {
 	{26, 2},
@@ -722,9 +738,8 @@
 static arc arcs_36_3[1] = {
 	{22, 4},
 };
-static arc arcs_36_4[3] = {
-	{92, 1},
-	{93, 5},
+static arc arcs_36_4[2] = {
+	{89, 5},
 	{0, 4},
 };
 static arc arcs_36_5[1] = {
@@ -741,323 +756,299 @@
 	{1, arcs_36_1},
 	{1, arcs_36_2},
 	{1, arcs_36_3},
-	{3, arcs_36_4},
+	{2, arcs_36_4},
 	{1, arcs_36_5},
 	{1, arcs_36_6},
 	{1, arcs_36_7},
 };
 static arc arcs_37_0[1] = {
-	{94, 1},
+	{91, 1},
 };
 static arc arcs_37_1[1] = {
-	{26, 2},
+	{58, 2},
 };
 static arc arcs_37_2[1] = {
-	{21, 3},
+	{92, 3},
 };
 static arc arcs_37_3[1] = {
-	{22, 4},
+	{9, 4},
 };
-static arc arcs_37_4[2] = {
-	{93, 5},
-	{0, 4},
+static arc arcs_37_4[1] = {
+	{21, 5},
 };
 static arc arcs_37_5[1] = {
-	{21, 6},
+	{22, 6},
 };
-static arc arcs_37_6[1] = {
-	{22, 7},
+static arc arcs_37_6[2] = {
+	{89, 7},
+	{0, 6},
 };
 static arc arcs_37_7[1] = {
-	{0, 7},
+	{21, 8},
+};
+static arc arcs_37_8[1] = {
+	{22, 9},
+};
+static arc arcs_37_9[1] = {
+	{0, 9},
 };
-static state states_37[8] = {
+static state states_37[10] = {
 	{1, arcs_37_0},
 	{1, arcs_37_1},
 	{1, arcs_37_2},
 	{1, arcs_37_3},
-	{2, arcs_37_4},
+	{1, arcs_37_4},
 	{1, arcs_37_5},
-	{1, arcs_37_6},
+	{2, arcs_37_6},
 	{1, arcs_37_7},
+	{1, arcs_37_8},
+	{1, arcs_37_9},
 };
 static arc arcs_38_0[1] = {
-	{95, 1},
+	{93, 1},
 };
 static arc arcs_38_1[1] = {
-	{59, 2},
+	{21, 2},
 };
 static arc arcs_38_2[1] = {
-	{83, 3},
+	{22, 3},
 };
-static arc arcs_38_3[1] = {
-	{9, 4},
+static arc arcs_38_3[2] = {
+	{94, 4},
+	{95, 5},
 };
 static arc arcs_38_4[1] = {
-	{21, 5},
+	{21, 6},
 };
 static arc arcs_38_5[1] = {
-	{22, 6},
+	{21, 7},
 };
-static arc arcs_38_6[2] = {
-	{93, 7},
-	{0, 6},
+static arc arcs_38_6[1] = {
+	{22, 8},
 };
 static arc arcs_38_7[1] = {
-	{21, 8},
-};
-static arc arcs_38_8[1] = {
 	{22, 9},
 };
+static arc arcs_38_8[4] = {
+	{94, 4},
+	{89, 10},
+	{95, 5},
+	{0, 8},
+};
 static arc arcs_38_9[1] = {
 	{0, 9},
 };
-static state states_38[10] = {
+static arc arcs_38_10[1] = {
+	{21, 11},
+};
+static arc arcs_38_11[1] = {
+	{22, 12},
+};
+static arc arcs_38_12[2] = {
+	{95, 5},
+	{0, 12},
+};
+static state states_38[13] = {
 	{1, arcs_38_0},
 	{1, arcs_38_1},
 	{1, arcs_38_2},
-	{1, arcs_38_3},
+	{2, arcs_38_3},
 	{1, arcs_38_4},
 	{1, arcs_38_5},
-	{2, arcs_38_6},
+	{1, arcs_38_6},
 	{1, arcs_38_7},
-	{1, arcs_38_8},
+	{4, arcs_38_8},
 	{1, arcs_38_9},
+	{1, arcs_38_10},
+	{1, arcs_38_11},
+	{2, arcs_38_12},
 };
 static arc arcs_39_0[1] = {
 	{96, 1},
 };
 static arc arcs_39_1[1] = {
-	{21, 2},
+	{26, 2},
 };
-static arc arcs_39_2[1] = {
-	{22, 3},
+static arc arcs_39_2[2] = {
+	{97, 3},
+	{21, 4},
 };
-static arc arcs_39_3[2] = {
-	{97, 4},
-	{98, 5},
+static arc arcs_39_3[1] = {
+	{21, 4},
 };
 static arc arcs_39_4[1] = {
-	{21, 6},
+	{22, 5},
 };
 static arc arcs_39_5[1] = {
-	{21, 7},
-};
-static arc arcs_39_6[1] = {
-	{22, 8},
-};
-static arc arcs_39_7[1] = {
-	{22, 9},
-};
-static arc arcs_39_8[4] = {
-	{97, 4},
-	{93, 10},
-	{98, 5},
-	{0, 8},
-};
-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},
+	{0, 5},
 };
-static state states_39[13] = {
+static state states_39[6] = {
 	{1, arcs_39_0},
 	{1, arcs_39_1},
-	{1, arcs_39_2},
-	{2, arcs_39_3},
+	{2, arcs_39_2},
+	{1, arcs_39_3},
 	{1, arcs_39_4},
 	{1, arcs_39_5},
-	{1, arcs_39_6},
-	{1, arcs_39_7},
-	{4, 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},
+	{77, 1},
 };
 static arc arcs_40_1[1] = {
-	{26, 2},
-};
-static arc arcs_40_2[2] = {
-	{100, 3},
-	{21, 4},
-};
-static arc arcs_40_3[1] = {
-	{21, 4},
-};
-static arc arcs_40_4[1] = {
-	{22, 5},
+	{98, 2},
 };
-static arc arcs_40_5[1] = {
-	{0, 5},
+static arc arcs_40_2[1] = {
+	{0, 2},
 };
-static state states_40[6] = {
+static state states_40[3] = {
 	{1, arcs_40_0},
 	{1, arcs_40_1},
-	{2, arcs_40_2},
-	{1, arcs_40_3},
-	{1, arcs_40_4},
-	{1, arcs_40_5},
+	{1, arcs_40_2},
 };
 static arc arcs_41_0[1] = {
-	{78, 1},
-};
-static arc arcs_41_1[1] = {
-	{82, 2},
-};
-static arc arcs_41_2[1] = {
-	{0, 2},
-};
-static state states_41[3] = {
-	{1, arcs_41_0},
-	{1, arcs_41_1},
-	{1, arcs_41_2},
-};
-static arc arcs_42_0[1] = {
-	{101, 1},
+	{99, 1},
 };
-static arc arcs_42_1[2] = {
+static arc arcs_41_1[2] = {
 	{26, 2},
 	{0, 1},
 };
-static arc arcs_42_2[2] = {
+static arc arcs_41_2[2] = {
 	{27, 3},
 	{0, 2},
 };
-static arc arcs_42_3[1] = {
+static arc arcs_41_3[1] = {
 	{26, 4},
 };
-static arc arcs_42_4[1] = {
+static arc arcs_41_4[1] = {
 	{0, 4},
 };
-static state states_42[5] = {
-	{1, arcs_42_0},
-	{2, arcs_42_1},
-	{2, arcs_42_2},
-	{1, arcs_42_3},
-	{1, arcs_42_4},
+static state states_41[5] = {
+	{1, arcs_41_0},
+	{2, arcs_41_1},
+	{2, arcs_41_2},
+	{1, arcs_41_3},
+	{1, arcs_41_4},
 };
-static arc arcs_43_0[2] = {
+static arc arcs_42_0[2] = {
 	{3, 1},
 	{2, 2},
 };
-static arc arcs_43_1[1] = {
+static arc arcs_42_1[1] = {
 	{0, 1},
 };
-static arc arcs_43_2[1] = {
-	{102, 3},
+static arc arcs_42_2[1] = {
+	{100, 3},
 };
-static arc arcs_43_3[1] = {
+static arc arcs_42_3[1] = {
 	{6, 4},
 };
-static arc arcs_43_4[2] = {
+static arc arcs_42_4[2] = {
 	{6, 4},
-	{103, 1},
+	{101, 1},
 };
-static state states_43[5] = {
-	{2, arcs_43_0},
-	{1, arcs_43_1},
-	{1, arcs_43_2},
-	{1, arcs_43_3},
-	{2, arcs_43_4},
+static state states_42[5] = {
+	{2, arcs_42_0},
+	{1, arcs_42_1},
+	{1, arcs_42_2},
+	{1, arcs_42_3},
+	{2, arcs_42_4},
 };
-static arc arcs_44_0[1] = {
-	{105, 1},
+static arc arcs_43_0[1] = {
+	{103, 1},
 };
-static arc arcs_44_1[2] = {
+static arc arcs_43_1[2] = {
 	{27, 2},
 	{0, 1},
 };
-static arc arcs_44_2[1] = {
-	{105, 3},
+static arc arcs_43_2[1] = {
+	{103, 3},
 };
-static arc arcs_44_3[2] = {
+static arc arcs_43_3[2] = {
 	{27, 4},
 	{0, 3},
 };
-static arc arcs_44_4[2] = {
-	{105, 3},
+static arc arcs_43_4[2] = {
+	{103, 3},
 	{0, 4},
 };
-static state states_44[5] = {
-	{1, arcs_44_0},
-	{2, arcs_44_1},
-	{1, arcs_44_2},
-	{2, arcs_44_3},
-	{2, arcs_44_4},
+static state states_43[5] = {
+	{1, arcs_43_0},
+	{2, arcs_43_1},
+	{1, arcs_43_2},
+	{2, arcs_43_3},
+	{2, arcs_43_4},
 };
-static arc arcs_45_0[2] = {
-	{106, 1},
-	{107, 1},
+static arc arcs_44_0[2] = {
+	{104, 1},
+	{105, 1},
 };
-static arc arcs_45_1[1] = {
+static arc arcs_44_1[1] = {
 	{0, 1},
 };
-static state states_45[2] = {
-	{2, arcs_45_0},
-	{1, arcs_45_1},
+static state states_44[2] = {
+	{2, arcs_44_0},
+	{1, arcs_44_1},
 };
-static arc arcs_46_0[1] = {
-	{108, 1},
+static arc arcs_45_0[1] = {
+	{106, 1},
 };
-static arc arcs_46_1[2] = {
+static arc arcs_45_1[2] = {
 	{23, 2},
 	{21, 3},
 };
-static arc arcs_46_2[1] = {
+static arc arcs_45_2[1] = {
 	{21, 3},
 };
+static arc arcs_45_3[1] = {
+	{103, 4},
+};
+static arc arcs_45_4[1] = {
+	{0, 4},
+};
+static state states_45[5] = {
+	{1, arcs_45_0},
+	{2, arcs_45_1},
+	{1, arcs_45_2},
+	{1, arcs_45_3},
+	{1, arcs_45_4},
+};
+static arc arcs_46_0[2] = {
+	{104, 1},
+	{107, 2},
+};
+static arc arcs_46_1[2] = {
+	{87, 3},
+	{0, 1},
+};
+static arc arcs_46_2[1] = {
+	{0, 2},
+};
 static arc arcs_46_3[1] = {
-	{105, 4},
+	{104, 4},
 };
 static arc arcs_46_4[1] = {
-	{0, 4},
+	{89, 5},
 };
-static state states_46[5] = {
-	{1, arcs_46_0},
+static arc arcs_46_5[1] = {
+	{26, 2},
+};
+static state states_46[6] = {
+	{2, arcs_46_0},
 	{2, arcs_46_1},
 	{1, arcs_46_2},
 	{1, arcs_46_3},
 	{1, arcs_46_4},
+	{1, arcs_46_5},
 };
-static arc arcs_47_0[2] = {
-	{106, 1},
-	{109, 2},
+static arc arcs_47_0[1] = {
+	{108, 1},
 };
 static arc arcs_47_1[2] = {
-	{91, 3},
+	{109, 0},
 	{0, 1},
 };
-static arc arcs_47_2[1] = {
-	{0, 2},
-};
-static arc arcs_47_3[1] = {
-	{106, 4},
-};
-static arc arcs_47_4[1] = {
-	{93, 5},
-};
-static arc arcs_47_5[1] = {
-	{26, 2},
-};
-static state states_47[6] = {
-	{2, arcs_47_0},
+static state states_47[2] = {
+	{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},
@@ -1070,76 +1061,75 @@
 	{1, arcs_48_0},
 	{2, arcs_48_1},
 };
-static arc arcs_49_0[1] = {
+static arc arcs_49_0[2] = {
 	{112, 1},
+	{113, 2},
 };
-static arc arcs_49_1[2] = {
-	{113, 0},
-	{0, 1},
-};
-static state states_49[2] = {
-	{1, arcs_49_0},
-	{2, arcs_49_1},
+static arc arcs_49_1[1] = {
+	{110, 2},
 };
-static arc arcs_50_0[2] = {
-	{114, 1},
-	{115, 2},
-};
-static arc arcs_50_1[1] = {
-	{112, 2},
-};
-static arc arcs_50_2[1] = {
+static arc arcs_49_2[1] = {
 	{0, 2},
 };
-static state states_50[3] = {
-	{2, arcs_50_0},
-	{1, arcs_50_1},
-	{1, arcs_50_2},
+static state states_49[3] = {
+	{2, arcs_49_0},
+	{1, arcs_49_1},
+	{1, arcs_49_2},
 };
-static arc arcs_51_0[1] = {
-	{82, 1},
+static arc arcs_50_0[1] = {
+	{98, 1},
 };
-static arc arcs_51_1[2] = {
-	{116, 0},
+static arc arcs_50_1[2] = {
+	{114, 0},
 	{0, 1},
 };
-static state states_51[2] = {
-	{1, arcs_51_0},
-	{2, arcs_51_1},
+static state states_50[2] = {
+	{1, arcs_50_0},
+	{2, arcs_50_1},
 };
-static arc arcs_52_0[10] = {
+static arc arcs_51_0[9] = {
+	{115, 1},
+	{116, 1},
 	{117, 1},
 	{118, 1},
 	{119, 1},
 	{120, 1},
-	{121, 1},
-	{122, 1},
-	{123, 1},
-	{83, 1},
-	{114, 2},
-	{124, 3},
+	{92, 1},
+	{112, 2},
+	{121, 3},
 };
-static arc arcs_52_1[1] = {
+static arc arcs_51_1[1] = {
 	{0, 1},
 };
-static arc arcs_52_2[1] = {
-	{83, 1},
+static arc arcs_51_2[1] = {
+	{92, 1},
 };
-static arc arcs_52_3[2] = {
-	{114, 1},
+static arc arcs_51_3[2] = {
+	{112, 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 state states_51[4] = {
+	{9, arcs_51_0},
+	{1, arcs_51_1},
+	{1, arcs_51_2},
+	{2, arcs_51_3},
+};
+static arc arcs_52_0[1] = {
+	{122, 1},
+};
+static arc arcs_52_1[2] = {
+	{123, 0},
+	{0, 1},
+};
+static state states_52[2] = {
+	{1, arcs_52_0},
+	{2, arcs_52_1},
 };
 static arc arcs_53_0[1] = {
-	{125, 1},
+	{124, 1},
 };
 static arc arcs_53_1[2] = {
-	{126, 0},
+	{125, 0},
 	{0, 1},
 };
 static state states_53[2] = {
@@ -1147,10 +1137,10 @@
 	{2, arcs_53_1},
 };
 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] = {
@@ -1158,22 +1148,23 @@
 	{2, arcs_54_1},
 };
 static arc arcs_55_0[1] = {
-	{129, 1},
+	{128, 1},
 };
-static arc arcs_55_1[2] = {
-	{130, 0},
+static arc arcs_55_1[3] = {
+	{129, 0},
+	{56, 0},
 	{0, 1},
 };
 static state states_55[2] = {
 	{1, arcs_55_0},
-	{2, arcs_55_1},
+	{3, arcs_55_1},
 };
 static arc arcs_56_0[1] = {
-	{131, 1},
+	{130, 1},
 };
 static arc arcs_56_1[3] = {
+	{131, 0},
 	{132, 0},
-	{57, 0},
 	{0, 1},
 };
 static state states_56[2] = {
@@ -1183,128 +1174,142 @@
 static arc arcs_57_0[1] = {
 	{133, 1},
 };
-static arc arcs_57_1[3] = {
+static arc arcs_57_1[5] = {
+	{28, 0},
 	{134, 0},
 	{135, 0},
+	{136, 0},
 	{0, 1},
 };
 static state states_57[2] = {
 	{1, arcs_57_0},
-	{3, arcs_57_1},
-};
-static arc arcs_58_0[1] = {
-	{136, 1},
-};
-static arc arcs_58_1[5] = {
-	{28, 0},
-	{137, 0},
-	{138, 0},
-	{139, 0},
-	{0, 1},
+	{5, arcs_57_1},
 };
-static state states_58[2] = {
-	{1, arcs_58_0},
-	{5, arcs_58_1},
-};
-static arc arcs_59_0[4] = {
-	{134, 1},
-	{135, 1},
-	{140, 1},
-	{141, 2},
+static arc arcs_58_0[4] = {
+	{131, 1},
+	{132, 1},
+	{137, 1},
+	{138, 2},
 };
-static arc arcs_59_1[1] = {
-	{136, 2},
+static arc arcs_58_1[1] = {
+	{133, 2},
 };
-static arc arcs_59_2[1] = {
+static arc arcs_58_2[1] = {
 	{0, 2},
 };
-static state states_59[3] = {
-	{4, arcs_59_0},
-	{1, arcs_59_1},
-	{1, arcs_59_2},
+static state states_58[3] = {
+	{4, arcs_58_0},
+	{1, arcs_58_1},
+	{1, arcs_58_2},
 };
-static arc arcs_60_0[1] = {
-	{142, 1},
+static arc arcs_59_0[1] = {
+	{139, 1},
 };
-static arc arcs_60_1[3] = {
-	{143, 1},
+static arc arcs_59_1[3] = {
+	{140, 1},
 	{29, 2},
 	{0, 1},
 };
-static arc arcs_60_2[1] = {
-	{136, 3},
+static arc arcs_59_2[1] = {
+	{133, 3},
 };
-static arc arcs_60_3[1] = {
+static arc arcs_59_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_59[4] = {
+	{1, arcs_59_0},
+	{3, arcs_59_1},
+	{1, arcs_59_2},
+	{1, arcs_59_3},
 };
-static arc arcs_61_0[7] = {
+static arc arcs_60_0[7] = {
 	{13, 1},
-	{145, 2},
-	{148, 3},
-	{151, 4},
-	{19, 5},
-	{153, 5},
-	{154, 6},
-};
-static arc arcs_61_1[3] = {
-	{43, 7},
-	{144, 7},
-	{15, 5},
-};
-static arc arcs_61_2[2] = {
-	{146, 8},
-	{147, 5},
+	{142, 2},
+	{145, 3},
+	{19, 4},
+	{148, 4},
+	{149, 5},
+	{74, 6},
 };
-static arc arcs_61_3[2] = {
-	{149, 9},
-	{150, 5},
+static arc arcs_60_1[3] = {
+	{42, 7},
+	{141, 7},
+	{15, 4},
+};
+static arc arcs_60_2[2] = {
+	{143, 8},
+	{144, 4},
+};
+static arc arcs_60_3[2] = {
+	{146, 9},
+	{147, 4},
 };
-static arc arcs_61_4[1] = {
-	{152, 10},
+static arc arcs_60_4[1] = {
+	{0, 4},
 };
-static arc arcs_61_5[1] = {
+static arc arcs_60_5[2] = {
+	{149, 5},
 	{0, 5},
 };
-static arc arcs_61_6[2] = {
-	{154, 6},
-	{0, 6},
+static arc arcs_60_6[1] = {
+	{74, 10},
 };
-static arc arcs_61_7[1] = {
-	{15, 5},
+static arc arcs_60_7[1] = {
+	{15, 4},
 };
-static arc arcs_61_8[1] = {
-	{147, 5},
+static arc arcs_60_8[1] = {
+	{144, 4},
 };
-static arc arcs_61_9[1] = {
-	{150, 5},
+static arc arcs_60_9[1] = {
+	{147, 4},
 };
-static arc arcs_61_10[1] = {
-	{151, 5},
+static arc arcs_60_10[1] = {
+	{74, 4},
 };
-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 state states_60[11] = {
+	{7, arcs_60_0},
+	{3, arcs_60_1},
+	{2, arcs_60_2},
+	{2, arcs_60_3},
+	{1, arcs_60_4},
+	{2, arcs_60_5},
+	{1, arcs_60_6},
+	{1, arcs_60_7},
+	{1, arcs_60_8},
+	{1, arcs_60_9},
+	{1, arcs_60_10},
+};
+static arc arcs_61_0[1] = {
+	{26, 1},
+};
+static arc arcs_61_1[3] = {
+	{150, 2},
+	{27, 3},
+	{0, 1},
+};
+static arc arcs_61_2[1] = {
+	{0, 2},
+};
+static arc arcs_61_3[2] = {
+	{26, 4},
+	{0, 3},
+};
+static arc arcs_61_4[2] = {
+	{27, 3},
+	{0, 4},
+};
+static state states_61[5] = {
+	{1, arcs_61_0},
+	{3, arcs_61_1},
+	{1, arcs_61_2},
+	{2, arcs_61_3},
+	{2, arcs_61_4},
 };
 static arc arcs_62_0[1] = {
 	{26, 1},
 };
 static arc arcs_62_1[3] = {
-	{155, 2},
+	{151, 2},
 	{27, 3},
 	{0, 1},
 };
@@ -1327,163 +1332,144 @@
 	{2, arcs_62_4},
 };
 static arc arcs_63_0[1] = {
-	{26, 1},
+	{106, 1},
 };
-static arc arcs_63_1[3] = {
-	{156, 2},
-	{27, 3},
-	{0, 1},
+static arc arcs_63_1[2] = {
+	{23, 2},
+	{21, 3},
 };
 static arc arcs_63_2[1] = {
-	{0, 2},
+	{21, 3},
 };
-static arc arcs_63_3[2] = {
+static arc arcs_63_3[1] = {
 	{26, 4},
-	{0, 3},
 };
-static arc arcs_63_4[2] = {
-	{27, 3},
+static arc arcs_63_4[1] = {
 	{0, 4},
 };
 static state states_63[5] = {
 	{1, arcs_63_0},
-	{3, arcs_63_1},
+	{2, arcs_63_1},
 	{1, arcs_63_2},
-	{2, arcs_63_3},
-	{2, arcs_63_4},
+	{1, arcs_63_3},
+	{1, arcs_63_4},
 };
-static arc arcs_64_0[1] = {
-	{108, 1},
+static arc arcs_64_0[3] = {
+	{13, 1},
+	{142, 2},
+	{74, 3},
 };
 static arc arcs_64_1[2] = {
-	{23, 2},
-	{21, 3},
+	{14, 4},
+	{15, 5},
 };
 static arc arcs_64_2[1] = {
-	{21, 3},
+	{152, 6},
 };
 static arc arcs_64_3[1] = {
-	{26, 4},
+	{19, 5},
 };
 static arc arcs_64_4[1] = {
-	{0, 4},
+	{15, 5},
+};
+static arc arcs_64_5[1] = {
+	{0, 5},
+};
+static arc arcs_64_6[1] = {
+	{144, 5},
 };
-static state states_64[5] = {
-	{1, arcs_64_0},
+static state states_64[7] = {
+	{3, arcs_64_0},
 	{2, arcs_64_1},
 	{1, arcs_64_2},
 	{1, arcs_64_3},
 	{1, arcs_64_4},
+	{1, arcs_64_5},
+	{1, arcs_64_6},
 };
-static arc arcs_65_0[3] = {
-	{13, 1},
-	{145, 2},
-	{75, 3},
+static arc arcs_65_0[1] = {
+	{153, 1},
 };
 static arc arcs_65_1[2] = {
-	{14, 4},
-	{15, 5},
-};
-static arc arcs_65_2[1] = {
-	{157, 6},
-};
-static arc arcs_65_3[1] = {
-	{19, 5},
-};
-static arc arcs_65_4[1] = {
-	{15, 5},
-};
-static arc arcs_65_5[1] = {
-	{0, 5},
+	{27, 2},
+	{0, 1},
 };
-static arc arcs_65_6[1] = {
-	{147, 5},
+static arc arcs_65_2[2] = {
+	{153, 1},
+	{0, 2},
 };
-static state states_65[7] = {
-	{3, arcs_65_0},
+static state states_65[3] = {
+	{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},
+	{2, arcs_65_2},
 };
-static arc arcs_66_0[1] = {
-	{158, 1},
+static arc arcs_66_0[2] = {
+	{26, 1},
+	{21, 2},
 };
 static arc arcs_66_1[2] = {
-	{27, 2},
+	{21, 2},
 	{0, 1},
 };
-static arc arcs_66_2[2] = {
-	{158, 1},
+static arc arcs_66_2[3] = {
+	{26, 3},
+	{154, 4},
 	{0, 2},
 };
-static state states_66[3] = {
-	{1, arcs_66_0},
-	{2, arcs_66_1},
-	{2, arcs_66_2},
-};
-static arc arcs_67_0[3] = {
-	{75, 1},
-	{26, 2},
-	{21, 3},
-};
-static arc arcs_67_1[1] = {
-	{75, 4},
+static arc arcs_66_3[2] = {
+	{154, 4},
+	{0, 3},
 };
-static arc arcs_67_2[2] = {
-	{21, 3},
-	{0, 2},
+static arc arcs_66_4[1] = {
+	{0, 4},
 };
-static arc arcs_67_3[3] = {
-	{26, 5},
-	{159, 6},
-	{0, 3},
+static state states_66[5] = {
+	{2, arcs_66_0},
+	{2, arcs_66_1},
+	{3, arcs_66_2},
+	{2, arcs_66_3},
+	{1, arcs_66_4},
 };
-static arc arcs_67_4[1] = {
-	{75, 6},
+static arc arcs_67_0[1] = {
+	{21, 1},
 };
-static arc arcs_67_5[2] = {
-	{159, 6},
-	{0, 5},
+static arc arcs_67_1[2] = {
+	{26, 2},
+	{0, 1},
 };
-static arc arcs_67_6[1] = {
-	{0, 6},
+static arc arcs_67_2[1] = {
+	{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 state states_67[3] = {
+	{1, arcs_67_0},
+	{2, arcs_67_1},
+	{1, arcs_67_2},
 };
 static arc arcs_68_0[1] = {
-	{21, 1},
+	{98, 1},
 };
 static arc arcs_68_1[2] = {
-	{26, 2},
+	{27, 2},
 	{0, 1},
 };
-static arc arcs_68_2[1] = {
+static arc arcs_68_2[2] = {
+	{98, 1},
 	{0, 2},
 };
 static state states_68[3] = {
 	{1, arcs_68_0},
 	{2, arcs_68_1},
-	{1, arcs_68_2},
+	{2, arcs_68_2},
 };
 static arc arcs_69_0[1] = {
-	{82, 1},
+	{26, 1},
 };
 static arc arcs_69_1[2] = {
 	{27, 2},
 	{0, 1},
 };
 static arc arcs_69_2[2] = {
-	{82, 1},
+	{26, 1},
 	{0, 2},
 };
 static state states_69[3] = {
@@ -1494,297 +1480,297 @@
 static arc arcs_70_0[1] = {
 	{26, 1},
 };
-static arc arcs_70_1[2] = {
-	{27, 2},
+static arc arcs_70_1[3] = {
+	{21, 2},
+	{27, 3},
 	{0, 1},
 };
-static arc arcs_70_2[2] = {
-	{26, 1},
-	{0, 2},
-};
-static state states_70[3] = {
-	{1, arcs_70_0},
-	{2, arcs_70_1},
-	{2, arcs_70_2},
+static arc arcs_70_2[1] = {
+	{26, 4},
 };
-static arc arcs_71_0[1] = {
-	{26, 1},
+static arc arcs_70_3[2] = {
+	{26, 5},
+	{0, 3},
 };
-static arc arcs_71_1[1] = {
-	{21, 2},
+static arc arcs_70_4[2] = {
+	{27, 6},
+	{0, 4},
 };
-static arc arcs_71_2[1] = {
-	{26, 3},
+static arc arcs_70_5[2] = {
+	{27, 3},
+	{0, 5},
 };
-static arc arcs_71_3[2] = {
-	{27, 4},
-	{0, 3},
+static arc arcs_70_6[2] = {
+	{26, 7},
+	{0, 6},
 };
-static arc arcs_71_4[2] = {
-	{26, 1},
-	{0, 4},
+static arc arcs_70_7[1] = {
+	{21, 2},
 };
-static state states_71[5] = {
-	{1, arcs_71_0},
-	{1, arcs_71_1},
-	{1, arcs_71_2},
-	{2, arcs_71_3},
-	{2, arcs_71_4},
+static state states_70[8] = {
+	{1, arcs_70_0},
+	{3, arcs_70_1},
+	{1, arcs_70_2},
+	{2, arcs_70_3},
+	{2, arcs_70_4},
+	{2, arcs_70_5},
+	{2, arcs_70_6},
+	{1, arcs_70_7},
 };
-static arc arcs_72_0[1] = {
-	{160, 1},
+static arc arcs_71_0[1] = {
+	{155, 1},
 };
-static arc arcs_72_1[1] = {
+static arc arcs_71_1[1] = {
 	{19, 2},
 };
-static arc arcs_72_2[2] = {
+static arc arcs_71_2[2] = {
 	{13, 3},
 	{21, 4},
 };
-static arc arcs_72_3[2] = {
+static arc arcs_71_3[2] = {
 	{9, 5},
 	{15, 6},
 };
-static arc arcs_72_4[1] = {
+static arc arcs_71_4[1] = {
 	{22, 7},
 };
-static arc arcs_72_5[1] = {
+static arc arcs_71_5[1] = {
 	{15, 6},
 };
-static arc arcs_72_6[1] = {
+static arc arcs_71_6[1] = {
 	{21, 4},
 };
-static arc arcs_72_7[1] = {
+static arc arcs_71_7[1] = {
 	{0, 7},
 };
-static state states_72[8] = {
-	{1, arcs_72_0},
-	{1, arcs_72_1},
-	{2, arcs_72_2},
-	{2, arcs_72_3},
-	{1, arcs_72_4},
-	{1, arcs_72_5},
-	{1, arcs_72_6},
-	{1, arcs_72_7},
+static state states_71[8] = {
+	{1, arcs_71_0},
+	{1, arcs_71_1},
+	{2, arcs_71_2},
+	{2, arcs_71_3},
+	{1, arcs_71_4},
+	{1, arcs_71_5},
+	{1, arcs_71_6},
+	{1, arcs_71_7},
 };
-static arc arcs_73_0[3] = {
-	{161, 1},
+static arc arcs_72_0[3] = {
+	{156, 1},
 	{28, 2},
 	{29, 3},
 };
-static arc arcs_73_1[2] = {
+static arc arcs_72_1[2] = {
 	{27, 4},
 	{0, 1},
 };
-static arc arcs_73_2[1] = {
+static arc arcs_72_2[1] = {
 	{26, 5},
 };
-static arc arcs_73_3[1] = {
+static arc arcs_72_3[1] = {
 	{26, 6},
 };
-static arc arcs_73_4[4] = {
-	{161, 1},
+static arc arcs_72_4[4] = {
+	{156, 1},
 	{28, 2},
 	{29, 3},
 	{0, 4},
 };
-static arc arcs_73_5[2] = {
+static arc arcs_72_5[2] = {
 	{27, 7},
 	{0, 5},
 };
-static arc arcs_73_6[1] = {
+static arc arcs_72_6[1] = {
 	{0, 6},
 };
-static arc arcs_73_7[1] = {
+static arc arcs_72_7[1] = {
 	{29, 3},
 };
-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_6},
-	{1, arcs_73_7},
+static state states_72[8] = {
+	{3, arcs_72_0},
+	{2, arcs_72_1},
+	{1, arcs_72_2},
+	{1, arcs_72_3},
+	{4, arcs_72_4},
+	{2, arcs_72_5},
+	{1, arcs_72_6},
+	{1, arcs_72_7},
 };
-static arc arcs_74_0[1] = {
+static arc arcs_73_0[1] = {
 	{26, 1},
 };
-static arc arcs_74_1[3] = {
-	{156, 2},
+static arc arcs_73_1[3] = {
+	{151, 2},
 	{25, 3},
 	{0, 1},
 };
-static arc arcs_74_2[1] = {
+static arc arcs_73_2[1] = {
 	{0, 2},
 };
-static arc arcs_74_3[1] = {
+static arc arcs_73_3[1] = {
 	{26, 2},
 };
-static state states_74[4] = {
-	{1, arcs_74_0},
-	{3, arcs_74_1},
-	{1, arcs_74_2},
-	{1, arcs_74_3},
+static state states_73[4] = {
+	{1, arcs_73_0},
+	{3, arcs_73_1},
+	{1, arcs_73_2},
+	{1, arcs_73_3},
 };
-static arc arcs_75_0[2] = {
-	{155, 1},
-	{163, 1},
+static arc arcs_74_0[2] = {
+	{150, 1},
+	{158, 1},
 };
-static arc arcs_75_1[1] = {
+static arc arcs_74_1[1] = {
 	{0, 1},
 };
-static state states_75[2] = {
-	{2, arcs_75_0},
-	{1, arcs_75_1},
+static state states_74[2] = {
+	{2, arcs_74_0},
+	{1, arcs_74_1},
 };
-static arc arcs_76_0[1] = {
-	{95, 1},
+static arc arcs_75_0[1] = {
+	{91, 1},
 };
-static arc arcs_76_1[1] = {
-	{59, 2},
+static arc arcs_75_1[1] = {
+	{58, 2},
 };
-static arc arcs_76_2[1] = {
-	{83, 3},
+static arc arcs_75_2[1] = {
+	{92, 3},
 };
-static arc arcs_76_3[1] = {
-	{104, 4},
+static arc arcs_75_3[1] = {
+	{102, 4},
 };
-static arc arcs_76_4[2] = {
-	{162, 5},
+static arc arcs_75_4[2] = {
+	{157, 5},
 	{0, 4},
 };
-static arc arcs_76_5[1] = {
+static arc arcs_75_5[1] = {
 	{0, 5},
 };
-static state states_76[6] = {
-	{1, arcs_76_0},
-	{1, arcs_76_1},
-	{1, arcs_76_2},
-	{1, arcs_76_3},
-	{2, arcs_76_4},
-	{1, arcs_76_5},
+static state states_75[6] = {
+	{1, arcs_75_0},
+	{1, arcs_75_1},
+	{1, arcs_75_2},
+	{1, arcs_75_3},
+	{2, arcs_75_4},
+	{1, arcs_75_5},
 };
-static arc arcs_77_0[1] = {
-	{91, 1},
+static arc arcs_76_0[1] = {
+	{87, 1},
 };
-static arc arcs_77_1[1] = {
-	{105, 2},
+static arc arcs_76_1[1] = {
+	{103, 2},
 };
-static arc arcs_77_2[2] = {
-	{162, 3},
+static arc arcs_76_2[2] = {
+	{157, 3},
 	{0, 2},
 };
-static arc arcs_77_3[1] = {
+static arc arcs_76_3[1] = {
 	{0, 3},
 };
-static state states_77[4] = {
-	{1, arcs_77_0},
-	{1, arcs_77_1},
-	{2, arcs_77_2},
-	{1, arcs_77_3},
+static state states_76[4] = {
+	{1, arcs_76_0},
+	{1, arcs_76_1},
+	{2, arcs_76_2},
+	{1, arcs_76_3},
 };
-static arc arcs_78_0[2] = {
-	{156, 1},
-	{165, 1},
+static arc arcs_77_0[2] = {
+	{151, 1},
+	{160, 1},
 };
-static arc arcs_78_1[1] = {
+static arc arcs_77_1[1] = {
 	{0, 1},
 };
-static state states_78[2] = {
-	{2, arcs_78_0},
-	{1, arcs_78_1},
+static state states_77[2] = {
+	{2, arcs_77_0},
+	{1, arcs_77_1},
 };
-static arc arcs_79_0[1] = {
-	{95, 1},
+static arc arcs_78_0[1] = {
+	{91, 1},
 };
-static arc arcs_79_1[1] = {
-	{59, 2},
+static arc arcs_78_1[1] = {
+	{58, 2},
 };
-static arc arcs_79_2[1] = {
-	{83, 3},
+static arc arcs_78_2[1] = {
+	{92, 3},
 };
-static arc arcs_79_3[1] = {
-	{106, 4},
+static arc arcs_78_3[1] = {
+	{104, 4},
 };
-static arc arcs_79_4[2] = {
-	{164, 5},
+static arc arcs_78_4[2] = {
+	{159, 5},
 	{0, 4},
 };
-static arc arcs_79_5[1] = {
+static arc arcs_78_5[1] = {
 	{0, 5},
 };
-static state states_79[6] = {
-	{1, arcs_79_0},
-	{1, arcs_79_1},
-	{1, arcs_79_2},
-	{1, arcs_79_3},
-	{2, arcs_79_4},
-	{1, arcs_79_5},
+static state states_78[6] = {
+	{1, arcs_78_0},
+	{1, arcs_78_1},
+	{1, arcs_78_2},
+	{1, arcs_78_3},
+	{2, arcs_78_4},
+	{1, arcs_78_5},
 };
-static arc arcs_80_0[1] = {
-	{91, 1},
+static arc arcs_79_0[1] = {
+	{87, 1},
 };
-static arc arcs_80_1[1] = {
-	{105, 2},
+static arc arcs_79_1[1] = {
+	{103, 2},
 };
-static arc arcs_80_2[2] = {
-	{164, 3},
+static arc arcs_79_2[2] = {
+	{159, 3},
 	{0, 2},
 };
-static arc arcs_80_3[1] = {
+static arc arcs_79_3[1] = {
 	{0, 3},
 };
-static state states_80[4] = {
-	{1, arcs_80_0},
-	{1, arcs_80_1},
-	{2, arcs_80_2},
-	{1, arcs_80_3},
+static state states_79[4] = {
+	{1, arcs_79_0},
+	{1, arcs_79_1},
+	{2, arcs_79_2},
+	{1, arcs_79_3},
 };
-static arc arcs_81_0[1] = {
+static arc arcs_80_0[1] = {
 	{26, 1},
 };
-static arc arcs_81_1[2] = {
+static arc arcs_80_1[2] = {
 	{27, 0},
 	{0, 1},
 };
-static state states_81[2] = {
-	{1, arcs_81_0},
-	{2, arcs_81_1},
+static state states_80[2] = {
+	{1, arcs_80_0},
+	{2, arcs_80_1},
 };
-static arc arcs_82_0[1] = {
+static arc arcs_81_0[1] = {
 	{19, 1},
 };
-static arc arcs_82_1[1] = {
+static arc arcs_81_1[1] = {
 	{0, 1},
 };
-static state states_82[2] = {
-	{1, arcs_82_0},
-	{1, arcs_82_1},
+static state states_81[2] = {
+	{1, arcs_81_0},
+	{1, arcs_81_1},
 };
-static arc arcs_83_0[1] = {
-	{167, 1},
+static arc arcs_82_0[1] = {
+	{163, 1},
 };
-static arc arcs_83_1[2] = {
+static arc arcs_82_1[2] = {
 	{9, 2},
 	{0, 1},
 };
-static arc arcs_83_2[1] = {
+static arc arcs_82_2[1] = {
 	{0, 2},
 };
-static state states_83[3] = {
-	{1, arcs_83_0},
-	{2, arcs_83_1},
-	{1, arcs_83_2},
+static state states_82[3] = {
+	{1, arcs_82_0},
+	{2, arcs_82_1},
+	{1, arcs_82_2},
 };
-static dfa dfas[84] = {
+static dfa dfas[83] = {
 	{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\014\000\000\000\200\012\236\206\201\054\001\004\001\000\030\102\062\010\010"},
 	{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\014\000\000\000\200\012\236\206\201\054\001\004\001\000\030\102\062\010\010"},
 	{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\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\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"},
 	{260, "decorators", 0, 2, states_4,
@@ -1793,46 +1779,46 @@
 	 "\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,
+	{263, "varargslist", 0, 12, 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"},
+	 "\000\050\014\000\000\000\200\012\236\206\201\054\001\004\001\000\030\102\062\010\010"},
 	{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"},
+	 "\000\040\010\000\000\000\200\012\236\206\001\000\000\004\001\000\030\102\062\000\010"},
 	{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"},
+	 "\000\040\010\000\000\000\200\012\236\206\001\000\000\004\001\000\030\102\062\000\010"},
 	{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"},
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\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"},
+	 "\000\000\000\000\000\370\177\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"},
+	 "\000\000\000\000\000\000\200\000\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"},
+	 "\000\000\000\000\000\000\000\002\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"},
+	 "\000\000\000\000\000\000\000\010\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"},
+	 "\000\000\000\000\000\000\000\000\036\000\000\000\000\000\000\000\000\000\000\000\010"},
 	{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"},
+	 "\000\000\000\000\000\000\000\000\002\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"},
+	 "\000\000\000\000\000\000\000\000\004\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"},
+	 "\000\000\000\000\000\000\000\000\010\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"},
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"},
 	{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"},
+	 "\000\000\000\000\000\000\000\000\020\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"},
+	 "\000\000\000\000\000\000\000\000\200\002\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"},
+	 "\000\000\000\000\000\000\000\000\200\000\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"},
+	 "\000\000\000\000\000\000\000\000\000\002\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,
@@ -1844,126 +1830,124 @@
 	{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\200\000\000\000\000\000\000\000\000\000\000\000"},
+	{289, "assert_stmt", 0, 5, states_33,
 	 "\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,
+	{290, "compound_stmt", 0, 2, states_34,
+	 "\000\010\004\000\000\000\000\000\000\000\200\054\001\000\000\000\000\000\000\010\000"},
+	{291, "if_stmt", 0, 8, states_35,
+	 "\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
+	{292, "while_stmt", 0, 8, states_36,
+	 "\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000"},
+	{293, "for_stmt", 0, 10, states_37,
 	 "\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,
+	{294, "try_stmt", 0, 13, states_38,
+	 "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
+	{295, "with_stmt", 0, 6, 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,
+	{296, "with_var", 0, 3, states_40,
+	 "\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000"},
+	{297, "except_clause", 0, 5, states_41,
 	 "\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,
+	{298, "suite", 0, 5, states_42,
+	 "\004\040\010\000\000\000\200\012\236\206\001\000\000\004\001\000\030\102\062\000\010"},
+	{299, "testlist_safe", 0, 5, states_43,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{300, "old_test", 0, 2, states_44,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{301, "old_lambdef", 0, 5, states_45,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000"},
+	{302, "test", 0, 6, states_46,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{303, "or_test", 0, 2, states_47,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\001\000\030\102\062\000\000"},
+	{304, "and_test", 0, 2, states_48,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\001\000\030\102\062\000\000"},
+	{305, "not_test", 0, 3, states_49,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\001\000\030\102\062\000\000"},
+	{306, "comparison", 0, 2, states_50,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{307, "comp_op", 0, 4, states_51,
+	 "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\371\003\000\000\000\000\000"},
+	{308, "expr", 0, 2, states_52,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{309, "xor_expr", 0, 2, states_53,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{310, "and_expr", 0, 2, states_54,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{311, "shift_expr", 0, 2, states_55,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{312, "arith_expr", 0, 2, states_56,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{313, "term", 0, 2, states_57,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{314, "factor", 0, 3, states_58,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{315, "power", 0, 4, states_59,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\000\100\062\000\000"},
+	{316, "atom", 0, 11, states_60,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\000\100\062\000\000"},
+	{317, "listmaker", 0, 5, states_61,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{318, "testlist_gexp", 0, 5, states_62,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{319, "lambdef", 0, 5, states_63,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000"},
+	{320, "trailer", 0, 7, states_64,
+	 "\000\040\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\100\000\000\000"},
+	{321, "subscriptlist", 0, 3, states_65,
+	 "\000\040\050\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{322, "subscript", 0, 5, states_66,
+	 "\000\040\050\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{323, "sliceop", 0, 3, states_67,
 	 "\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,
+	{324, "exprlist", 0, 3, states_68,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
+	{325, "testlist", 0, 3, states_69,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{326, "dictsetmaker", 0, 8, states_70,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{327, "classdef", 0, 8, states_71,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000"},
+	{328, "arglist", 0, 8, states_72,
+	 "\000\040\010\060\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{329, "argument", 0, 4, states_73,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{330, "list_iter", 0, 2, states_74,
+	 "\000\000\000\000\000\000\000\000\000\000\200\010\000\000\000\000\000\000\000\000\000"},
+	{331, "list_for", 0, 6, states_75,
 	 "\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,
+	{332, "list_if", 0, 4, states_76,
+	 "\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
+	{333, "gen_iter", 0, 2, states_77,
+	 "\000\000\000\000\000\000\000\000\000\000\200\010\000\000\000\000\000\000\000\000\000"},
+	{334, "gen_for", 0, 6, states_78,
 	 "\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,
+	{335, "gen_if", 0, 4, states_79,
+	 "\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
+	{336, "testlist1", 0, 2, states_80,
+	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	{337, "encoding_decl", 0, 2, states_81,
 	 "\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"},
+	{338, "yield_expr", 0, 3, states_82,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"},
 };
-static label labels[168] = {
+static label labels[164] = {
 	{0, "EMPTY"},
 	{256, 0},
 	{4, 0},
 	{267, 0},
-	{291, 0},
+	{290, 0},
 	{257, 0},
 	{266, 0},
 	{0, 0},
 	{258, 0},
-	{326, 0},
+	{325, 0},
 	{259, 0},
 	{50, 0},
 	{287, 0},
 	{7, 0},
-	{329, 0},
+	{328, 0},
 	{8, 0},
 	{260, 0},
 	{261, 0},
@@ -1971,11 +1955,11 @@
 	{1, 0},
 	{262, 0},
 	{11, 0},
-	{299, 0},
+	{298, 0},
 	{263, 0},
 	{264, 0},
 	{22, 0},
-	{303, 0},
+	{302, 0},
 	{12, 0},
 	{16, 0},
 	{36, 0},
@@ -1990,9 +1974,8 @@
 	{280, 0},
 	{288, 0},
 	{289, 0},
-	{290, 0},
 	{270, 0},
-	{339, 0},
+	{338, 0},
 	{37, 0},
 	{38, 0},
 	{39, 0},
@@ -2008,7 +1991,7 @@
 	{1, "print"},
 	{35, 0},
 	{1, "del"},
-	{325, 0},
+	{324, 0},
 	{1, "pass"},
 	{275, 0},
 	{276, 0},
@@ -2030,97 +2013,94 @@
 	{1, "as"},
 	{284, 0},
 	{1, "global"},
-	{1, "exec"},
-	{309, 0},
-	{1, "in"},
 	{1, "assert"},
+	{291, 0},
 	{292, 0},
 	{293, 0},
 	{294, 0},
 	{295, 0},
-	{296, 0},
-	{328, 0},
+	{327, 0},
 	{1, "if"},
 	{1, "elif"},
 	{1, "else"},
 	{1, "while"},
 	{1, "for"},
+	{1, "in"},
 	{1, "try"},
-	{298, 0},
+	{297, 0},
 	{1, "finally"},
 	{1, "with"},
-	{297, 0},
+	{296, 0},
+	{308, 0},
 	{1, "except"},
 	{5, 0},
 	{6, 0},
+	{299, 0},
 	{300, 0},
+	{303, 0},
 	{301, 0},
-	{304, 0},
-	{302, 0},
 	{1, "lambda"},
-	{320, 0},
-	{305, 0},
+	{319, 0},
+	{304, 0},
 	{1, "or"},
-	{306, 0},
+	{305, 0},
 	{1, "and"},
 	{1, "not"},
+	{306, 0},
 	{307, 0},
-	{308, 0},
 	{20, 0},
 	{21, 0},
 	{28, 0},
 	{31, 0},
 	{30, 0},
 	{29, 0},
-	{29, 0},
 	{1, "is"},
-	{310, 0},
+	{309, 0},
 	{18, 0},
-	{311, 0},
+	{310, 0},
 	{33, 0},
-	{312, 0},
+	{311, 0},
 	{19, 0},
-	{313, 0},
+	{312, 0},
 	{34, 0},
-	{314, 0},
+	{313, 0},
 	{14, 0},
 	{15, 0},
-	{315, 0},
+	{314, 0},
 	{17, 0},
 	{24, 0},
 	{48, 0},
 	{32, 0},
+	{315, 0},
 	{316, 0},
-	{317, 0},
-	{321, 0},
-	{319, 0},
-	{9, 0},
+	{320, 0},
 	{318, 0},
+	{9, 0},
+	{317, 0},
 	{10, 0},
 	{26, 0},
-	{327, 0},
+	{326, 0},
 	{27, 0},
-	{25, 0},
-	{337, 0},
 	{2, 0},
 	{3, 0},
-	{332, 0},
-	{335, 0},
+	{331, 0},
+	{334, 0},
+	{321, 0},
 	{322, 0},
 	{323, 0},
-	{324, 0},
 	{1, "class"},
+	{329, 0},
 	{330, 0},
-	{331, 0},
+	{332, 0},
 	{333, 0},
-	{334, 0},
+	{335, 0},
 	{336, 0},
-	{338, 0},
+	{337, 0},
 	{1, "yield"},
 };
 grammar _PyParser_Grammar = {
-	84,
+	83,
 	dfas,
-	{168, labels},
+	{164, labels},
 	256
 };

Modified: python/branches/p3yk-noslice/Python/import.c
==============================================================================
--- python/branches/p3yk-noslice/Python/import.c	(original)
+++ python/branches/p3yk-noslice/Python/import.c	Fri Dec 15 05:21:50 2006
@@ -64,10 +64,15 @@
        Python 2.5b3: 62111 (fix wrong code: x += yield)
        Python 2.5c1: 62121 (fix wrong lnotab with for loops and
        			    storing constants that should have been removed)
+       Python 2.5c2: 62131 (fix wrong code: for x, in ... in listcomp/genexp)
+       Python 2.6a0: 62141 (peephole optimizations)
        Python 3000:   3000
+       	              3010 (removed UNARY_CONVERT)
+		      3020 (added BUILD_SET)
+		      3030 (added keyword-only parameters)
 .
 */
-#define MAGIC (3000 | ((long)'\r'<<16) | ((long)'\n'<<24))
+#define MAGIC (3030 | ((long)'\r'<<16) | ((long)'\n'<<24))
 
 /* Magic word as global; note that _PyImport_Init() can change the
    value of this global to accommodate for alterations of how the
@@ -796,14 +801,16 @@
 {
 	PyCodeObject *co = NULL;
 	mod_ty mod;
-        PyArena *arena = PyArena_New();
+	PyArena *arena = PyArena_New();
+	if (arena == NULL)
+		return NULL;
 
 	mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, 0, 
 				   NULL, arena);
 	if (mod) {
 		co = PyAST_Compile(mod, pathname, NULL, arena);
 	}
-        PyArena_Free(arena);
+	PyArena_Free(arena);
 	return co;
 }
 
@@ -1027,7 +1034,7 @@
 
 /* Return an importer object for a sys.path/pkg.__path__ item 'p',
    possibly by fetching it from the path_importer_cache dict. If it
-   wasn't yet cached, traverse path_hooks until it a hook is found
+   wasn't yet cached, traverse path_hooks until a hook is found
    that can handle the path item. Return None if no hook could;
    this tells our caller it should fall back to the builtin
    import mechanism. Cache the result in path_importer_cache.
@@ -1799,7 +1806,7 @@
 
 
 /* Initialize a built-in module.
-   Return 1 for succes, 0 if the module is not found, and -1 with
+   Return 1 for success, 0 if the module is not found, and -1 with
    an exception set if the initialization failed. */
 
 static int
@@ -2114,7 +2121,7 @@
 		size_t len;
 		if (lastdot == NULL && level > 0) {
 			PyErr_SetString(PyExc_ValueError,
-					"Relative importpath too deep");
+				"Attempted relative import in non-package");
 			return NULL;
 		}
 		if (lastdot == NULL)
@@ -2133,7 +2140,8 @@
 		char *dot = strrchr(buf, '.');
 		if (dot == NULL) {
 			PyErr_SetString(PyExc_ValueError,
-					"Relative importpath too deep");
+				"Attempted relative import beyond "
+				"toplevel package");
 			return NULL;
 		}
 		*dot = '\0';

Modified: python/branches/p3yk-noslice/Python/marshal.c
==============================================================================
--- python/branches/p3yk-noslice/Python/marshal.c	(original)
+++ python/branches/p3yk-noslice/Python/marshal.c	Fri Dec 15 05:21:50 2006
@@ -349,6 +349,7 @@
 		PyCodeObject *co = (PyCodeObject *)v;
 		w_byte(TYPE_CODE, p);
 		w_long(co->co_argcount, p);
+		w_long(co->co_kwonlyargcount, p);
 		w_long(co->co_nlocals, p);
 		w_long(co->co_stacksize, p);
 		w_long(co->co_flags, p);
@@ -546,6 +547,11 @@
 			int size;
 			PyLongObject *ob;
 			n = r_long(p);
+			if (n < -INT_MAX || n > INT_MAX) {
+				PyErr_SetString(PyExc_ValueError,
+						"bad marshal data");
+				return NULL;
+			}
 			size = n<0 ? -n : n;
 			ob = _PyLong_New(size);
 			if (ob == NULL)
@@ -654,7 +660,7 @@
 	case TYPE_INTERNED:
 	case TYPE_STRING:
 		n = r_long(p);
-		if (n < 0) {
+		if (n < 0 || n > INT_MAX) {
 			PyErr_SetString(PyExc_ValueError, "bad marshal data");
 			return NULL;
 		}
@@ -689,7 +695,7 @@
 		char *buffer;
 
 		n = r_long(p);
-		if (n < 0) {
+		if (n < 0 || n > INT_MAX) {
 			PyErr_SetString(PyExc_ValueError, "bad marshal data");
 			return NULL;
 		}
@@ -710,7 +716,7 @@
 
 	case TYPE_TUPLE:
 		n = r_long(p);
-		if (n < 0) {
+		if (n < 0 || n > INT_MAX) {
 			PyErr_SetString(PyExc_ValueError, "bad marshal data");
 			return NULL;
 		}
@@ -733,7 +739,7 @@
 
 	case TYPE_LIST:
 		n = r_long(p);
-		if (n < 0) {
+		if (n < 0 || n > INT_MAX) {
 			PyErr_SetString(PyExc_ValueError, "bad marshal data");
 			return NULL;
 		}
@@ -815,6 +821,7 @@
 		}
 		else {
 			int argcount;
+			int kwonlyargcount;
 			int nlocals;
 			int stacksize;
 			int flags;
@@ -831,10 +838,12 @@
 			
 			v = NULL;
 
-			argcount = r_long(p);
-			nlocals = r_long(p);
-			stacksize = r_long(p);
-			flags = r_long(p);
+                        /* XXX ignore long->int overflows for now */
+			argcount = (int)r_long(p);
+			kwonlyargcount = (int)r_long(p);
+			nlocals = (int)r_long(p);
+			stacksize = (int)r_long(p);
+			flags = (int)r_long(p);
 			code = r_object(p);
 			if (code == NULL)
 				goto code_error;
@@ -859,13 +868,14 @@
 			name = r_object(p);
 			if (name == NULL)
 				goto code_error;
-			firstlineno = r_long(p);
+			firstlineno = (int)r_long(p);
 			lnotab = r_object(p);
 			if (lnotab == NULL)
 				goto code_error;
 
 			v = (PyObject *) PyCode_New(
-					argcount, nlocals, stacksize, flags,
+					argcount, kwonlyargcount,
+					nlocals, stacksize, flags,
 					code, consts, names, varnames,
 					freevars, cellvars, filename, name,
 					firstlineno, lnotab);
@@ -1031,10 +1041,16 @@
 	wf.strings = (version > 0) ? PyDict_New() : NULL;
 	w_object(x, &wf);
 	Py_XDECREF(wf.strings);
-	if (wf.str != NULL)
-		_PyString_Resize(&wf.str,
-		    (int) (wf.ptr -
-			   PyString_AS_STRING((PyStringObject *)wf.str)));
+	if (wf.str != NULL) {
+		char *base = PyString_AS_STRING((PyStringObject *)wf.str);
+		if (wf.ptr - base > PY_SSIZE_T_MAX) {
+			Py_DECREF(wf.str);
+			PyErr_SetString(PyExc_OverflowError,
+					"too much marshall data for a string");
+			return NULL;
+		}
+		_PyString_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base));
+	}
 	if (wf.error) {
 		Py_XDECREF(wf.str);
 		PyErr_SetString(PyExc_ValueError,

Modified: python/branches/p3yk-noslice/Python/modsupport.c
==============================================================================
--- python/branches/p3yk-noslice/Python/modsupport.c	(original)
+++ python/branches/p3yk-noslice/Python/modsupport.c	Fri Dec 15 05:21:50 2006
@@ -421,7 +421,7 @@
 							"string too long for Python string");
 						return NULL;
 					}
-					n = (int)m;
+					n = (Py_ssize_t)m;
 				}
 				v = PyString_FromStringAndSize(str, n);
 			}

Modified: python/branches/p3yk-noslice/Python/mystrtoul.c
==============================================================================
--- python/branches/p3yk-noslice/Python/mystrtoul.c	(original)
+++ python/branches/p3yk-noslice/Python/mystrtoul.c	Fri Dec 15 05:21:50 2006
@@ -195,13 +195,10 @@
 	return (unsigned long)-1;
 }
 
-/* Checking for overflow in PyOS_strtol is a PITA since C doesn't define
- * anything about what happens when a signed integer operation overflows,
- * and some compilers think they're doing you a favor by being "clever"
- * then.  Python assumes a 2's-complement representation, so that the bit
- * pattern for the largest postive signed long is LONG_MAX, and for
- * the smallest negative signed long is LONG_MAX + 1.
+/* Checking for overflow in PyOS_strtol is a PITA; see comments
+ * about PY_ABS_LONG_MIN in longobject.c.
  */
+#define PY_ABS_LONG_MIN		(0-(unsigned long)LONG_MIN)
 
 long
 PyOS_strtol(char *str, char **ptr, int base)
@@ -224,8 +221,7 @@
 		if (sign == '-')
 			result = -result;
 	}
-	else if (sign == '-' && uresult == (unsigned long)LONG_MAX + 1) {
-		assert(LONG_MIN == -LONG_MAX-1);
+	else if (sign == '-' && uresult == PY_ABS_LONG_MIN) {
 		result = LONG_MIN;
 	}
 	else {

Modified: python/branches/p3yk-noslice/Python/peephole.c
==============================================================================
--- python/branches/p3yk-noslice/Python/peephole.c	(original)
+++ python/branches/p3yk-noslice/Python/peephole.c	Fri Dec 15 05:21:50 2006
@@ -189,9 +189,6 @@
 			if (PyObject_IsTrue(v) == 1)
 				newconst = PyNumber_Negative(v);
 			break;
-		case UNARY_CONVERT:
-			newconst = PyObject_Repr(v);
-			break;
 		case UNARY_INVERT:
 			newconst = PyNumber_Invert(v);
 			break;
@@ -470,7 +467,6 @@
 				/* Fold unary ops on constants.
 				   LOAD_CONST c1  UNARY_OP -->	LOAD_CONST unary_op(c) */
 			case UNARY_NEGATIVE:
-			case UNARY_CONVERT:
 			case UNARY_INVERT:
 				if (lastlc >= 1	 &&
 				    ISBASICBLOCK(blocks, i-3, 4)  &&
@@ -518,6 +514,13 @@
 			case SETUP_EXCEPT:
 			case SETUP_FINALLY:
 				tgt = GETJUMPTGT(codestr, i);
+				/* Replace JUMP_* to a RETURN into just a RETURN */
+				if (UNCONDITIONAL_JUMP(opcode) &&
+				    codestr[tgt] == RETURN_VALUE) {
+					codestr[i] = RETURN_VALUE;
+					memset(codestr+i+1, NOP, 2);
+					continue;
+				}
 				if (!UNCONDITIONAL_JUMP(codestr[tgt]))
 					continue;
 				tgttgt = GETJUMPTGT(codestr, tgt);
@@ -535,12 +538,16 @@
 				goto exitUnchanged;
 
 				/* Replace RETURN LOAD_CONST None RETURN with just RETURN */
+				/* Remove unreachable JUMPs after RETURN */
 			case RETURN_VALUE:
-				if (i+4 >= codelen  ||
-				    codestr[i+4] != RETURN_VALUE	 ||
-				    !ISBASICBLOCK(blocks,i,5))
+				if (i+4 >= codelen)
 					continue;
-				memset(codestr+i+1, NOP, 4);
+				if (codestr[i+4] == RETURN_VALUE &&
+				    ISBASICBLOCK(blocks,i,5))
+					memset(codestr+i+1, NOP, 4);
+				else if (UNCONDITIONAL_JUMP(codestr[i+1]) &&
+				         ISBASICBLOCK(blocks,i,4))
+					memset(codestr+i+1, NOP, 3);
 				break;
 		}
 	}

Modified: python/branches/p3yk-noslice/Python/pystate.c
==============================================================================
--- python/branches/p3yk-noslice/Python/pystate.c	(original)
+++ python/branches/p3yk-noslice/Python/pystate.c	Fri Dec 15 05:21:50 2006
@@ -309,9 +309,14 @@
 	*/
 #if defined(Py_DEBUG) && defined(WITH_THREAD)
 	if (newts) {
+		/* This can be called from PyEval_RestoreThread(). Similar
+		   to it, we need to ensure errno doesn't change.
+		*/
+		int err = errno;
 		PyThreadState *check = PyGILState_GetThisThreadState();
 		if (check && check->interp == newts->interp && check != newts)
 			Py_FatalError("Invalid thread state for this thread");
+		errno = err;
 	}
 #endif
 	return oldts;
@@ -496,7 +501,7 @@
 {
 	PyThread_delete_key(autoTLSkey);
 	autoTLSkey = 0;
-	autoInterpreterState = NULL;;
+	autoInterpreterState = NULL;
 }
 
 /* When a thread state is created for a thread by some mechanism other than
@@ -504,7 +509,7 @@
    it so it doesn't try to create another thread state for the thread (this is
    a better fix for SF bug #1010677 than the first one attempted).
 */
-void
+static void
 _PyGILState_NoteThreadState(PyThreadState* tstate)
 {
 	/* If autoTLSkey is 0, this must be the very first threadstate created

Modified: python/branches/p3yk-noslice/Python/pythonrun.c
==============================================================================
--- python/branches/p3yk-noslice/Python/pythonrun.c	(original)
+++ python/branches/p3yk-noslice/Python/pythonrun.c	Fri Dec 15 05:21:50 2006
@@ -527,11 +527,15 @@
 	bimod = _PyImport_FindExtension("__builtin__", "__builtin__");
 	if (bimod != NULL) {
 		interp->builtins = PyModule_GetDict(bimod);
+		if (interp->builtins == NULL)
+			goto handle_error;
 		Py_INCREF(interp->builtins);
 	}
 	sysmod = _PyImport_FindExtension("sys", "sys");
 	if (bimod != NULL && sysmod != NULL) {
 		interp->sysdict = PyModule_GetDict(sysmod);
+		if (interp->sysdict == NULL)
+			goto handle_error;
 		Py_INCREF(interp->sysdict);
 		PySys_SetPath(Py_GetPath());
 		PyDict_SetItemString(interp->sysdict, "modules",
@@ -545,6 +549,7 @@
 	if (!PyErr_Occurred())
 		return tstate;
 
+handle_error:
 	/* Oops, it didn't work.  Undo it all. */
 
 	PyErr_Print();
@@ -718,6 +723,15 @@
 	((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \
 		      PyPARSE_DONT_IMPLY_DEDENT : 0)) : 0)
 
+#if 0
+/* Keep an example of flags with future keyword support. */
+#define PARSER_FLAGS(flags) \
+	((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \
+		      PyPARSE_DONT_IMPLY_DEDENT : 0) \
+		    | ((flags)->cf_flags & CO_FUTURE_WITH_STATEMENT ? \
+		       PyPARSE_WITH_IS_KEYWORD : 0)) : 0)
+#endif
+
 int
 PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
 {

Modified: python/branches/p3yk-noslice/Python/structmember.c
==============================================================================
--- python/branches/p3yk-noslice/Python/structmember.c	(original)
+++ python/branches/p3yk-noslice/Python/structmember.c	Fri Dec 15 05:21:50 2006
@@ -62,29 +62,28 @@
 	addr += l->offset;
 	switch (l->type) {
 	case T_BYTE:
-		v = PyInt_FromLong(
-			(long) (((*(char*)addr & 0xff) ^ 0x80) - 0x80));
+		v = PyInt_FromLong(*(char*)addr);
 		break;
 	case T_UBYTE:
-		v = PyInt_FromLong((long) *(char*)addr & 0xff);
+		v = PyLong_FromUnsignedLong(*(unsigned char*)addr);
 		break;
 	case T_SHORT:
-		v = PyInt_FromLong((long) *(short*)addr);
+		v = PyInt_FromLong(*(short*)addr);
 		break;
 	case T_USHORT:
-		v = PyInt_FromLong((long) *(unsigned short*)addr);
+		v = PyLong_FromUnsignedLong(*(unsigned short*)addr);
 		break;
 	case T_INT:
-		v = PyInt_FromLong((long) *(int*)addr);
+		v = PyInt_FromLong(*(int*)addr);
 		break;
 	case T_UINT:
-		v = PyInt_FromLong((long) *(unsigned int*)addr);
+		v = PyLong_FromUnsignedLong(*(unsigned int*)addr);
 		break;
 	case T_LONG:
 		v = PyInt_FromLong(*(long*)addr);
 		break;
 	case T_ULONG:
-		v = PyLong_FromDouble((double) *(unsigned long*)addr);
+		v = PyLong_FromUnsignedLong(*(unsigned long*)addr);
 		break;
 	case T_FLOAT:
 		v = PyFloat_FromDouble((double)*(float*)addr);
@@ -179,68 +178,107 @@
 	}
 	addr += l->offset;
 	switch (l->type) {
-	case T_BYTE:
-	case T_UBYTE:
-		if (!PyInt_Check(v)) {
-			PyErr_BadArgument();
+	case T_BYTE:{
+		long long_val;
+		long_val = PyInt_AsLong(v);
+		if ((long_val == -1) && PyErr_Occurred())
 			return -1;
-		}
-		*(char*)addr = (char) PyInt_AsLong(v);
+		/* XXX: For compatibility, only warn about truncations
+		   for now. */
+		if ((long_val > CHAR_MAX) || (long_val < CHAR_MIN))
+			PyErr_Warn(PyExc_RuntimeWarning, "Truncation of value to char");
+		*(char*)addr = (char)long_val;
 		break;
-	case T_SHORT:
-	case T_USHORT:
-		if (!PyInt_Check(v)) {
-			PyErr_BadArgument();
-			return -1;
 		}
-		*(short*)addr = (short) PyInt_AsLong(v);
-		break;
-	case T_UINT:
-	case T_INT:
-		if (!PyInt_Check(v)) {
-			PyErr_BadArgument();
+	case T_UBYTE:{
+		long long_val;
+		long_val = PyInt_AsLong(v);
+		if ((long_val == -1) && PyErr_Occurred())
 			return -1;
-		}
-		*(int*)addr = (int) PyInt_AsLong(v);
+		if ((long_val > UCHAR_MAX) || (long_val < 0))
+			PyErr_Warn(PyExc_RuntimeWarning, "Truncation of value to unsigned char");
+		*(unsigned char*)addr = (unsigned char)long_val;
 		break;
-	case T_LONG:
-		if (!PyInt_Check(v)) {
-			PyErr_BadArgument();
+		}
+	case T_SHORT:{
+		long long_val;
+		long_val = PyInt_AsLong(v);
+		if ((long_val == -1) && PyErr_Occurred())
 			return -1;
+		if ((long_val > SHRT_MAX) || (long_val < SHRT_MIN))
+			PyErr_Warn(PyExc_RuntimeWarning, "Truncation of value to short");
+		*(short*)addr = (short)long_val;
+		break;
 		}
-		*(long*)addr = PyInt_AsLong(v);
+	case T_USHORT:{
+		long long_val;
+		long_val = PyInt_AsLong(v);
+		if ((long_val == -1) && PyErr_Occurred())
+			return -1;
+		if ((long_val > USHRT_MAX) || (long_val < 0))
+			PyErr_Warn(PyExc_RuntimeWarning, "Truncation of value to unsigned short");
+		*(unsigned short*)addr = (unsigned short)long_val;
 		break;
-	case T_ULONG:
-		if (PyInt_Check(v))
-			*(long*)addr = PyInt_AsLong(v);
-		else if (PyLong_Check(v))
-			*(long*)addr = PyLong_AsLong(v);
-		else {
-			PyErr_BadArgument();
+		}
+  	case T_INT:{
+		long long_val;
+		long_val = PyInt_AsLong(v);
+		if ((long_val == -1) && PyErr_Occurred())
 			return -1;
+		if ((long_val > INT_MAX) || (long_val < INT_MIN))
+			PyErr_Warn(PyExc_RuntimeWarning, "Truncation of value to int");
+		*(int *)addr = (int)long_val;
+		break;
+		}
+	case T_UINT:{
+		unsigned long ulong_val;
+		ulong_val = PyLong_AsUnsignedLong(v);
+		if ((ulong_val == (unsigned int)-1) && PyErr_Occurred()) {
+			/* XXX: For compatibility, accept negative int values
+			   as well. */
+			PyErr_Clear();
+			ulong_val = PyLong_AsLong(v);
+			if ((ulong_val == (unsigned int)-1) && PyErr_Occurred())
+				return -1;
+			PyErr_Warn(PyExc_RuntimeWarning, "Writing negative value into unsigned field");
+		}
+		if (ulong_val > UINT_MAX)
+			PyErr_Warn(PyExc_RuntimeWarning, "Truncation of value to unsigned int");
+		*(unsigned int *)addr = (unsigned int)ulong_val;
+		break;
+		}
+	case T_LONG:{
+		*(long*)addr = PyLong_AsLong(v);
+		if ((*(long*)addr == -1) && PyErr_Occurred())
+			return -1;
+		break;
+		}
+	case T_ULONG:{
+		*(unsigned long*)addr = PyLong_AsUnsignedLong(v);
+		if ((*(unsigned long*)addr == (unsigned long)-1)
+		    && PyErr_Occurred()) {
+			/* XXX: For compatibility, accept negative int values
+			   as well. */
+			PyErr_Clear();
+			*(unsigned long*)addr = PyLong_AsLong(v);
+			if ((*(unsigned long*)addr == (unsigned int)-1) && PyErr_Occurred())
+				return -1;
+			PyErr_Warn(PyExc_RuntimeWarning, "Writing negative value into unsigned field");
 		}
 		break;
-	case T_FLOAT:
-		if (PyInt_Check(v))
-			*(float*)addr =
-				(float) PyInt_AsLong(v);
-		else if (PyFloat_Check(v))
-			*(float*)addr =
-				(float) PyFloat_AsDouble(v);
-		else {
-			PyErr_BadArgument();
-			return -1;
 		}
+	case T_FLOAT:{
+		double double_val;
+		double_val = PyFloat_AsDouble(v);
+		if ((double_val == -1) && PyErr_Occurred())
+			return -1;
+		*(float*)addr = (float)double_val;
 		break;
+		}
 	case T_DOUBLE:
-		if (PyInt_Check(v))
-			*(double*)addr = (double) PyInt_AsLong(v);
-		else if (PyFloat_Check(v))
-			*(double*)addr = PyFloat_AsDouble(v);
-		else {
-			PyErr_BadArgument();
+		*(double*)addr = PyFloat_AsDouble(v);
+		if ((*(double*)addr == -1) && PyErr_Occurred())
 			return -1;
-		}
 		break;
 	case T_OBJECT:
 	case T_OBJECT_EX:

Modified: python/branches/p3yk-noslice/Python/symtable.c
==============================================================================
--- python/branches/p3yk-noslice/Python/symtable.c	(original)
+++ python/branches/p3yk-noslice/Python/symtable.c	Fri Dec 15 05:21:50 2006
@@ -480,8 +480,7 @@
 			       "is a nested function");
 
 	switch (ste->ste_unoptimized) {
-	case OPT_TOPLEVEL: /* exec / import * at top-level is fine */
-	case OPT_EXEC: /* qualified exec is fine */
+	case OPT_TOPLEVEL: /* import * at top-level is fine */
 		return 1;
 	case OPT_IMPORT_STAR:
 		PyOS_snprintf(buf, sizeof(buf), 
@@ -489,18 +488,6 @@
 			      "because it is %s",
 			      PyString_AS_STRING(ste->ste_name), trailer);
 		break;
-	case OPT_BARE_EXEC:
-		PyOS_snprintf(buf, sizeof(buf),
-			      "unqualified exec is not allowed in function "
-			      "'%.100s' it %s",
-			      PyString_AS_STRING(ste->ste_name), trailer);
-		break;
-	default:
-		PyOS_snprintf(buf, sizeof(buf), 
-			      "function '%.100s' uses import * and bare exec, "
-			      "which are illegal because it %s",
-			      PyString_AS_STRING(ste->ste_name), trailer);
-		break;
 	}
 
 	PyErr_SetString(PyExc_SyntaxError, buf);
@@ -906,6 +893,17 @@
 	} \
 }
 
+#define VISIT_KWONLYDEFAULTS(ST, KW_DEFAULTS) { \
+	int i = 0; \
+	asdl_seq *seq = (KW_DEFAULTS); /* avoid variable capture */ \
+	for (i = 0; i < asdl_seq_LEN(seq); i++) { \
+		expr_ty elt = (expr_ty)asdl_seq_GET(seq, i); \
+		if (!elt) continue; /* can be NULL */ \
+		if (!symtable_visit_expr((ST), elt)) \
+			return 0; \
+	} \
+}
+
 static int
 symtable_new_tmpname(struct symtable *st)
 {
@@ -923,6 +921,8 @@
 	return 1;
 }
 
+
+
 static int
 symtable_visit_stmt(struct symtable *st, stmt_ty s)
 {
@@ -932,6 +932,9 @@
 			return 0;
 		if (s->v.FunctionDef.args->defaults)
 			VISIT_SEQ(st, expr, s->v.FunctionDef.args->defaults);
+		if (s->v.FunctionDef.args->kw_defaults)
+			VISIT_KWONLYDEFAULTS(st, 
+					   s->v.FunctionDef.args->kw_defaults);
 		if (s->v.FunctionDef.decorators)
 			VISIT_SEQ(st, expr, s->v.FunctionDef.decorators);
 		if (!symtable_enter_block(st, s->v.FunctionDef.name, 
@@ -1045,19 +1048,6 @@
 		if (st->st_cur->ste_unoptimized && !st->st_cur->ste_opt_lineno)
 			st->st_cur->ste_opt_lineno = s->lineno;
 		break;
-        case Exec_kind:
-		VISIT(st, expr, s->v.Exec.body);
-		if (!st->st_cur->ste_opt_lineno)
-			st->st_cur->ste_opt_lineno = s->lineno;
-		if (s->v.Exec.globals) {
-			st->st_cur->ste_unoptimized |= OPT_EXEC;
-			VISIT(st, expr, s->v.Exec.globals);
-			if (s->v.Exec.locals) 
-				VISIT(st, expr, s->v.Exec.locals);
-		} else {
-			st->st_cur->ste_unoptimized |= OPT_BARE_EXEC;
-		}
-		break;
         case Global_kind: {
 		int i;
 		asdl_seq *seq = s->v.Global.names;
@@ -1147,6 +1137,9 @@
 		VISIT_SEQ(st, expr, e->v.Dict.keys);
 		VISIT_SEQ(st, expr, e->v.Dict.values);
 		break;
+	case Set_kind:
+		VISIT_SEQ(st, expr, e->v.Set.elts);
+		break;
         case ListComp_kind:
 		if (!symtable_new_tmpname(st))
 			return 0;
@@ -1182,11 +1175,9 @@
 		if (e->v.Call.kwargs)
 			VISIT(st, expr, e->v.Call.kwargs);
 		break;
-        case Repr_kind:
-		VISIT(st, expr, e->v.Repr.value);
-		break;
         case Num_kind:
         case Str_kind:
+	case Ellipsis_kind:
 		/* Nothing to do here. */
 		break;
 	/* The following exprs can be assignment targets. */
@@ -1287,6 +1278,8 @@
 	*/
 	if (a->args && !symtable_visit_params(st, a->args, 1))
 		return 0;
+	if (a->kwonlyargs && !symtable_visit_params(st, a->kwonlyargs, 1))
+		return 0;
 	if (a->vararg) {
 		if (!symtable_add_def(st, a->vararg, DEF_PARAM))
 			return 0;
@@ -1391,8 +1384,6 @@
 	case Index_kind:
 		VISIT(st, expr, s->v.Index.value)
 		break;
-	case Ellipsis_kind:
-		break;
 	}
 	return 1;
 }

Modified: python/branches/p3yk-noslice/Python/sysmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Python/sysmodule.c	(original)
+++ python/branches/p3yk-noslice/Python/sysmodule.c	Fri Dec 15 05:21:50 2006
@@ -979,6 +979,8 @@
 
 	br_start = python + 8;
 	br_end = strchr(br_start, '/');
+	assert(br_end);
+
 	/* Works even for trunk,
 	   as we are in trunk/Python/sysmodule.c */
 	br_end2 = strchr(br_end+1, '/');
@@ -991,6 +993,8 @@
 	}
 	else if (istag || strncmp(br_start, "branches", 8) == 0) {
 		len = br_end2 - br_start;
+		assert(len >= 13);
+		assert(len < (sizeof(patchlevel_revision) - 13));
 		strncpy(branch, br_start, len);
 		branch[len] = '\0';
 
@@ -1221,7 +1225,7 @@
 		p = strchr(path, delim);
 		if (p == NULL)
 			p = strchr(path, '\0'); /* End of string */
-		w = PyString_FromStringAndSize(path, (int) (p - path));
+		w = PyString_FromStringAndSize(path, (Py_ssize_t) (p - path));
 		if (w == NULL) {
 			Py_DECREF(v);
 			return NULL;

Modified: python/branches/p3yk-noslice/README
==============================================================================
--- python/branches/p3yk-noslice/README	(original)
+++ python/branches/p3yk-noslice/README	Fri Dec 15 05:21:50 2006
@@ -231,6 +231,11 @@
 available for all modern systems, either in the form of updated
 compilers from the vendor, or one of the free compilers (gcc).
 
+If "make install" fails mysteriously during the "compiling the library"
+step, make sure that you don't have any of the PYTHONPATH or PYTHONHOME
+environment variables set, as they may interfere with the newly built
+executable which is compiling the library.
+
 Unsupported systems
 -------------------
 

Modified: python/branches/p3yk-noslice/Tools/compiler/ast.txt
==============================================================================
--- python/branches/p3yk-noslice/Tools/compiler/ast.txt	(original)
+++ python/branches/p3yk-noslice/Tools/compiler/ast.txt	Fri Dec 15 05:21:50 2006
@@ -12,8 +12,8 @@
 Module: doc*, node
 Stmt: nodes!
 Decorators: nodes!
-Function: decorators&, name*, argnames*, defaults!, flags*, doc*, code
-Lambda: argnames*, defaults!, flags*, code
+Function: decorators&, name*, argnames*, defaults!, kwonlyargs*, flags*, doc*, code
+Lambda: argnames*, defaults!, kwonlyargs*, flags*, code
 Class: name*, bases!, doc*, code
 Pass: 
 Break: 
@@ -23,7 +23,6 @@
 With: expr, vars&, body
 If: tests!, else_&
 IfExp: test, then, else_
-Exec: expr, locals&, globals&
 From: modname*, names*, level*
 Import: names*
 Raise: expr1&, expr2&, expr3&
@@ -50,16 +49,15 @@
 GenExprIf: test
 List: nodes!
 Dict: items!
+Set: items!
 Not: expr
 Compare: expr, ops!
 Name: name*
 Global: names*
-Backquote: expr
 Getattr: expr, attrname*
 CallFunc: node, args!, star_args& = None, dstar_args& = None
 Keyword: name*, expr
 Subscript: expr, flags*, subs!
-Ellipsis: 
 Sliceobj: nodes!
 Slice: expr, flags*, lower&, upper&
 Assert: test, fail&
@@ -97,8 +95,9 @@
         self.kwargs = 1
 
 init(GenExpr):
-    self.argnames = ['[outmost-iterable]']
+    self.argnames = ['.0']
     self.varargs = self.kwargs = None
+    self.kwonlyargs = ()
 
 init(GenExprFor):
     self.is_outmost = False

Modified: python/branches/p3yk-noslice/Tools/compiler/astgen.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/compiler/astgen.py	(original)
+++ python/branches/p3yk-noslice/Tools/compiler/astgen.py	Fri Dec 15 05:21:50 2006
@@ -235,7 +235,7 @@
 
 This file is automatically generated by Tools/compiler/astgen.py
 """
-from consts import CO_VARARGS, CO_VARKEYWORDS
+from compiler.consts import CO_VARARGS, CO_VARKEYWORDS
 
 def flatten(seq):
     l = []

Modified: python/branches/p3yk-noslice/Tools/modulator/modulator.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/modulator/modulator.py	(original)
+++ python/branches/p3yk-noslice/Tools/modulator/modulator.py	Fri Dec 15 05:21:50 2006
@@ -126,7 +126,7 @@
         fp = open(fn, 'w')
 
         try:
-            exec pycode
+            exec(pycode)
         except:
             message('An error occurred:-)')
             return
@@ -371,7 +371,7 @@
         fp = open(sys.argv[1])
         pycode = fp.read()
         try:
-            exec pycode
+            exec(pycode)
         except:
             sys.stderr.write('An error occurred:-)\n')
             sys.exit(1)

Modified: python/branches/p3yk-noslice/Tools/msi/msi.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/msi/msi.py	(original)
+++ python/branches/p3yk-noslice/Tools/msi/msi.py	Fri Dec 15 05:21:50 2006
@@ -872,6 +872,12 @@
                     version=version, language=lang)
     tmpfiles.append("msvcr71.dll")
 
+    # Check if _ctypes.pyd exists
+    have_ctypes = os.path.exists(srcdir+"/PCBuild/_ctypes.pyd")
+    if not have_ctypes:
+        print "WARNING: _ctypes.pyd not found, ctypes will not be included"
+        extensions.remove("_ctypes.pyd")
+
     # Add all .py files in Lib, except lib-tk, test
     dirs={}
     pydirs = [(root,"Lib")]
@@ -889,6 +895,8 @@
             # data: Lib/email/test
             # output: Lib/test
             testsuite.set_current()
+        elif not have_ctypes and dir == "ctypes":
+            continue
         else:
             default_feature.set_current()
         lib = PyDirectory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir))
@@ -913,6 +921,7 @@
             lib.add_file("185test.db")
             lib.add_file("audiotest.au")
             lib.add_file("cfgparser.1")
+            lib.add_file("sgml_input.html")
             lib.add_file("test.xml")
             lib.add_file("test.xml.out")
             lib.add_file("testtar.tar")

Modified: python/branches/p3yk-noslice/Tools/msi/uuids.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/msi/uuids.py	(original)
+++ python/branches/p3yk-noslice/Tools/msi/uuids.py	Fri Dec 15 05:21:50 2006
@@ -22,6 +22,8 @@
     '2.4.2150':'{b191e49c-ea23-43b2-b28a-14e0784069b8}', # 2.4.2
     '2.4.3121':'{f669ed4d-1dce-41c4-9617-d985397187a1}', # 2.4.3c1
     '2.4.3150':'{75e71add-042c-4f30-bfac-a9ec42351313}', # 2.4.3
+    '2.4.4121':'{cd2862db-22a4-4688-8772-85407ea21550}', # 2.4.4c1
+    '2.4.4150':'{60e2c8c9-6cf3-4b1a-9618-e304946c94e6}', # 2.4.4
     '2.5.101': '{bc14ce3e-5e72-4a64-ac1f-bf59a571898c}', # 2.5a1
     '2.5.102': '{5eed51c1-8e9d-4071-94c5-b40de5d49ba5}', # 2.5a2
     '2.5.103': '{73dcd966-ffec-415f-bb39-8342c1f47017}', # 2.5a3

Modified: python/branches/p3yk-noslice/Tools/pybench/pybench.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/pybench/pybench.py	(original)
+++ python/branches/p3yk-noslice/Tools/pybench/pybench.py	Fri Dec 15 05:21:50 2006
@@ -885,7 +885,7 @@
                 else:
                     bench.print_benchmark(hidenoise=hidenoise,
                                           limitnames=limitnames)
-            except IOError:
+            except IOError, reason:
                 print '* Error opening/reading file %s: %s' % (
                     repr(show_bench),
                     reason)
@@ -931,8 +931,13 @@
                 bench.name = reportfile
                 pickle.dump(bench,f)
                 f.close()
-            except IOError:
+            except IOError, reason:
                 print '* Error opening/writing reportfile'
+            except IOError, reason:
+                print '* Error opening/writing reportfile %s: %s' % (
+                    reportfile,
+                    reason)
+                print
 
 if __name__ == '__main__':
     PyBenchCmdline()

Modified: python/branches/p3yk-noslice/Tools/scripts/findnocoding.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/scripts/findnocoding.py	(original)
+++ python/branches/p3yk-noslice/Tools/scripts/findnocoding.py	Fri Dec 15 05:21:50 2006
@@ -5,7 +5,7 @@
 Usage: nocoding.py dir1 [dir2...]
 """
 
-__author__ = "Oleg Broytmann, Reinhold Birkenfeld"
+__author__ = "Oleg Broytmann, Georg Brandl"
 
 import sys, os, re, getopt
 

Modified: python/branches/p3yk-noslice/Tools/scripts/fixdiv.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/scripts/fixdiv.py	(original)
+++ python/branches/p3yk-noslice/Tools/scripts/fixdiv.py	Fri Dec 15 05:21:50 2006
@@ -113,7 +113,7 @@
   future division statement.
 
 - Warnings may be issued for code not read from a file, but executed
-  using an exec statement or the eval() function.  These may have
+  using the exec() or eval() functions.  These may have
   <string> in the filename position, in which case the fixdiv script
   will attempt and fail to open a file named '<string>' and issue a
   warning about this failure; or these may be reported as 'Phantom'

Modified: python/branches/p3yk-noslice/Tools/scripts/h2py.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/scripts/h2py.py	(original)
+++ python/branches/p3yk-noslice/Tools/scripts/h2py.py	Fri Dec 15 05:21:50 2006
@@ -130,7 +130,7 @@
             ok = 0
             stmt = '%s = %s\n' % (name, body.strip())
             try:
-                exec stmt in env
+                exec(stmt, env)
             except:
                 sys.stderr.write('Skipping: %s' % stmt)
             else:
@@ -142,7 +142,7 @@
             body = pytify(body)
             stmt = 'def %s(%s): return %s\n' % (macro, arg, body)
             try:
-                exec stmt in env
+                exec(stmt, env)
             except:
                 sys.stderr.write('Skipping: %s' % stmt)
             else:

Modified: python/branches/p3yk-noslice/Tools/scripts/pysource.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/scripts/pysource.py	(original)
+++ python/branches/p3yk-noslice/Tools/scripts/pysource.py	Fri Dec 15 05:21:50 2006
@@ -15,7 +15,7 @@
 
 walk_python_files() recursively lists all Python files under the given directories.
 """
-__author__ = "Oleg Broytmann, Reinhold Birkenfeld"
+__author__ = "Oleg Broytmann, Georg Brandl"
 
 __all__ = ["has_python_ext", "looks_like_python", "can_be_compiled", "walk_python_files"]
 

Modified: python/branches/p3yk-noslice/configure
==============================================================================
--- python/branches/p3yk-noslice/configure	(original)
+++ python/branches/p3yk-noslice/configure	Fri Dec 15 05:21:50 2006
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.in Revision: 46754 .
+# From configure.in Revision: 51211 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for python 3.0.
+# Generated by GNU Autoconf 2.61 for python 3.0.
 #
 # Report bugs to <http://www.python.org/python-bugs>.
 #
@@ -13,7 +13,8 @@
 ## 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=:
@@ -22,10 +23,13 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
+
+
 
 
 # PATH needs CR
@@ -218,7 +222,7 @@
 else
   as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
@@ -236,7 +240,6 @@
 	 # 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
-# Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
@@ -245,10 +248,12 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
+
 
 :
 _ASEOF
@@ -256,7 +261,6 @@
   CONFIG_SHELL=$as_shell
 	       as_have_required=yes
 	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-# Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
@@ -265,10 +269,12 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
+
 
 :
 (as_func_return () {
@@ -515,19 +521,28 @@
   as_mkdir_p=false
 fi
 
-# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
-# systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
-  as_executable_p="test -x"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
 else
-  as_executable_p=:
+  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
-rm -f conf$$.file
+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'"
@@ -568,36 +583,36 @@
 # 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>
 #endif
-#if HAVE_STDINT_H
+#ifdef HAVE_STDINT_H
 # include <stdint.h>
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
@@ -724,6 +739,7 @@
 CC
 CFLAGS
 LDFLAGS
+LIBS
 CPPFLAGS
 CPP'
 
@@ -831,10 +847,10 @@
   -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'`
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
     eval enable_$ac_feature=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
@@ -850,10 +866,10 @@
   -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'`
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
     eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
@@ -1047,19 +1063,19 @@
   -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'`
+    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'`
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
     eval with_$ac_package=no ;;
 
   --x)
@@ -1339,6 +1355,7 @@
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib 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
@@ -1408,7 +1425,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 python configure 3.0
-generated by GNU Autoconf 2.60
+generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -1422,7 +1439,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by python $as_me 3.0, which was
-generated by GNU Autoconf 2.60.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 
@@ -1986,7 +2003,12 @@
   # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
   # even though select is a POSIX function. Reported by J. Ribbens.
   # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
-  OpenBSD/2.* | OpenBSD/3.[0123456789])
+  OpenBSD/2.* | OpenBSD/3.[0123456789] | OpenBSD/4.[0])
+    define_xopen_source=no;;
+  # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
+  # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
+  # Marc Recht
+  NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6A-S)
     define_xopen_source=no;;
   # On Solaris 2.6, sys/wait.h is inconsistent in the usage
   # of union __?sigval. Reported by Stuart Bishop.
@@ -2218,7 +2240,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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
@@ -2258,7 +2280,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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
@@ -2315,7 +2337,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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
@@ -2356,7 +2378,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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
@@ -2414,7 +2436,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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
@@ -2458,7 +2480,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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
@@ -2599,7 +2621,7 @@
 # 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
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
@@ -2627,6 +2649,12 @@
 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
 
@@ -2638,8 +2666,6 @@
 fi
 
 ac_exeext=$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
 
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
@@ -2817,27 +2843,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -2892,27 +2901,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -2947,27 +2939,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -3003,27 +2978,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -3139,27 +3097,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -3250,7 +3191,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3291,7 +3232,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3340,7 +3281,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_CXX="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3439,17 +3380,10 @@
   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
@@ -3483,17 +3417,10 @@
   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
@@ -3558,17 +3485,10 @@
   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
@@ -3602,17 +3522,10 @@
   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
@@ -3667,7 +3580,7 @@
   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_executable_p "$ac_path_GREP"; } || continue
+    { 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
@@ -3749,7 +3662,7 @@
   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_executable_p "$ac_path_EGREP"; } || continue
+    { 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
@@ -4159,7 +4072,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_RANLIB="${ac_tool_prefix}ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4199,7 +4112,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_RANLIB="ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4257,7 +4170,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_AR="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4300,7 +4213,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_SVNVERSION="found"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4404,7 +4317,7 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -4785,6 +4698,67 @@
   fi
 fi
 
+# Check whether GCC supports PyArg_ParseTuple format
+if test "$GCC" = "yes"
+then
+  { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5
+echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; }
+  save_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -Werror"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+    void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
+
+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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1
+_ACEOF
+
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$save_CFLAGS
+fi
+
 # On some compilers, pthreads are available without further options
 # (e.g. MacOS X). On some of these systems, the compiler will not
 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
@@ -5175,27 +5149,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -5371,27 +5328,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -5463,10 +5403,11 @@
 
 
 
+
 for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
-shadow.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
-signal.h stropts.h termios.h thread.h \
+io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
+shadow.h signal.h stdint.h stropts.h termios.h thread.h \
 unistd.h utime.h \
 sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \
 sys/modem.h \
@@ -5512,27 +5453,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -5568,17 +5492,10 @@
   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
@@ -5686,27 +5603,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -5779,27 +5679,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
@@ -5808,7 +5692,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_opendir+set}" = set; then
   break
@@ -5879,27 +5763,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
@@ -5908,7 +5776,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_opendir+set}" = set; then
   break
@@ -5965,27 +5833,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_header_sys_types_h_makedev=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -5994,7 +5846,7 @@
 	ac_cv_header_sys_types_h_makedev=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
@@ -6036,27 +5888,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -6092,17 +5927,10 @@
   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
@@ -6201,27 +6029,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -6257,17 +6068,10 @@
   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
@@ -6371,27 +6175,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -6455,27 +6242,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -6560,27 +6330,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_has_makedev=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6589,7 +6343,7 @@
 	ac_cv_has_makedev=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_has_makedev" = "no"; then
     # we didn't link, try if _OSF_SOURCE will allow us to link
@@ -6624,27 +6378,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_has_makedev=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6653,7 +6391,7 @@
 	ac_cv_has_makedev=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
     if test "$ac_cv_has_makedev" = "yes"; then
 
@@ -6715,27 +6453,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   sol_lfs_bug=no
 else
   echo "$as_me: failed program was:" >&5
@@ -6811,27 +6532,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_mode_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6891,27 +6595,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_off_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6971,27 +6658,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_pid_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7049,27 +6719,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_signal=int
 else
   echo "$as_me: failed program was:" >&5
@@ -7125,27 +6778,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7243,27 +6879,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_ssize_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7324,27 +6943,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_int=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7358,16 +6960,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
 echo "${ECHO_T}$ac_cv_type_int" >&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 int" >&5
 echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_int" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -7377,7 +6978,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -7401,27 +7002,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -7431,7 +7015,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -7455,27 +7039,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -7502,7 +7069,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -7526,27 +7093,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -7556,7 +7106,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -7580,27 +7130,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -7637,7 +7170,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -7661,27 +7194,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -7694,11 +7210,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+'') if test "$ac_cv_type_int" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7708,7 +7228,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+   typedef int 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>
@@ -7767,21 +7287,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+if test "$ac_cv_type_int" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_int=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_int=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_INT $ac_cv_sizeof_int
 _ACEOF
@@ -7824,27 +7348,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_long=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -7858,16 +7365,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
 echo "${ECHO_T}$ac_cv_type_long" >&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" >&5
 echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -7877,7 +7383,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -7901,27 +7407,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -7931,7 +7420,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -7955,27 +7444,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8002,7 +7474,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -8026,27 +7498,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8056,7 +7511,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -8080,27 +7535,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8137,7 +7575,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -8161,27 +7599,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8194,11 +7615,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+'') if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -8208,7 +7633,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+   typedef long 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>
@@ -8267,21 +7692,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=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=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_LONG $ac_cv_sizeof_long
 _ACEOF
@@ -8324,27 +7753,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_void_p=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -8358,16 +7770,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
 echo "${ECHO_T}$ac_cv_type_void_p" >&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 void *" >&5
 echo $ECHO_N "checking size of void *... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_void_p+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_void_p" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -8377,7 +7788,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef void * ac__type_sizeof_;
+   typedef void * ac__type_sizeof_;
 int
 main ()
 {
@@ -8401,27 +7812,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8431,7 +7825,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef void * ac__type_sizeof_;
+   typedef void * ac__type_sizeof_;
 int
 main ()
 {
@@ -8455,27 +7849,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8502,7 +7879,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef void * ac__type_sizeof_;
+   typedef void * ac__type_sizeof_;
 int
 main ()
 {
@@ -8526,27 +7903,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8556,7 +7916,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef void * ac__type_sizeof_;
+   typedef void * ac__type_sizeof_;
 int
 main ()
 {
@@ -8580,27 +7940,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8637,7 +7980,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef void * ac__type_sizeof_;
+   typedef void * ac__type_sizeof_;
 int
 main ()
 {
@@ -8661,27 +8004,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8694,11 +8020,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_void_p=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+'') if test "$ac_cv_type_void_p" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_void_p=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -8708,7 +8038,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef void * ac__type_sizeof_;
+   typedef void * 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>
@@ -8767,21 +8097,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+if test "$ac_cv_type_void_p" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_void_p=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_void_p=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
 echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
 _ACEOF
@@ -8824,27 +8158,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_short=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -8858,16 +8175,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
 echo "${ECHO_T}$ac_cv_type_short" >&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 short" >&5
 echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_short" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -8877,7 +8193,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -8901,27 +8217,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -8931,7 +8230,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -8955,27 +8254,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9002,7 +8284,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -9026,27 +8308,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9056,7 +8321,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -9080,27 +8345,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9137,7 +8385,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -9161,27 +8409,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9194,11 +8425,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_short=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+'') if test "$ac_cv_type_short" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_short=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -9208,7 +8443,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+   typedef short 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>
@@ -9267,21 +8502,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+if test "$ac_cv_type_short" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_short=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_short=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_SHORT $ac_cv_sizeof_short
 _ACEOF
@@ -9324,27 +8563,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_float=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -9358,16 +8580,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5
 echo "${ECHO_T}$ac_cv_type_float" >&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 float" >&5
 echo $ECHO_N "checking size of float... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_float+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_float" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -9377,7 +8598,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -9401,27 +8622,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9431,7 +8635,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -9455,27 +8659,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9502,7 +8689,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -9526,27 +8713,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9556,7 +8726,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -9580,27 +8750,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9637,7 +8790,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -9661,27 +8814,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9694,11 +8830,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_float=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+'') if test "$ac_cv_type_float" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_float=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -9708,7 +8848,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+   typedef float 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>
@@ -9767,21 +8907,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+if test "$ac_cv_type_float" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_float=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_float=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
 echo "${ECHO_T}$ac_cv_sizeof_float" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_FLOAT $ac_cv_sizeof_float
 _ACEOF
@@ -9824,27 +8968,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9858,16 +8985,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
 echo "${ECHO_T}$ac_cv_type_double" >&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 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -9877,7 +9003,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -9901,27 +9027,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -9931,7 +9040,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -9955,27 +9064,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10002,7 +9094,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -10026,27 +9118,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10056,7 +9131,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -10080,27 +9155,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10137,7 +9195,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -10161,27 +9219,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10194,11 +9235,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_double=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+'') 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)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_double=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10208,7 +9253,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+   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>
@@ -10267,21 +9312,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+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)
 See \`config.log' for more details." >&2;}
    { (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; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_DOUBLE $ac_cv_sizeof_double
 _ACEOF
@@ -10324,27 +9373,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_fpos_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -10358,16 +9390,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5
 echo "${ECHO_T}$ac_cv_type_fpos_t" >&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 fpos_t" >&5
 echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_fpos_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_fpos_t" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -10377,7 +9408,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef fpos_t ac__type_sizeof_;
+   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10401,27 +9432,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10431,7 +9445,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef fpos_t ac__type_sizeof_;
+   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10455,27 +9469,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10502,7 +9499,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef fpos_t ac__type_sizeof_;
+   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10526,27 +9523,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10556,7 +9536,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef fpos_t ac__type_sizeof_;
+   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10580,27 +9560,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10637,7 +9600,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef fpos_t ac__type_sizeof_;
+   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10661,27 +9624,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10694,11 +9640,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_fpos_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
+'') if test "$ac_cv_type_fpos_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_fpos_t=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10708,7 +9658,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef fpos_t ac__type_sizeof_;
+   typedef fpos_t 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>
@@ -10767,21 +9717,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
+if test "$ac_cv_type_fpos_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_fpos_t=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_fpos_t=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5
 echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t
 _ACEOF
@@ -10824,27 +9778,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -10858,16 +9795,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
 echo "${ECHO_T}$ac_cv_type_size_t" >&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 size_t" >&5
 echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_size_t" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -10877,7 +9813,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef size_t ac__type_sizeof_;
+   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10901,27 +9837,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -10931,7 +9850,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef size_t ac__type_sizeof_;
+   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
@@ -10955,27 +9874,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11002,7 +9904,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef size_t ac__type_sizeof_;
+   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
@@ -11026,27 +9928,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11056,7 +9941,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef size_t ac__type_sizeof_;
+   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
@@ -11080,27 +9965,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11137,7 +10005,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef size_t ac__type_sizeof_;
+   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
@@ -11161,27 +10029,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11194,11 +10045,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_size_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+'') if test "$ac_cv_type_size_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_size_t=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -11208,7 +10063,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef size_t ac__type_sizeof_;
+   typedef size_t 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>
@@ -11267,21 +10122,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+if test "$ac_cv_type_size_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_size_t=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_size_t=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
 echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
 _ACEOF
@@ -11319,27 +10178,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -11396,27 +10238,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -11430,16 +10255,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
 echo "${ECHO_T}$ac_cv_type_long_long" >&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 long" >&5
 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long_long" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -11449,7 +10273,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -11473,27 +10297,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11503,7 +10310,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -11527,27 +10334,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11574,7 +10364,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -11598,27 +10388,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11628,7 +10401,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -11652,27 +10425,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11709,7 +10465,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -11733,27 +10489,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -11766,11 +10505,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+'') if test "$ac_cv_type_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_long=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -11780,7 +10523,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+   typedef long long 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>
@@ -11839,21 +10582,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+if test "$ac_cv_type_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_long=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_long=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
 _ACEOF
@@ -11861,20 +10608,29 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for uintptr_t support" >&5
-echo $ECHO_N "checking for uintptr_t support... $ECHO_C" >&6; }
-have_uintptr_t=no
-cat >conftest.$ac_ext <<_ACEOF
+{ echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_uintptr_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#ifdef HAVE_STDINT_H
+        #include <stdint.h>
+        #endif
 
+typedef uintptr_t ac__type_new_;
 int
 main ()
 {
-uintptr_t x; x = (uintptr_t)0;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
@@ -11892,46 +10648,28 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UINTPTR_T 1
-_ACEOF
-
-  have_uintptr_t=yes
-
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_uintptr_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+	ac_cv_type_uintptr_t=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_uintptr_t" >&5
-echo "${ECHO_T}$have_uintptr_t" >&6; }
-if test "$have_uintptr_t" = yes ; then
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; }
+if test $ac_cv_type_uintptr_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
 { echo "$as_me:$LINENO: checking for uintptr_t" >&5
 echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
 if test "${ac_cv_type_uintptr_t+set}" = set; then
@@ -11969,27 +10707,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_uintptr_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -12003,16 +10724,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
 echo "${ECHO_T}$ac_cv_type_uintptr_t" >&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 uintptr_t" >&5
 echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_uintptr_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_uintptr_t" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -12022,7 +10742,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef uintptr_t ac__type_sizeof_;
+   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
@@ -12046,27 +10766,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -12076,7 +10779,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef uintptr_t ac__type_sizeof_;
+   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
@@ -12100,27 +10803,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -12147,7 +10833,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef uintptr_t ac__type_sizeof_;
+   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
@@ -12171,27 +10857,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -12201,7 +10870,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef uintptr_t ac__type_sizeof_;
+   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
@@ -12225,27 +10894,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -12282,7 +10934,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef uintptr_t ac__type_sizeof_;
+   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
@@ -12306,27 +10958,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -12339,11 +10974,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_uintptr_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
+'') if test "$ac_cv_type_uintptr_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_uintptr_t=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12353,7 +10992,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef uintptr_t ac__type_sizeof_;
+   typedef uintptr_t 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>
@@ -12412,21 +11051,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
+if test "$ac_cv_type_uintptr_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_uintptr_t=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_uintptr_t=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5
 echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t
 _ACEOF
@@ -12434,6 +11077,8 @@
 
 fi
 
+
+
 # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
 { echo "$as_me:$LINENO: checking size of off_t" >&5
 echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; }
@@ -12630,27 +11275,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   have_pthread_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13168,27 +11796,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_dl_dlopen=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13197,7 +11809,7 @@
 	ac_cv_lib_dl_dlopen=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -13255,27 +11867,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_dld_shl_load=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13284,7 +11880,7 @@
 	ac_cv_lib_dld_shl_load=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -13350,27 +11946,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_search_sem_init=$ac_res
 else
   echo "$as_me: failed program was:" >&5
@@ -13379,7 +11959,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_sem_init+set}" = set; then
   break
@@ -13448,27 +12028,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_intl_textdomain=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13477,7 +12041,7 @@
 	ac_cv_lib_intl_textdomain=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -13524,27 +12088,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
 
 cat >>confdefs.h <<\_ACEOF
 #define AIX_GENUINE_CPLUSPLUS 1
@@ -13560,7 +12108,7 @@
 echo "${ECHO_T}no" >&6; }
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext;;
 	*) ;;
 esac
@@ -13609,27 +12157,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_nsl_t_open=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13638,7 +12170,7 @@
 	ac_cv_lib_nsl_t_open=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -13690,27 +12222,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_socket_socket=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13719,7 +12235,7 @@
 	ac_cv_lib_socket_socket=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -13774,27 +12290,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_net_socket=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13803,7 +12303,7 @@
 	ac_cv_lib_net_socket=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -14057,27 +12557,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -14113,17 +12596,10 @@
   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
@@ -14229,27 +12705,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -14285,17 +12744,10 @@
   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
@@ -14426,27 +12878,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
 
     { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
@@ -14525,27 +12961,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_pthread_detach=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -14554,7 +12974,7 @@
 	ac_cv_func_pthread_detach=no
 fi
 
-rm -f core 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_pthread_detach" >&5
@@ -14602,27 +13022,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -14658,17 +13061,10 @@
   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
@@ -14769,27 +13165,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -14825,17 +13204,10 @@
   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
@@ -14944,27 +13316,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_pthreads_pthread_create=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -14973,7 +13329,7 @@
 	ac_cv_lib_pthreads_pthread_create=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -15031,27 +13387,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_c_r_pthread_create=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -15060,7 +13400,7 @@
 	ac_cv_lib_c_r_pthread_create=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -15118,27 +13458,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_pthread___pthread_create_system=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -15147,7 +13471,7 @@
 	ac_cv_lib_pthread___pthread_create_system=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -15205,27 +13529,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_cma_pthread_create=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -15234,7 +13542,7 @@
 	ac_cv_lib_cma_pthread_create=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -15270,7 +13578,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 
@@ -15323,27 +13631,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_mpc_usconfig=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -15352,7 +13644,7 @@
 	ac_cv_lib_mpc_usconfig=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -15412,27 +13704,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_thread_thr_create=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -15441,7 +13717,7 @@
 	ac_cv_lib_thread_thr_create=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -15633,27 +13909,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -15662,7 +13922,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -15806,27 +14066,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 		ipv6=yes
@@ -16205,27 +14448,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -16234,7 +14461,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -16457,27 +14684,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -16486,7 +14697,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -16533,27 +14744,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CHROOT 1
@@ -16601,27 +14795,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LINK 1
@@ -16669,27 +14846,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SYMLINK 1
@@ -16737,27 +14897,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FCHDIR 1
@@ -16805,27 +14948,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FSYNC 1
@@ -16873,27 +14999,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FDATASYNC 1
@@ -16951,27 +15060,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CTERMID_R 1
@@ -17023,27 +15115,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FLOCK 1
@@ -17095,27 +15170,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETPAGESIZE 1
@@ -17152,7 +15210,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $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_TRUE="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -17220,27 +15278,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_c_inet_aton=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -17249,7 +15291,7 @@
 	ac_cv_lib_c_inet_aton=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -17301,27 +15343,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_resolv_inet_aton=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -17330,7 +15356,7 @@
 	ac_cv_lib_resolv_inet_aton=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -17400,27 +15426,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_z_inflateCopy=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -17429,7 +15439,7 @@
 	ac_cv_lib_z_inflateCopy=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -17484,27 +15494,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_HSTRERROR 1
@@ -17521,7 +15515,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 { echo "$as_me:$LINENO: checking for inet_aton" >&5
@@ -17560,27 +15554,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_INET_ATON 1
@@ -17597,7 +15575,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 { echo "$as_me:$LINENO: checking for inet_pton" >&5
@@ -17636,27 +15614,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_INET_PTON 1
@@ -17712,27 +15673,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SETGROUPS 1
@@ -17820,27 +15764,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -17849,7 +15777,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -17903,27 +15831,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_util_openpty=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -17932,7 +15844,7 @@
 	ac_cv_lib_util_openpty=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -17986,27 +15898,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_bsd_openpty=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -18015,7 +15911,7 @@
 	ac_cv_lib_bsd_openpty=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -18102,27 +15998,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -18131,7 +16011,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -18185,27 +16065,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_util_forkpty=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -18214,7 +16078,7 @@
 	ac_cv_lib_util_forkpty=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -18268,27 +16132,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_bsd_forkpty=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -18297,7 +16145,7 @@
 	ac_cv_lib_bsd_forkpty=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -18391,27 +16239,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -18420,7 +16252,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -18506,27 +16338,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -18535,7 +16351,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -18624,27 +16440,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -18653,7 +16453,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -18691,27 +16491,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define GETPGRP_HAVE_ARG 1
@@ -18797,27 +16580,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -18826,7 +16593,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -18864,27 +16631,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define SETPGRP_HAVE_ARG 1
@@ -18970,27 +16720,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -18999,7 +16733,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -19037,27 +16771,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -19117,27 +16834,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -19157,7 +16858,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 # On OSF/1 V5.1, getaddrinfo is available, but a define
@@ -19199,27 +16900,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
 
 { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
@@ -19372,7 +17057,7 @@
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 if test "$buggygetaddrinfo" = "yes"; then
@@ -19455,27 +17140,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -19484,7 +17153,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -19537,27 +17206,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_time=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19595,7 +17247,9 @@
 int
 main ()
 {
-struct tm *tp; tp->tm_sec;
+struct tm tm;
+				     int *p = &tm.tm_sec;
+ 				     return !p;
   ;
   return 0;
 }
@@ -19613,27 +17267,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_struct_tm=time.h
 else
   echo "$as_me: failed program was:" >&5
@@ -19692,27 +17329,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19751,27 +17371,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19820,8 +17423,7 @@
 main ()
 {
 #ifndef tzname
-  char *p = (char *) tzname;
-  return !p;
+  (void) tzname;
 #endif
 
   ;
@@ -19841,27 +17443,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_tzname=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19927,27 +17512,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_var_tzname=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19956,7 +17525,7 @@
 	ac_cv_var_tzname=no
 fi
 
-rm -f core 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_var_tzname" >&5
@@ -20005,27 +17574,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_rdev=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20061,27 +17613,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_rdev=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20141,27 +17676,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blksize=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20197,27 +17715,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blksize=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20277,27 +17778,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_flags=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20333,27 +17817,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_flags=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20413,27 +17880,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_gen=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20469,27 +17919,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_gen=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20549,27 +17982,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_birthtime=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20605,27 +18021,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_birthtime=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20685,27 +18084,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blocks=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20741,27 +18123,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blocks=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20832,27 +18197,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_time_altzone=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20909,27 +18257,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -20983,27 +18314,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_struct_addrinfo=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21060,27 +18374,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_struct_sockaddr_storage=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21140,27 +18437,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_c_char_unsigned=no
 else
   echo "$as_me: failed program was:" >&5
@@ -21199,10 +18479,10 @@
 #ifndef __cplusplus
   /* Ultrix mips cc rejects this.  */
   typedef int charset[2];
-  const charset x;
+  const charset cs;
   /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
+  char const *const *pcpcc;
+  char **ppc;
   /* NEC SVR4.0.2 mips cc rejects this.  */
   struct point {int x, y;};
   static struct point const zero = {0,0};
@@ -21211,11 +18491,11 @@
      an arm of an if-expression whose if-part is not a constant
      expression */
   const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
+  pcpcc = &g + (g ? g-g : 0);
   /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
   { /* SCO 3.2v4 cc rejects this.  */
     char *t;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
@@ -21242,7 +18522,7 @@
     const int foo = 10;
     if (!foo) return 0;
   }
-  return !x[0] && !zero.x;
+  return !cs[0] && !zero.x;
 #endif
 
   ;
@@ -21262,27 +18542,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_c_const=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21335,27 +18598,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   works=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21404,27 +18650,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   works=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21473,27 +18702,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -21538,43 +18750,26 @@
 {
 return foo(10, "", 3.14);
   ;
-  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 -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (case "(($ac_try" in
+  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_try") 2>&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
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -21628,27 +18823,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKETPAIR 1
@@ -21700,27 +18878,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 
@@ -21775,27 +18936,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -21882,27 +19026,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_gethostbyname_r=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21911,7 +19039,7 @@
 	ac_cv_func_gethostbyname_r=no
 fi
 
-rm -f core 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_gethostbyname_r" >&5
@@ -21964,27 +19092,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
     cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETHOSTBYNAME_R 1
@@ -22045,27 +19156,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
       cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETHOSTBYNAME_R 1
@@ -22124,27 +19218,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
         cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETHOSTBYNAME_R 1
@@ -22248,27 +19325,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -22277,7 +19338,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -22367,27 +19428,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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___fpu_control=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -22396,7 +19441,7 @@
 	ac_cv_func___fpu_control=no
 fi
 
-rm -f core 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___fpu_control" >&5
@@ -22447,27 +19492,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_ieee___fpu_control=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -22476,7 +19505,7 @@
 	ac_cv_lib_ieee___fpu_control=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -22647,27 +19676,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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
@@ -22676,7 +19689,7 @@
 	eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_var'}'`
@@ -22735,27 +19748,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -22791,17 +19787,10 @@
   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
@@ -22912,27 +19901,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_wchar_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -22946,16 +19918,15 @@
 { echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
 echo "${ECHO_T}$ac_cv_type_wchar_t" >&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 wchar_t" >&5
 echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; }
 if test "${ac_cv_sizeof_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_wchar_t" = yes; then
-  # 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.
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
@@ -22966,7 +19937,7 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-		   typedef wchar_t ac__type_sizeof_;
+   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -22986,31 +19957,14 @@
 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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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=$?
+  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_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -23021,7 +19975,7 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-		   typedef wchar_t ac__type_sizeof_;
+   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -23045,27 +19999,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -23093,7 +20030,7 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-		   typedef wchar_t ac__type_sizeof_;
+   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -23117,27 +20054,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -23148,7 +20068,7 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-		   typedef wchar_t ac__type_sizeof_;
+   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -23172,27 +20092,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -23230,7 +20133,7 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-		   typedef wchar_t ac__type_sizeof_;
+   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -23254,27 +20157,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -23287,11 +20173,15 @@
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_wchar_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+'') if test "$ac_cv_type_wchar_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; } ;;
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_wchar_t=0
+   fi ;;
 esac
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -23302,7 +20192,7 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-		   typedef wchar_t ac__type_sizeof_;
+   typedef wchar_t 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>
@@ -23361,21 +20251,25 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+if test "$ac_cv_type_wchar_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_wchar_t=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_wchar_t=0
-fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
 echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; }
+
+
+
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
 _ACEOF
@@ -23418,27 +20312,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -23634,7 +20511,8 @@
 int
 main ()
 {
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+	&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
  bogus endian macros
 #endif
 
@@ -23655,27 +20533,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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.  */
@@ -23710,27 +20571,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -23781,27 +20625,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (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
@@ -24015,27 +20842,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_have_getc_unlocked=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24044,7 +20855,7 @@
 	ac_cv_have_getc_unlocked=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 
@@ -24105,27 +20916,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_readline_readline=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24134,7 +20929,7 @@
 	ac_cv_lib_readline_readline=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -24194,27 +20989,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_termcap_readline=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24223,7 +21002,7 @@
 	ac_cv_lib_termcap_readline=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -24283,27 +21062,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_readline_rl_callback_handler_install=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24312,7 +21075,7 @@
 	ac_cv_lib_readline_rl_callback_handler_install=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -24348,17 +21111,10 @@
   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
   have_readline=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24434,27 +21190,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_lib_readline_rl_pre_input_hook=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24463,7 +21203,7 @@
 	ac_cv_lib_readline_rl_pre_input_hook=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -24518,30 +21258,14 @@
   (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'
-  { (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); }; } &&
-	 { ac_try='test -s 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=$?
+  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_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_readline_rl_completion_matches=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24550,7 +21274,7 @@
 	ac_cv_lib_readline_rl_completion_matches=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -24586,17 +21310,10 @@
   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
   have_readline=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24825,27 +21542,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24884,27 +21584,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -24953,8 +21636,7 @@
 main ()
 {
 #ifndef tzname
-  char *p = (char *) tzname;
-  return !p;
+  (void) tzname;
 #endif
 
   ;
@@ -24974,27 +21656,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_tzname=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -25060,27 +21725,11 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s 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
+  (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_var_tzname=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -25089,7 +21738,7 @@
 	ac_cv_var_tzname=no
 fi
 
-rm -f core 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_var_tzname" >&5
@@ -25268,27 +21917,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_stat_tv_nsec=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -25348,27 +21980,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_stat_tv_nsec2=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -25428,27 +22043,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_mvwdelch_is_expression=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -25508,27 +22106,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_window_has_flags=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -25583,27 +22164,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURSES_IS_TERM_RESIZED 1
@@ -25652,27 +22216,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURSES_RESIZE_TERM 1
@@ -25721,27 +22268,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURSES_RESIZETERM 1
@@ -25762,55 +22292,38 @@
 
 { echo "$as_me:$LINENO: checking for /dev/ptmx" >&5
 echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; }
-if test "${ac_cv_file__dev_ptmx+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  test "$cross_compiling" = yes &&
-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-if test -r "/dev/ptmx"; then
-  ac_cv_file__dev_ptmx=yes
-else
-  ac_cv_file__dev_ptmx=no
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptmx" >&5
-echo "${ECHO_T}$ac_cv_file__dev_ptmx" >&6; }
-if test $ac_cv_file__dev_ptmx = yes; then
+
+if test -r /dev/ptmx
+then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_DEV_PTMX 1
 _ACEOF
 
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 { echo "$as_me:$LINENO: checking for /dev/ptc" >&5
 echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; }
-if test "${ac_cv_file__dev_ptc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  test "$cross_compiling" = yes &&
-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-if test -r "/dev/ptc"; then
-  ac_cv_file__dev_ptc=yes
-else
-  ac_cv_file__dev_ptc=no
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptc" >&5
-echo "${ECHO_T}$ac_cv_file__dev_ptc" >&6; }
-if test $ac_cv_file__dev_ptc = yes; then
+
+if test -r /dev/ptc
+then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_DEV_PTC 1
 _ACEOF
 
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-
 { echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
 echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
 if test "$cross_compiling" = yes; then
@@ -25832,12 +22345,26 @@
 
 int main()
 {
-    char buffer[4];
+    char buffer[256];
+
+#ifdef HAVE_SSIZE_T
+typedef ssize_t Py_ssize_t;
+#elif SIZEOF_VOID_P == SIZEOF_LONG
+typedef long Py_ssize_t;
+#else
+typedef int Py_ssize_t;
+#endif
 
     if(sprintf(buffer, "%zd", (size_t)123) < 0)
        	return 1;
 
-    if (strncmp(buffer, "123", 3))
+    if (strcmp(buffer, "123"))
+	return 1;
+
+    if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
+       	return 1;
+
+    if (strcmp(buffer, "-123"))
 	return 1;
 
     return 0;
@@ -25929,27 +22456,10 @@
   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'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_socklen_t=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -26115,7 +22625,8 @@
 ## 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=:
@@ -26124,10 +22635,13 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
+
+
 
 
 # PATH needs CR
@@ -26351,19 +22865,28 @@
   as_mkdir_p=false
 fi
 
-# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
-# systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
-  as_executable_p="test -x"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
 else
-  as_executable_p=:
+  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
-rm -f conf$$.file
+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'"
@@ -26379,7 +22902,7 @@
 # values after options handling.
 ac_log="
 This file was extended by python $as_me 3.0, which was
-generated by GNU Autoconf 2.60.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -26407,7 +22930,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
@@ -26428,7 +22951,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 python config.status 3.0
-configured by $0, generated by GNU Autoconf 2.60,
+configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright (C) 2006 Free Software Foundation, Inc.

Modified: python/branches/p3yk-noslice/configure.in
==============================================================================
--- python/branches/p3yk-noslice/configure.in	(original)
+++ python/branches/p3yk-noslice/configure.in	Fri Dec 15 05:21:50 2006
@@ -201,7 +201,12 @@
   # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
   # even though select is a POSIX function. Reported by J. Ribbens.
   # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
-  OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@) 
+  OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0@:>@) 
+    define_xopen_source=no;;
+  # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
+  # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
+  # Marc Recht
+  NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
     define_xopen_source=no;;
   # On Solaris 2.6, sys/wait.h is inconsistent in the usage
   # of union __?sigval. Reported by Stuart Bishop.
@@ -890,6 +895,22 @@
   fi
 fi
 
+# Check whether GCC supports PyArg_ParseTuple format
+if test "$GCC" = "yes"
+then
+  AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
+  save_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -Werror"
+  AC_TRY_COMPILE([
+    void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
+  ],,
+  AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
+  AC_MSG_RESULT(yes),
+  AC_MSG_RESULT(no)
+  )
+  CFLAGS=$save_CFLAGS
+fi
+
 # On some compilers, pthreads are available without further options
 # (e.g. MacOS X). On some of these systems, the compiler will not
 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
@@ -1068,8 +1089,8 @@
 AC_HEADER_STDC
 AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
-shadow.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
-signal.h stropts.h termios.h thread.h \
+io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
+shadow.h signal.h stdint.h stropts.h termios.h thread.h \
 unistd.h utime.h \
 sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \
 sys/modem.h \
@@ -1197,16 +1218,12 @@
 AC_CHECK_SIZEOF(long long, 8)
 fi
 
-AC_MSG_CHECKING(for uintptr_t support)
-have_uintptr_t=no
-AC_TRY_COMPILE([], [uintptr_t x; x = (uintptr_t)0;], [
-  AC_DEFINE(HAVE_UINTPTR_T, 1, [Define this if you have the type uintptr_t.]) 
-  have_uintptr_t=yes
-])
-AC_MSG_RESULT($have_uintptr_t)
-if test "$have_uintptr_t" = yes ; then
-AC_CHECK_SIZEOF(uintptr_t, 4)
-fi
+AC_CHECK_TYPES(uintptr_t, 
+   [AC_CHECK_SIZEOF(uintptr_t, 4)], 
+   [], [#ifdef HAVE_STDINT_H
+        #include <stdint.h>
+        #endif])
+
 
 # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
 AC_MSG_CHECKING(size of off_t)
@@ -3342,8 +3359,27 @@
   AC_MSG_RESULT(no)
 )
 
-AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if we have /dev/ptmx.]))
-AC_CHECK_FILE(/dev/ptc, AC_DEFINE(HAVE_DEV_PTC, 1, [Define if we have /dev/ptc.]))
+AC_MSG_CHECKING(for /dev/ptmx)
+
+if test -r /dev/ptmx
+then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_DEV_PTMX, 1,
+  [Define if we have /dev/ptmx.])
+else
+  AC_MSG_RESULT(no)
+fi
+
+AC_MSG_CHECKING(for /dev/ptc)
+
+if test -r /dev/ptc
+then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_DEV_PTC, 1,
+  [Define if we have /dev/ptc.])
+else
+  AC_MSG_RESULT(no)
+fi
 
 AC_MSG_CHECKING(for %zd printf() format support)
 AC_TRY_RUN([#include <stdio.h>
@@ -3352,14 +3388,28 @@
 
 int main()
 {
-    char buffer[4];
+    char buffer[256];
+
+#ifdef HAVE_SSIZE_T
+typedef ssize_t Py_ssize_t;
+#elif SIZEOF_VOID_P == SIZEOF_LONG
+typedef long Py_ssize_t;
+#else
+typedef int Py_ssize_t;
+#endif
 
     if(sprintf(buffer, "%zd", (size_t)123) < 0)
        	return 1;
 
-    if (strncmp(buffer, "123", 3))
+    if (strcmp(buffer, "123"))
 	return 1;
-    
+
+    if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
+       	return 1;
+
+    if (strcmp(buffer, "-123"))
+	return 1;
+
     return 0;
 }],
 [AC_MSG_RESULT(yes)

Modified: python/branches/p3yk-noslice/pyconfig.h.in
==============================================================================
--- python/branches/p3yk-noslice/pyconfig.h.in	(original)
+++ python/branches/p3yk-noslice/pyconfig.h.in	Fri Dec 15 05:21:50 2006
@@ -40,6 +40,9 @@
 /* Define to 1 if you have the <asm/types.h> header file. */
 #undef HAVE_ASM_TYPES_H
 
+/* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3))) */
+#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
+
 /* Define to 1 if you have the `bind_textdomain_codeset' function. */
 #undef HAVE_BIND_TEXTDOMAIN_CODESET
 
@@ -677,7 +680,7 @@
 /* Define this if you have tcl and TCL_UTF_MAX==6 */
 #undef HAVE_UCS4_TCL
 
-/* Define this if you have the type uintptr_t. */
+/* Define to 1 if the system has the type `uintptr_t'. */
 #undef HAVE_UINTPTR_T
 
 /* Define to 1 if you have the `uname' function. */

Modified: python/branches/p3yk-noslice/setup.py
==============================================================================
--- python/branches/p3yk-noslice/setup.py	(original)
+++ python/branches/p3yk-noslice/setup.py	Fri Dec 15 05:21:50 2006
@@ -679,7 +679,8 @@
                             # save the include directory with the db.h version
                             # (first occurrance only)
                             db_ver_inc_map[db_ver] = d
-                            print "db.h: found", db_ver, "in", d
+                            if db_setup_debug:
+                                print "db.h: found", db_ver, "in", d
                         else:
                             # we already found a header for this library version
                             if db_setup_debug: print "db.h: ignoring", d
@@ -719,8 +720,9 @@
                         if db_setup_debug: print "db lib: ", dblib, "not found"
 
         except db_found:
-            print "db lib: using", db_ver, dblib
-            if db_setup_debug: print "db: lib dir", dblib_dir, "inc dir", db_incdir
+            if db_setup_debug:
+                print "db lib: using", db_ver, dblib
+                print "db: lib dir", dblib_dir, "inc dir", db_incdir
             db_incs = [db_incdir]
             dblibs = [dblib]
             # We add the runtime_library_dirs argument because the
@@ -741,7 +743,7 @@
             dblib_dir = None
 
         # The sqlite interface
-        sqlite_setup_debug = True   # verbose debug prints from this script?
+        sqlite_setup_debug = False   # verbose debug prints from this script?
 
         # We hunt for #define SQLITE_VERSION "n.n.n"
         # We need to find >= sqlite version 3.0.8
@@ -773,7 +775,8 @@
                                         for x in sqlite_version.split(".")])
                     if sqlite_version_tuple >= MIN_SQLITE_VERSION_NUMBER:
                         # we win!
-                        print "%s/sqlite3.h: version %s"%(d, sqlite_version)
+                        if sqlite_setup_debug:
+                            print "%s/sqlite3.h: version %s"%(d, sqlite_version)
                         sqlite_incdir = d
                         break
                     else:


More information about the Python-checkins mailing list