[Python-3000-checkins] r61003 - in python/branches/py3k: Doc/library/pickle.rst Doc/library/xmlrpclib.rst Doc/whatsnew/2.6.rst Lib/SimpleHTTPServer.py Lib/ctypes/test/__init__.py Lib/ctypes/test/test_checkretval.py Lib/ctypes/test/test_find.py Lib/ctypes/test/test_libc.py Lib/ctypes/test/test_numbers.py Lib/curses/wrapper.py Lib/distutils/bcppcompiler.py Lib/distutils/command/bdist_dumb.py Lib/distutils/command/bdist_rpm.py Lib/distutils/command/build_scripts.py Lib/distutils/command/install.py Lib/distutils/command/install_headers.py Lib/distutils/command/register.py Lib/distutils/filelist.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_sysconfig.py Lib/distutils/unixccompiler.py Lib/email/base64mime.py Lib/httplib.py Lib/idlelib/MultiCall.py Lib/idlelib/RemoteDebugger.py Lib/idlelib/TreeWidget.py Lib/idlelib/UndoDelegator.py Lib/idlelib/keybindingDialog.py Lib/idlelib/run.py Lib/lib-tk/tkSimpleDialog.py Lib/logging/handlers.py Lib/ntpath.py Lib/plat-mac/MiniAEFrame.py Lib/plat-mac/aepack.py Lib/plat-mac/bgenlocations.py Lib/plat-mac/macostools.py Lib/sqlite3/test/hooks.py Lib/ssl.py Lib/test/fork_wait.py Lib/test/list_tests.py Lib/test/seq_tests.py Lib/test/test___all__.py Lib/test/test_abc.py Lib/test/test_applesingle.py Lib/test/test_class.py Lib/test/test_cmd.py Lib/test/test_compare.py Lib/test/test_copy.py Lib/test/test_datetime.py Lib/test/test_dbm.py Lib/test/test_dis.py Lib/test/test_dummy_threading.py Lib/test/test_email.py Lib/test/test_eof.py Lib/test/test_extcall.py Lib/test/test_fileinput.py Lib/test/test_fractions.py Lib/test/test_getargs2.py Lib/test/test_gzip.py Lib/test/test_htmlparser.py Lib/test/test_httplib.py Lib/test/test_imp.py Lib/test/test_index.py Lib/test/test_list.py Lib/test/test_minidom.py Lib/test/test_module.py Lib/test/test_modulefinder.py Lib/test/test_multibytecodec_support.py Lib/test/test_optparse.py Lib/test/test_ossaudiodev.py Lib/test/test_pickle.py Lib/test/test_pkg.py Lib/test/test_plistlib.py Lib/test/test_poll.py Lib/test/test_posix.py Lib/test/test_pyclbr.py Lib/test/test_resource.py Lib/test/test_rfc822.py Lib/test/test_scriptpackages.py Lib/test/test_sgmllib.py Lib/test/test_site.py Lib/test/test_socketserver.py Lib/test/test_sqlite.py Lib/test/test_strftime.py Lib/test/test_support.py Lib/test/test_tuple.py Lib/test/test_unpack.py Lib/test/test_urllib.py Lib/test/test_urllib2.py Lib/test/test_urllib2_localnet.py Lib/test/test_userdict.py Lib/test/test_userlist.py Lib/test/test_userstring.py Lib/test/test_whichdb.py Lib/test/test_xml_etree.py Lib/test/test_xml_etree_c.py Lib/test/test_xmlrpc.py Lib/xml/dom/minidom.py Lib/xmlrpclib.py Mac/Demo/PICTbrowse/ICONbrowse.py Mac/Demo/PICTbrowse/PICTbrowse.py Mac/Demo/PICTbrowse/PICTbrowse2.py Mac/Demo/PICTbrowse/cicnbrowse.py Mac/Demo/PICTbrowse/oldPICTbrowse.py Mac/Demo/example1/dnslookup-1.py Mac/Demo/example2/dnslookup-2.py Mac/Demo/imgbrowse/imgbrowse.py Mac/Demo/imgbrowse/mac_image.py Mac/Modules/ae/aescan.py Mac/Modules/ah/ahscan.py Mac/Modules/app/appscan.py Mac/Modules/carbonevt/CarbonEvtscan.py Mac/Modules/cf/cfscan.py Mac/Modules/cg/cgscan.py Mac/Modules/cm/cmscan.py Mac/Modules/ctl/ctlscan.py Mac/Modules/dlg/dlgscan.py Mac/Modules/drag/dragscan.py Mac/Modules/evt/evtscan.py Mac/Modules/file/filescan.py Mac/Modules/fm/fmscan.py Mac/Modules/folder/folderscan.py Mac/Modules/help/helpscan.py Mac/Modules/ibcarbon/IBCarbonscan.py Mac/Modules/icn/icnscan.py Mac/Modules/launch/launchscan.py Mac/Modules/list/listscan.py Mac/Modules/menu/menuscan.py Mac/Modules/mlte/mltescan.py Mac/Modules/osa/osascan.py Mac/Modules/qd/qdscan.py Mac/Modules/qdoffs/qdoffsscan.py Mac/Modules/qt/qtscan.py Mac/Modules/res/resscan.py Mac/Modules/scrap/scrapscan.py Mac/Modules/snd/sndscan.py Mac/Modules/te/tescan.py Mac/Modules/win/winscan.py Misc/ACKS Modules/syslogmodule.c PC/VS8.0/build_tkinter.py PCbuild/build_tkinter.py Parser/asdl_c.py Parser/spark.py Python/Python-ast.c Python/import.c Python/mystrtoul.c Tools/faqwiz/faqw.py Tools/modulator/Tkextra.py Tools/pybench/systimes.py Tools/pynche/ChipViewer.py Tools/pynche/TypeinViewer.py Tools/scripts/logmerge.py Tools/scripts/nm2def.py Tools/scripts/pindent.py Tools/scripts/pysource.py Tools/scripts/xxci.py Tools/ssl/get-remote-certificate.py Tools/unicode/gencodec.py Tools/webchecker/wcgui.py Tools/webchecker/wsgui.py
christian.heimes
python-3000-checkins at python.org
Sat Feb 23 19:30:21 CET 2008
Author: christian.heimes
Date: Sat Feb 23 19:30:17 2008
New Revision: 61003
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Doc/library/pickle.rst
python/branches/py3k/Doc/library/xmlrpclib.rst
python/branches/py3k/Doc/whatsnew/2.6.rst
python/branches/py3k/Lib/SimpleHTTPServer.py
python/branches/py3k/Lib/ctypes/test/__init__.py
python/branches/py3k/Lib/ctypes/test/test_checkretval.py
python/branches/py3k/Lib/ctypes/test/test_find.py
python/branches/py3k/Lib/ctypes/test/test_libc.py
python/branches/py3k/Lib/ctypes/test/test_numbers.py
python/branches/py3k/Lib/curses/wrapper.py
python/branches/py3k/Lib/distutils/bcppcompiler.py
python/branches/py3k/Lib/distutils/command/bdist_dumb.py
python/branches/py3k/Lib/distutils/command/bdist_rpm.py
python/branches/py3k/Lib/distutils/command/build_scripts.py
python/branches/py3k/Lib/distutils/command/install.py
python/branches/py3k/Lib/distutils/command/install_headers.py
python/branches/py3k/Lib/distutils/command/register.py
python/branches/py3k/Lib/distutils/filelist.py
python/branches/py3k/Lib/distutils/tests/test_dist.py
python/branches/py3k/Lib/distutils/tests/test_sysconfig.py
python/branches/py3k/Lib/distutils/unixccompiler.py
python/branches/py3k/Lib/email/base64mime.py
python/branches/py3k/Lib/httplib.py
python/branches/py3k/Lib/idlelib/MultiCall.py
python/branches/py3k/Lib/idlelib/RemoteDebugger.py
python/branches/py3k/Lib/idlelib/TreeWidget.py
python/branches/py3k/Lib/idlelib/UndoDelegator.py
python/branches/py3k/Lib/idlelib/keybindingDialog.py
python/branches/py3k/Lib/idlelib/run.py
python/branches/py3k/Lib/lib-tk/tkSimpleDialog.py
python/branches/py3k/Lib/logging/handlers.py
python/branches/py3k/Lib/ntpath.py
python/branches/py3k/Lib/plat-mac/MiniAEFrame.py
python/branches/py3k/Lib/plat-mac/aepack.py
python/branches/py3k/Lib/plat-mac/bgenlocations.py
python/branches/py3k/Lib/plat-mac/macostools.py
python/branches/py3k/Lib/sqlite3/test/hooks.py
python/branches/py3k/Lib/ssl.py
python/branches/py3k/Lib/test/fork_wait.py
python/branches/py3k/Lib/test/list_tests.py
python/branches/py3k/Lib/test/seq_tests.py
python/branches/py3k/Lib/test/test___all__.py
python/branches/py3k/Lib/test/test_abc.py
python/branches/py3k/Lib/test/test_applesingle.py
python/branches/py3k/Lib/test/test_class.py
python/branches/py3k/Lib/test/test_cmd.py
python/branches/py3k/Lib/test/test_compare.py
python/branches/py3k/Lib/test/test_copy.py
python/branches/py3k/Lib/test/test_datetime.py
python/branches/py3k/Lib/test/test_dbm.py
python/branches/py3k/Lib/test/test_dis.py
python/branches/py3k/Lib/test/test_dummy_threading.py
python/branches/py3k/Lib/test/test_email.py
python/branches/py3k/Lib/test/test_eof.py
python/branches/py3k/Lib/test/test_extcall.py
python/branches/py3k/Lib/test/test_fileinput.py
python/branches/py3k/Lib/test/test_fractions.py
python/branches/py3k/Lib/test/test_getargs2.py
python/branches/py3k/Lib/test/test_gzip.py
python/branches/py3k/Lib/test/test_htmlparser.py
python/branches/py3k/Lib/test/test_httplib.py
python/branches/py3k/Lib/test/test_imp.py
python/branches/py3k/Lib/test/test_index.py
python/branches/py3k/Lib/test/test_list.py
python/branches/py3k/Lib/test/test_minidom.py
python/branches/py3k/Lib/test/test_module.py
python/branches/py3k/Lib/test/test_modulefinder.py
python/branches/py3k/Lib/test/test_multibytecodec_support.py
python/branches/py3k/Lib/test/test_optparse.py
python/branches/py3k/Lib/test/test_ossaudiodev.py
python/branches/py3k/Lib/test/test_pickle.py
python/branches/py3k/Lib/test/test_pkg.py
python/branches/py3k/Lib/test/test_plistlib.py
python/branches/py3k/Lib/test/test_poll.py
python/branches/py3k/Lib/test/test_posix.py
python/branches/py3k/Lib/test/test_pyclbr.py
python/branches/py3k/Lib/test/test_resource.py
python/branches/py3k/Lib/test/test_rfc822.py
python/branches/py3k/Lib/test/test_scriptpackages.py
python/branches/py3k/Lib/test/test_sgmllib.py
python/branches/py3k/Lib/test/test_site.py
python/branches/py3k/Lib/test/test_socketserver.py
python/branches/py3k/Lib/test/test_sqlite.py
python/branches/py3k/Lib/test/test_strftime.py
python/branches/py3k/Lib/test/test_support.py
python/branches/py3k/Lib/test/test_tuple.py
python/branches/py3k/Lib/test/test_unpack.py
python/branches/py3k/Lib/test/test_urllib.py
python/branches/py3k/Lib/test/test_urllib2.py
python/branches/py3k/Lib/test/test_urllib2_localnet.py
python/branches/py3k/Lib/test/test_userdict.py
python/branches/py3k/Lib/test/test_userlist.py
python/branches/py3k/Lib/test/test_userstring.py
python/branches/py3k/Lib/test/test_whichdb.py
python/branches/py3k/Lib/test/test_xml_etree.py
python/branches/py3k/Lib/test/test_xml_etree_c.py
python/branches/py3k/Lib/test/test_xmlrpc.py
python/branches/py3k/Lib/xml/dom/minidom.py
python/branches/py3k/Lib/xmlrpclib.py
python/branches/py3k/Mac/Demo/PICTbrowse/ICONbrowse.py
python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse.py
python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse2.py
python/branches/py3k/Mac/Demo/PICTbrowse/cicnbrowse.py
python/branches/py3k/Mac/Demo/PICTbrowse/oldPICTbrowse.py
python/branches/py3k/Mac/Demo/example1/dnslookup-1.py
python/branches/py3k/Mac/Demo/example2/dnslookup-2.py
python/branches/py3k/Mac/Demo/imgbrowse/imgbrowse.py
python/branches/py3k/Mac/Demo/imgbrowse/mac_image.py
python/branches/py3k/Mac/Modules/ae/aescan.py
python/branches/py3k/Mac/Modules/ah/ahscan.py
python/branches/py3k/Mac/Modules/app/appscan.py
python/branches/py3k/Mac/Modules/carbonevt/CarbonEvtscan.py
python/branches/py3k/Mac/Modules/cf/cfscan.py
python/branches/py3k/Mac/Modules/cg/cgscan.py
python/branches/py3k/Mac/Modules/cm/cmscan.py
python/branches/py3k/Mac/Modules/ctl/ctlscan.py
python/branches/py3k/Mac/Modules/dlg/dlgscan.py
python/branches/py3k/Mac/Modules/drag/dragscan.py
python/branches/py3k/Mac/Modules/evt/evtscan.py
python/branches/py3k/Mac/Modules/file/filescan.py
python/branches/py3k/Mac/Modules/fm/fmscan.py
python/branches/py3k/Mac/Modules/folder/folderscan.py
python/branches/py3k/Mac/Modules/help/helpscan.py
python/branches/py3k/Mac/Modules/ibcarbon/IBCarbonscan.py
python/branches/py3k/Mac/Modules/icn/icnscan.py
python/branches/py3k/Mac/Modules/launch/launchscan.py
python/branches/py3k/Mac/Modules/list/listscan.py
python/branches/py3k/Mac/Modules/menu/menuscan.py
python/branches/py3k/Mac/Modules/mlte/mltescan.py
python/branches/py3k/Mac/Modules/osa/osascan.py
python/branches/py3k/Mac/Modules/qd/qdscan.py
python/branches/py3k/Mac/Modules/qdoffs/qdoffsscan.py
python/branches/py3k/Mac/Modules/qt/qtscan.py
python/branches/py3k/Mac/Modules/res/resscan.py
python/branches/py3k/Mac/Modules/scrap/scrapscan.py
python/branches/py3k/Mac/Modules/snd/sndscan.py
python/branches/py3k/Mac/Modules/te/tescan.py
python/branches/py3k/Mac/Modules/win/winscan.py
python/branches/py3k/Misc/ACKS
python/branches/py3k/Modules/syslogmodule.c
python/branches/py3k/PC/VS8.0/build_tkinter.py
python/branches/py3k/PCbuild/build_tkinter.py
python/branches/py3k/Parser/asdl_c.py
python/branches/py3k/Parser/spark.py
python/branches/py3k/Python/Python-ast.c
python/branches/py3k/Python/import.c
python/branches/py3k/Python/mystrtoul.c
python/branches/py3k/Tools/faqwiz/faqw.py
python/branches/py3k/Tools/modulator/Tkextra.py
python/branches/py3k/Tools/pybench/systimes.py
python/branches/py3k/Tools/pynche/ChipViewer.py
python/branches/py3k/Tools/pynche/TypeinViewer.py
python/branches/py3k/Tools/scripts/logmerge.py
python/branches/py3k/Tools/scripts/nm2def.py
python/branches/py3k/Tools/scripts/pindent.py
python/branches/py3k/Tools/scripts/pysource.py
python/branches/py3k/Tools/scripts/xxci.py
python/branches/py3k/Tools/ssl/get-remote-certificate.py
python/branches/py3k/Tools/unicode/gencodec.py
python/branches/py3k/Tools/webchecker/wcgui.py
python/branches/py3k/Tools/webchecker/wsgui.py
Log:
Merged revisions 60990-61002 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r60990 | eric.smith | 2008-02-23 17:05:26 +0100 (Sat, 23 Feb 2008) | 1 line
Removed duplicate Py_CHARMASK define. It's already defined in Python.h.
........
r60991 | andrew.kuchling | 2008-02-23 17:23:05 +0100 (Sat, 23 Feb 2008) | 4 lines
#1330538: Improve comparison of xmlrpclib.DateTime and datetime instances.
Remove automatic handling of datetime.date and datetime.time.
This breaks backward compatibility, but python-dev discussion was strongly
against this automatic conversion; see the bug for a link.
........
r60994 | andrew.kuchling | 2008-02-23 17:39:43 +0100 (Sat, 23 Feb 2008) | 1 line
#835521: Add index entries for various pickle-protocol methods and attributes
........
r60995 | andrew.kuchling | 2008-02-23 18:10:46 +0100 (Sat, 23 Feb 2008) | 2 lines
#1433694: minidom's .normalize() failed to set .nextSibling for last element.
Fix by Malte Helmert
........
r61000 | christian.heimes | 2008-02-23 18:40:11 +0100 (Sat, 23 Feb 2008) | 1 line
Patch #2167 from calvin: Remove unused imports
........
r61001 | christian.heimes | 2008-02-23 18:42:31 +0100 (Sat, 23 Feb 2008) | 1 line
Patch #1957: syslogmodule: Release GIL when calling syslog(3)
........
r61002 | christian.heimes | 2008-02-23 18:52:07 +0100 (Sat, 23 Feb 2008) | 2 lines
Issue #2051 and patch from Alexander Belopolsky:
Permission for pyc and pyo files are inherited from the py file.
........
Modified: python/branches/py3k/Doc/library/pickle.rst
==============================================================================
--- python/branches/py3k/Doc/library/pickle.rst (original)
+++ python/branches/py3k/Doc/library/pickle.rst Sat Feb 23 19:30:17 2008
@@ -451,6 +451,11 @@
Pickling and unpickling extension types
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. index::
+ single: __reduce__() (pickle protocol)
+ single: __reduce_ex__() (pickle protocol)
+ single: __safe_for_unpickling__ (pickle protocol)
+
When the :class:`Pickler` encounters an object of a type it knows nothing about
--- such as an extension type --- it looks in two places for a hint of how to
pickle it. One alternative is for the object to implement a :meth:`__reduce__`
@@ -526,6 +531,10 @@
Pickling and unpickling external objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. index::
+ single: persistent_id (pickle protocol)
+ single: persistent_load (pickle protocol)
+
For the benefit of object persistence, the :mod:`pickle` module supports the
notion of a reference to an object outside the pickled data stream. Such
objects are referenced by a "persistent id", which is just an arbitrary string
@@ -615,6 +624,10 @@
Subclassing Unpicklers
----------------------
+.. index::
+ single: load_global() (pickle protocol)
+ single: find_global() (pickle protocol)
+
By default, unpickling will import any class that it finds in the pickle data.
You can control exactly what gets unpickled and what gets called by customizing
your unpickler. Unfortunately, exactly how you do this is different depending
Modified: python/branches/py3k/Doc/library/xmlrpclib.rst
==============================================================================
--- python/branches/py3k/Doc/library/xmlrpclib.rst (original)
+++ python/branches/py3k/Doc/library/xmlrpclib.rst Sat Feb 23 19:30:17 2008
@@ -32,10 +32,7 @@
all clients and servers; see http://ontosys.com/xml-rpc/extensions.php for a
description. The *use_datetime* flag can be used to cause date/time values to
be presented as :class:`datetime.datetime` objects; this is false by default.
- :class:`datetime.datetime`, :class:`datetime.date` and :class:`datetime.time`
- objects may be passed to calls. :class:`datetime.date` objects are converted
- with a time of "00:00:00". :class:`datetime.time` objects are converted using
- today's date.
+ :class:`datetime.datetime` objects may be passed to calls.
Both the HTTP and HTTPS transports support the URL syntax extension for HTTP
Basic Authentication: ``http://user:pass@host:port/path``. The ``user:pass``
@@ -79,9 +76,7 @@
+---------------------------------+---------------------------------------------+
| :const:`dates` | in seconds since the epoch (pass in an |
| | instance of the :class:`DateTime` class) or |
- | | a :class:`datetime.datetime`, |
- | | :class:`datetime.date` or |
- | | :class:`datetime.time` instance |
+ | | a :class:`datetime.datetime` instance. |
+---------------------------------+---------------------------------------------+
| :const:`binary data` | pass in an instance of the :class:`Binary` |
| | wrapper class |
@@ -211,10 +206,10 @@
DateTime Objects
----------------
-This class may be initialized with seconds since the epoch, a time tuple, an ISO
-8601 time/date string, or a :class:`datetime.datetime`, :class:`datetime.date`
-or :class:`datetime.time` instance. It has the following methods, supported
-mainly for internal use by the marshalling/unmarshalling code:
+This class may be initialized with seconds since the epoch, a time
+tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime`
+instance. It has the following methods, supported mainly for internal
+use by the marshalling/unmarshalling code:
.. method:: DateTime.decode(string)
@@ -495,10 +490,7 @@
``None`` if no method name is present in the packet. If the XML-RPC packet
represents a fault condition, this function will raise a :exc:`Fault` exception.
The *use_datetime* flag can be used to cause date/time values to be presented as
- :class:`datetime.datetime` objects; this is false by default. Note that even if
- you call an XML-RPC method with :class:`datetime.date` or :class:`datetime.time`
- objects, they are converted to :class:`DateTime` objects internally, so only
- :class:`datetime.datetime` objects will be returned.
+ :class:`datetime.datetime` objects; this is false by default.
.. _xmlrpc-client-example:
Modified: python/branches/py3k/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/2.6.rst (original)
+++ python/branches/py3k/Doc/whatsnew/2.6.rst Sat Feb 23 19:30:17 2008
@@ -1511,6 +1511,15 @@
.. Issue 1706815
+* The :mod:`xmlrpclib` module no longer automatically converts
+ :class:`datetime.date` and :class:`datetime.time` to the
+ :class:`xmlrpclib.DateTime` type; the conversion semantics were
+ not necessarily correct for all applications. Code using
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ instances.
+
+ .. Issue 1330538
+
.. ======================================================================
Modified: python/branches/py3k/Lib/SimpleHTTPServer.py
==============================================================================
--- python/branches/py3k/Lib/SimpleHTTPServer.py (original)
+++ python/branches/py3k/Lib/SimpleHTTPServer.py Sat Feb 23 19:30:17 2008
@@ -14,7 +14,6 @@
import posixpath
import BaseHTTPServer
import urllib
-import urlparse
import cgi
import shutil
import mimetypes
Modified: python/branches/py3k/Lib/ctypes/test/__init__.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/__init__.py (original)
+++ python/branches/py3k/Lib/ctypes/test/__init__.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,4 @@
-import glob, os, sys, unittest, getopt, time
+import os, sys, unittest, getopt, time
use_resources = []
Modified: python/branches/py3k/Lib/ctypes/test/test_checkretval.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/test_checkretval.py (original)
+++ python/branches/py3k/Lib/ctypes/test/test_checkretval.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,4 @@
import unittest
-import sys
from ctypes import *
Modified: python/branches/py3k/Lib/ctypes/test/test_find.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/test_find.py (original)
+++ python/branches/py3k/Lib/ctypes/test/test_find.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,5 @@
import unittest
-import os, sys
+import sys
from ctypes import *
from ctypes.util import find_library
from ctypes.test import is_resource_enabled
Modified: python/branches/py3k/Lib/ctypes/test/test_libc.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/test_libc.py (original)
+++ python/branches/py3k/Lib/ctypes/test/test_libc.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,3 @@
-import sys, os
import unittest
from ctypes import *
Modified: python/branches/py3k/Lib/ctypes/test/test_numbers.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/test_numbers.py (original)
+++ python/branches/py3k/Lib/ctypes/test/test_numbers.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,6 @@
from ctypes import *
import unittest
-import sys, struct
+import struct
def valid_ranges(*types):
# given a sequence of numeric types, collect their _type_
Modified: python/branches/py3k/Lib/curses/wrapper.py
==============================================================================
--- python/branches/py3k/Lib/curses/wrapper.py (original)
+++ python/branches/py3k/Lib/curses/wrapper.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,7 @@
"""
-import sys, curses
+import curses
def wrapper(func, *args, **kwds):
"""Wrapper function that initializes curses and calls another function,
Modified: python/branches/py3k/Lib/distutils/bcppcompiler.py
==============================================================================
--- python/branches/py3k/Lib/distutils/bcppcompiler.py (original)
+++ python/branches/py3k/Lib/distutils/bcppcompiler.py Sat Feb 23 19:30:17 2008
@@ -14,7 +14,7 @@
__revision__ = "$Id$"
-import sys, os
+import os
from distutils.errors import \
DistutilsExecError, DistutilsPlatformError, \
CompileError, LibError, LinkError, UnknownFileError
Modified: python/branches/py3k/Lib/distutils/command/bdist_dumb.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/bdist_dumb.py (original)
+++ python/branches/py3k/Lib/distutils/command/bdist_dumb.py Sat Feb 23 19:30:17 2008
@@ -9,7 +9,7 @@
import os
from distutils.core import Command
from distutils.util import get_platform
-from distutils.dir_util import create_tree, remove_tree, ensure_relative
+from distutils.dir_util import remove_tree, ensure_relative
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log
Modified: python/branches/py3k/Lib/distutils/command/bdist_rpm.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/bdist_rpm.py (original)
+++ python/branches/py3k/Lib/distutils/command/bdist_rpm.py Sat Feb 23 19:30:17 2008
@@ -6,7 +6,6 @@
__revision__ = "$Id$"
import sys, os
-import glob
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.util import get_platform
Modified: python/branches/py3k/Lib/distutils/command/build_scripts.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/build_scripts.py (original)
+++ python/branches/py3k/Lib/distutils/command/build_scripts.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,7 @@
__revision__ = "$Id$"
-import sys, os, re
+import os, re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
Modified: python/branches/py3k/Lib/distutils/command/install.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/install.py (original)
+++ python/branches/py3k/Lib/distutils/command/install.py Sat Feb 23 19:30:17 2008
@@ -14,7 +14,6 @@
from distutils.file_util import write_file
from distutils.util import convert_path, subst_vars, change_root
from distutils.errors import DistutilsOptionError
-from glob import glob
if sys.version < "2.2":
WINDOWS_SCHEME = {
Modified: python/branches/py3k/Lib/distutils/command/install_headers.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/install_headers.py (original)
+++ python/branches/py3k/Lib/distutils/command/install_headers.py Sat Feb 23 19:30:17 2008
@@ -5,7 +5,6 @@
__revision__ = "$Id$"
-import os
from distutils.core import Command
Modified: python/branches/py3k/Lib/distutils/command/register.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/register.py (original)
+++ python/branches/py3k/Lib/distutils/command/register.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,7 @@
__revision__ = "$Id$"
-import sys, os, urllib2, getpass, urlparse
+import os, string, urllib2, getpass, urlparse
import io, ConfigParser
from distutils.core import Command
Modified: python/branches/py3k/Lib/distutils/filelist.py
==============================================================================
--- python/branches/py3k/Lib/distutils/filelist.py (original)
+++ python/branches/py3k/Lib/distutils/filelist.py Sat Feb 23 19:30:17 2008
@@ -8,7 +8,6 @@
import os, re
import fnmatch
-from glob import glob
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
Modified: python/branches/py3k/Lib/distutils/tests/test_dist.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_dist.py (original)
+++ python/branches/py3k/Lib/distutils/tests/test_dist.py Sat Feb 23 19:30:17 2008
@@ -3,10 +3,8 @@
import distutils.cmd
import distutils.dist
import os
-import shutil
import io
import sys
-import tempfile
import unittest
from test.test_support import TESTFN
Modified: python/branches/py3k/Lib/distutils/tests/test_sysconfig.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_sysconfig.py (original)
+++ python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Sat Feb 23 19:30:17 2008
@@ -2,7 +2,6 @@
from distutils import sysconfig
import os
-import sys
import unittest
from test.test_support import TESTFN
Modified: python/branches/py3k/Lib/distutils/unixccompiler.py
==============================================================================
--- python/branches/py3k/Lib/distutils/unixccompiler.py (original)
+++ python/branches/py3k/Lib/distutils/unixccompiler.py Sat Feb 23 19:30:17 2008
@@ -16,7 +16,6 @@
__revision__ = "$Id$"
import os, sys
-from copy import copy
from distutils import sysconfig
from distutils.dep_util import newer
Modified: python/branches/py3k/Lib/email/base64mime.py
==============================================================================
--- python/branches/py3k/Lib/email/base64mime.py (original)
+++ python/branches/py3k/Lib/email/base64mime.py Sat Feb 23 19:30:17 2008
@@ -35,7 +35,6 @@
'header_length',
]
-import re
from base64 import b64encode
from binascii import b2a_base64, a2b_base64
Modified: python/branches/py3k/Lib/httplib.py
==============================================================================
--- python/branches/py3k/Lib/httplib.py (original)
+++ python/branches/py3k/Lib/httplib.py Sat Feb 23 19:30:17 2008
@@ -66,7 +66,6 @@
Req-sent-unread-response _CS_REQ_SENT <response_class>
"""
-import errno
import io
import mimetools
import socket
Modified: python/branches/py3k/Lib/idlelib/MultiCall.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/MultiCall.py (original)
+++ python/branches/py3k/Lib/idlelib/MultiCall.py Sat Feb 23 19:30:17 2008
@@ -30,7 +30,6 @@
"""
import sys
-import os
import re
import Tkinter
Modified: python/branches/py3k/Lib/idlelib/RemoteDebugger.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/RemoteDebugger.py (original)
+++ python/branches/py3k/Lib/idlelib/RemoteDebugger.py Sat Feb 23 19:30:17 2008
@@ -20,7 +20,6 @@
"""
-import sys
import types
from idlelib import rpc
from idlelib import Debugger
Modified: python/branches/py3k/Lib/idlelib/TreeWidget.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/TreeWidget.py (original)
+++ python/branches/py3k/Lib/idlelib/TreeWidget.py Sat Feb 23 19:30:17 2008
@@ -15,7 +15,6 @@
# - optimize tree redraw after expand of subnode
import os
-import sys
from Tkinter import *
import imp
Modified: python/branches/py3k/Lib/idlelib/UndoDelegator.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/UndoDelegator.py (original)
+++ python/branches/py3k/Lib/idlelib/UndoDelegator.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,3 @@
-import sys
import string
from Tkinter import *
Modified: python/branches/py3k/Lib/idlelib/keybindingDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/keybindingDialog.py (original)
+++ python/branches/py3k/Lib/idlelib/keybindingDialog.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,7 @@
"""
from Tkinter import *
import tkMessageBox
-import string, os
+import string
class GetKeysDialog(Toplevel):
def __init__(self,parent,title,action,currentKeySequences):
Modified: python/branches/py3k/Lib/idlelib/run.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/run.py (original)
+++ python/branches/py3k/Lib/idlelib/run.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,4 @@
import sys
-import os
import linecache
import time
import socket
Modified: python/branches/py3k/Lib/lib-tk/tkSimpleDialog.py
==============================================================================
--- python/branches/py3k/Lib/lib-tk/tkSimpleDialog.py (original)
+++ python/branches/py3k/Lib/lib-tk/tkSimpleDialog.py Sat Feb 23 19:30:17 2008
@@ -26,7 +26,6 @@
'''
from Tkinter import *
-import os
class Dialog(Toplevel):
Modified: python/branches/py3k/Lib/logging/handlers.py
==============================================================================
--- python/branches/py3k/Lib/logging/handlers.py (original)
+++ python/branches/py3k/Lib/logging/handlers.py Sat Feb 23 19:30:17 2008
@@ -24,8 +24,7 @@
To use, simply 'import logging' and log away!
"""
-import sys, logging, socket, os, struct, time, glob
-import pickle
+import logging, socket, os, pickle, struct, time, glob
from stat import ST_DEV, ST_INO
try:
Modified: python/branches/py3k/Lib/ntpath.py
==============================================================================
--- python/branches/py3k/Lib/ntpath.py (original)
+++ python/branches/py3k/Lib/ntpath.py Sat Feb 23 19:30:17 2008
@@ -6,8 +6,8 @@
"""
import os
-import stat
import sys
+import stat
import genericpath
from genericpath import *
Modified: python/branches/py3k/Lib/plat-mac/MiniAEFrame.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/MiniAEFrame.py (original)
+++ python/branches/py3k/Lib/plat-mac/MiniAEFrame.py Sat Feb 23 19:30:17 2008
@@ -6,7 +6,6 @@
only suitable for the simplest of AppleEvent servers.
"""
-import sys
import traceback
import MacOS
from Carbon import AE
Modified: python/branches/py3k/Lib/plat-mac/aepack.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/aepack.py (original)
+++ python/branches/py3k/Lib/plat-mac/aepack.py Sat Feb 23 19:30:17 2008
@@ -20,7 +20,6 @@
import io
import aetypes
from aetypes import mkenum, ObjectSpecifier
-import os
# These ones seem to be missing from AppleEvents
# (they're in AERegistry.h)
Modified: python/branches/py3k/Lib/plat-mac/bgenlocations.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/bgenlocations.py (original)
+++ python/branches/py3k/Lib/plat-mac/bgenlocations.py Sat Feb 23 19:30:17 2008
@@ -5,7 +5,7 @@
# but mac-style for MacPython, whether running on OS9 or OSX.
#
-import sys, os
+import os
Error = "bgenlocations.Error"
#
Modified: python/branches/py3k/Lib/plat-mac/macostools.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/macostools.py (original)
+++ python/branches/py3k/Lib/plat-mac/macostools.py Sat Feb 23 19:30:17 2008
@@ -7,9 +7,7 @@
from Carbon import Res
from Carbon import File, Files
import os
-import sys
import MacOS
-import time
try:
openrf = MacOS.openrf
except AttributeError:
Modified: python/branches/py3k/Lib/sqlite3/test/hooks.py
==============================================================================
--- python/branches/py3k/Lib/sqlite3/test/hooks.py (original)
+++ python/branches/py3k/Lib/sqlite3/test/hooks.py Sat Feb 23 19:30:17 2008
@@ -21,7 +21,7 @@
# misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
-import os, unittest
+import unittest
import sqlite3 as sqlite
class CollationTests(unittest.TestCase):
Modified: python/branches/py3k/Lib/ssl.py
==============================================================================
--- python/branches/py3k/Lib/ssl.py (original)
+++ python/branches/py3k/Lib/ssl.py Sat Feb 23 19:30:17 2008
@@ -54,7 +54,7 @@
PROTOCOL_TLSv1
"""
-import os, sys, textwrap
+import textwrap
import _ssl # if we can't import it, let the error propagate
Modified: python/branches/py3k/Lib/test/fork_wait.py
==============================================================================
--- python/branches/py3k/Lib/test/fork_wait.py (original)
+++ python/branches/py3k/Lib/test/fork_wait.py Sat Feb 23 19:30:17 2008
@@ -10,7 +10,6 @@
"""
import os, sys, time, thread, unittest
-from test.test_support import TestSkipped
LONGSLEEP = 2
SHORTSLEEP = 0.5
Modified: python/branches/py3k/Lib/test/list_tests.py
==============================================================================
--- python/branches/py3k/Lib/test/list_tests.py (original)
+++ python/branches/py3k/Lib/test/list_tests.py Sat Feb 23 19:30:17 2008
@@ -5,7 +5,6 @@
import sys
import os
-import unittest
from test import test_support, seq_tests
def CmpToKey(mycmp):
Modified: python/branches/py3k/Lib/test/seq_tests.py
==============================================================================
--- python/branches/py3k/Lib/test/seq_tests.py (original)
+++ python/branches/py3k/Lib/test/seq_tests.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
"""
import unittest
-from test import test_support
import sys
# Various iterables
Modified: python/branches/py3k/Lib/test/test___all__.py
==============================================================================
--- python/branches/py3k/Lib/test/test___all__.py (original)
+++ python/branches/py3k/Lib/test/test___all__.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,5 @@
import unittest
-from test.test_support import verbose, run_unittest
+from test.test_support import run_unittest
import sys
Modified: python/branches/py3k/Lib/test/test_abc.py
==============================================================================
--- python/branches/py3k/Lib/test/test_abc.py (original)
+++ python/branches/py3k/Lib/test/test_abc.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
"""Unit tests for abc.py."""
-import sys
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_applesingle.py
==============================================================================
--- python/branches/py3k/Lib/test/test_applesingle.py (original)
+++ python/branches/py3k/Lib/test/test_applesingle.py Sat Feb 23 19:30:17 2008
@@ -5,7 +5,6 @@
import Carbon.File
import MacOS
import os
-import sys
from test import test_support
import struct
import applesingle
Modified: python/branches/py3k/Lib/test/test_class.py
==============================================================================
--- python/branches/py3k/Lib/test/test_class.py (original)
+++ python/branches/py3k/Lib/test/test_class.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
"Test the functionality of Python classes implementing operators."
import unittest
-import sys
from test import test_support
Modified: python/branches/py3k/Lib/test/test_cmd.py
==============================================================================
--- python/branches/py3k/Lib/test/test_cmd.py (original)
+++ python/branches/py3k/Lib/test/test_cmd.py Sat Feb 23 19:30:17 2008
@@ -5,7 +5,6 @@
"""
-from test import test_support
import cmd
import sys
import trace
Modified: python/branches/py3k/Lib/test/test_compare.py
==============================================================================
--- python/branches/py3k/Lib/test/test_compare.py (original)
+++ python/branches/py3k/Lib/test/test_compare.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,3 @@
-import sys
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_copy.py
==============================================================================
--- python/branches/py3k/Lib/test/test_copy.py (original)
+++ python/branches/py3k/Lib/test/test_copy.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
"""Unit tests for the copy module."""
-import sys
import copy
import copy_reg
Modified: python/branches/py3k/Lib/test/test_datetime.py
==============================================================================
--- python/branches/py3k/Lib/test/test_datetime.py (original)
+++ python/branches/py3k/Lib/test/test_datetime.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,6 @@
"""
import os
-import sys
import pickle
import unittest
Modified: python/branches/py3k/Lib/test/test_dbm.py
==============================================================================
--- python/branches/py3k/Lib/test/test_dbm.py (original)
+++ python/branches/py3k/Lib/test/test_dbm.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
Roger E. Masse
"""
import os
-import random
import dbm
from dbm import error
from test.test_support import verbose, verify, TestSkipped, TESTFN
Modified: python/branches/py3k/Lib/test/test_dis.py
==============================================================================
--- python/branches/py3k/Lib/test/test_dis.py (original)
+++ python/branches/py3k/Lib/test/test_dis.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,6 @@
# Minimal tests for dis module
-from test.test_support import verbose, run_unittest
+from test.test_support import run_unittest
import unittest
import sys
import dis
Modified: python/branches/py3k/Lib/test/test_dummy_threading.py
==============================================================================
--- python/branches/py3k/Lib/test/test_dummy_threading.py (original)
+++ python/branches/py3k/Lib/test/test_dummy_threading.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
# Create a bunch of threads, let each do some work, wait until all are done
from test.test_support import verbose
-import random
import dummy_threading as _threading
import time
Modified: python/branches/py3k/Lib/test/test_email.py
==============================================================================
--- python/branches/py3k/Lib/test/test_email.py (original)
+++ python/branches/py3k/Lib/test/test_email.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Copyright (C) 2001-2007 Python Software Foundation
# email package unit tests
-import unittest
# The specific tests now live in Lib/email/test
from email.test.test_email import suite
from test import test_support
Modified: python/branches/py3k/Lib/test/test_eof.py
==============================================================================
--- python/branches/py3k/Lib/test/test_eof.py (original)
+++ python/branches/py3k/Lib/test/test_eof.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
#! /usr/bin/env python
"""test script for a few new invalid token catches"""
-import os
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_extcall.py
==============================================================================
--- python/branches/py3k/Lib/test/test_extcall.py (original)
+++ python/branches/py3k/Lib/test/test_extcall.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,4 @@
-from test.test_support import verify, verbose, TestFailed, sortdict
+from test.test_support import verify, TestFailed, sortdict
from collections import UserDict, UserList
def e(a, b):
Modified: python/branches/py3k/Lib/test/test_fileinput.py
==============================================================================
--- python/branches/py3k/Lib/test/test_fileinput.py (original)
+++ python/branches/py3k/Lib/test/test_fileinput.py Sat Feb 23 19:30:17 2008
@@ -6,7 +6,7 @@
import unittest
from test.test_support import verbose, TESTFN, run_unittest
from test.test_support import unlink as safe_unlink
-import sys, os, re
+import sys, re
from io import StringIO
from fileinput import FileInput, hook_encoded
Modified: python/branches/py3k/Lib/test/test_fractions.py
==============================================================================
--- python/branches/py3k/Lib/test/test_fractions.py (original)
+++ python/branches/py3k/Lib/test/test_fractions.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,7 @@
"""Tests for Lib/fractions.py."""
from decimal import Decimal
-from test.test_support import run_unittest, verbose
+from test.test_support import run_unittest
import math
import operator
import fractions
Modified: python/branches/py3k/Lib/test/test_getargs2.py
==============================================================================
--- python/branches/py3k/Lib/test/test_getargs2.py (original)
+++ python/branches/py3k/Lib/test/test_getargs2.py Sat Feb 23 19:30:17 2008
@@ -1,8 +1,7 @@
import unittest
from test import test_support
-import sys
-import warnings, re
+import warnings
warnings.filterwarnings("ignore",
category=DeprecationWarning,
message=".*integer argument expected, got float",
Modified: python/branches/py3k/Lib/test/test_gzip.py
==============================================================================
--- python/branches/py3k/Lib/test/test_gzip.py (original)
+++ python/branches/py3k/Lib/test/test_gzip.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,7 @@
import unittest
from test import test_support
-import sys, os
+import os
import gzip
Modified: python/branches/py3k/Lib/test/test_htmlparser.py
==============================================================================
--- python/branches/py3k/Lib/test/test_htmlparser.py (original)
+++ python/branches/py3k/Lib/test/test_htmlparser.py Sat Feb 23 19:30:17 2008
@@ -2,7 +2,6 @@
import HTMLParser
import pprint
-import sys
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_httplib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_httplib.py (original)
+++ python/branches/py3k/Lib/test/test_httplib.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
import httplib
import io
-import sys
import socket
from unittest import TestCase
Modified: python/branches/py3k/Lib/test/test_imp.py
==============================================================================
--- python/branches/py3k/Lib/test/test_imp.py (original)
+++ python/branches/py3k/Lib/test/test_imp.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,4 @@
import imp
-import thread
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_index.py
==============================================================================
--- python/branches/py3k/Lib/test/test_index.py (original)
+++ python/branches/py3k/Lib/test/test_index.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
import unittest
from test import test_support
import operator
-import sys
maxsize = test_support.MAX_Py_ssize_t
minsize = -maxsize-1
Modified: python/branches/py3k/Lib/test/test_list.py
==============================================================================
--- python/branches/py3k/Lib/test/test_list.py (original)
+++ python/branches/py3k/Lib/test/test_list.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,3 @@
-import unittest
import sys
from test import test_support, list_tests
Modified: python/branches/py3k/Lib/test/test_minidom.py
==============================================================================
--- python/branches/py3k/Lib/test/test_minidom.py (original)
+++ python/branches/py3k/Lib/test/test_minidom.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
import os
import sys
import pickle
-import traceback
from io import StringIO
from test.test_support import verbose, run_unittest, TestSkipped
import unittest
@@ -791,6 +790,14 @@
"testNormalize -- single empty node removed")
doc.unlink()
+ def testBug1433694(self):
+ doc = parseString("<o><i/>t</o>")
+ node = doc.documentElement
+ node.childNodes[1].nodeValue = ""
+ node.normalize()
+ self.confirm(node.childNodes[-1].nextSibling == None,
+ "Final child's .nextSibling should be None")
+
def testSiblings(self):
doc = parseString("<doc><?pi?>text?<elm/></doc>")
root = doc.documentElement
Modified: python/branches/py3k/Lib/test/test_module.py
==============================================================================
--- python/branches/py3k/Lib/test/test_module.py (original)
+++ python/branches/py3k/Lib/test/test_module.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,6 @@
# Test the module type
import unittest
-from test.test_support import verbose, run_unittest
+from test.test_support import run_unittest
import sys
ModuleType = type(sys)
Modified: python/branches/py3k/Lib/test/test_modulefinder.py
==============================================================================
--- python/branches/py3k/Lib/test/test_modulefinder.py (original)
+++ python/branches/py3k/Lib/test/test_modulefinder.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,5 @@
import __future__
-import sys, os
+import os
import unittest
import distutils.dir_util
import tempfile
Modified: python/branches/py3k/Lib/test/test_multibytecodec_support.py
==============================================================================
--- python/branches/py3k/Lib/test/test_multibytecodec_support.py (original)
+++ python/branches/py3k/Lib/test/test_multibytecodec_support.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,7 @@
# Common Unittest Routines for CJK codecs
#
-import sys, codecs, os.path
+import sys, codecs
import unittest, re
from test import test_support
from io import BytesIO
Modified: python/branches/py3k/Lib/test/test_optparse.py
==============================================================================
--- python/branches/py3k/Lib/test/test_optparse.py (original)
+++ python/branches/py3k/Lib/test/test_optparse.py Sat Feb 23 19:30:17 2008
@@ -15,7 +15,6 @@
import unittest
from io import StringIO
-from pprint import pprint
from test import test_support
Modified: python/branches/py3k/Lib/test/test_ossaudiodev.py
==============================================================================
--- python/branches/py3k/Lib/test/test_ossaudiodev.py (original)
+++ python/branches/py3k/Lib/test/test_ossaudiodev.py Sat Feb 23 19:30:17 2008
@@ -1,14 +1,11 @@
from test import test_support
test_support.requires('audio')
-from test.test_support import verbose, findfile, TestSkipped
+from test.test_support import findfile, TestSkipped
import errno
-import fcntl
import ossaudiodev
-import os
import sys
-import select
import sunaudio
import time
import audioop
Modified: python/branches/py3k/Lib/test/test_pickle.py
==============================================================================
--- python/branches/py3k/Lib/test/test_pickle.py (original)
+++ python/branches/py3k/Lib/test/test_pickle.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,4 @@
import pickle
-import unittest
import io
from test import test_support
Modified: python/branches/py3k/Lib/test/test_pkg.py
==============================================================================
--- python/branches/py3k/Lib/test/test_pkg.py (original)
+++ python/branches/py3k/Lib/test/test_pkg.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,6 @@
import os
import tempfile
import textwrap
-import traceback
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_plistlib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_plistlib.py (original)
+++ python/branches/py3k/Lib/test/test_plistlib.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
import unittest
import plistlib
import os
-import time
import datetime
from test import test_support
Modified: python/branches/py3k/Lib/test/test_poll.py
==============================================================================
--- python/branches/py3k/Lib/test/test_poll.py (original)
+++ python/branches/py3k/Lib/test/test_poll.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,6 @@
# Test case for the os.poll() function
-import sys, os, select, random, unittest
+import os, select, random, unittest
from test.test_support import TestSkipped, TESTFN, run_unittest
try:
Modified: python/branches/py3k/Lib/test/test_posix.py
==============================================================================
--- python/branches/py3k/Lib/test/test_posix.py (original)
+++ python/branches/py3k/Lib/test/test_posix.py Sat Feb 23 19:30:17 2008
@@ -9,7 +9,6 @@
import time
import os
-import sys
import unittest
import warnings
warnings.filterwarnings('ignore', '.* potential security risk .*',
Modified: python/branches/py3k/Lib/test/test_pyclbr.py
==============================================================================
--- python/branches/py3k/Lib/test/test_pyclbr.py (original)
+++ python/branches/py3k/Lib/test/test_pyclbr.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,7 @@
Nick Mathewson
'''
from test.test_support import run_unittest
-import unittest, sys
+import sys
from types import FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
Modified: python/branches/py3k/Lib/test/test_resource.py
==============================================================================
--- python/branches/py3k/Lib/test/test_resource.py (original)
+++ python/branches/py3k/Lib/test/test_resource.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
import unittest
from test import test_support
-import os
import resource
import time
Modified: python/branches/py3k/Lib/test/test_rfc822.py
==============================================================================
--- python/branches/py3k/Lib/test/test_rfc822.py (original)
+++ python/branches/py3k/Lib/test/test_rfc822.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,4 @@
import rfc822
-import sys
import unittest
from test import test_support
Modified: python/branches/py3k/Lib/test/test_scriptpackages.py
==============================================================================
--- python/branches/py3k/Lib/test/test_scriptpackages.py (original)
+++ python/branches/py3k/Lib/test/test_scriptpackages.py Sat Feb 23 19:30:17 2008
@@ -1,9 +1,6 @@
# Copyright (C) 2003 Python Software Foundation
import unittest
-import os
-import sys
-import tempfile
from test import test_support
import aetools
Modified: python/branches/py3k/Lib/test/test_sgmllib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sgmllib.py (original)
+++ python/branches/py3k/Lib/test/test_sgmllib.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,3 @@
-import htmlentitydefs
import pprint
import re
import sgmllib
@@ -116,7 +115,7 @@
try:
events = self.get_events(source)
except:
- import sys
+ #import sys
#print >>sys.stderr, pprint.pformat(self.events)
raise
if events != expected_events:
Modified: python/branches/py3k/Lib/test/test_site.py
==============================================================================
--- python/branches/py3k/Lib/test/test_site.py (original)
+++ python/branches/py3k/Lib/test/test_site.py Sat Feb 23 19:30:17 2008
@@ -5,12 +5,11 @@
"""
import unittest
-from test.test_support import TestSkipped, TestFailed, run_unittest, TESTFN
+from test.test_support import TestSkipped, run_unittest, TESTFN
import builtins
import os
import sys
import encodings
-import tempfile
# Need to make sure to not import 'site' if someone specified ``-S`` at the
# command-line. Detect this by just making sure 'site' has not been imported
# already.
Modified: python/branches/py3k/Lib/test/test_socketserver.py
==============================================================================
--- python/branches/py3k/Lib/test/test_socketserver.py (original)
+++ python/branches/py3k/Lib/test/test_socketserver.py Sat Feb 23 19:30:17 2008
@@ -9,7 +9,6 @@
import select
import time
import threading
-from functools import wraps
import unittest
import SocketServer
Modified: python/branches/py3k/Lib/test/test_sqlite.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sqlite.py (original)
+++ python/branches/py3k/Lib/test/test_sqlite.py Sat Feb 23 19:30:17 2008
@@ -1,5 +1,4 @@
from test.test_support import run_unittest, TestSkipped
-import unittest
try:
import _sqlite3
Modified: python/branches/py3k/Lib/test/test_strftime.py
==============================================================================
--- python/branches/py3k/Lib/test/test_strftime.py (original)
+++ python/branches/py3k/Lib/test/test_strftime.py Sat Feb 23 19:30:17 2008
@@ -2,7 +2,7 @@
# Sanity checker for time.strftime
-import time, calendar, sys, os, re
+import time, calendar, sys, re
from test.test_support import verbose
def main():
Modified: python/branches/py3k/Lib/test/test_support.py
==============================================================================
--- python/branches/py3k/Lib/test/test_support.py (original)
+++ python/branches/py3k/Lib/test/test_support.py Sat Feb 23 19:30:17 2008
@@ -10,7 +10,6 @@
import os
import os.path
import warnings
-import types
import unittest
class Error(Exception):
Modified: python/branches/py3k/Lib/test/test_tuple.py
==============================================================================
--- python/branches/py3k/Lib/test/test_tuple.py (original)
+++ python/branches/py3k/Lib/test/test_tuple.py Sat Feb 23 19:30:17 2008
@@ -1,4 +1,3 @@
-import unittest
from test import test_support, seq_tests
class TupleTest(seq_tests.CommonTest):
Modified: python/branches/py3k/Lib/test/test_unpack.py
==============================================================================
--- python/branches/py3k/Lib/test/test_unpack.py (original)
+++ python/branches/py3k/Lib/test/test_unpack.py Sat Feb 23 19:30:17 2008
@@ -122,7 +122,6 @@
__test__ = {'doctests' : doctests}
def test_main(verbose=False):
- import sys
from test import test_support
from test import test_unpack
test_support.run_doctest(test_unpack, verbose)
Modified: python/branches/py3k/Lib/test/test_urllib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_urllib.py (original)
+++ python/branches/py3k/Lib/test/test_urllib.py Sat Feb 23 19:30:17 2008
@@ -8,10 +8,6 @@
import os
import mimetools
import tempfile
-import ftplib
-import threading
-import socket
-import time
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
Modified: python/branches/py3k/Lib/test/test_urllib2.py
==============================================================================
--- python/branches/py3k/Lib/test/test_urllib2.py (original)
+++ python/branches/py3k/Lib/test/test_urllib2.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,7 @@
import unittest
from test import test_support
-import os, socket
+import os
import io
import urllib2
@@ -584,7 +584,7 @@
self.assertEqual(int(headers["Content-length"]), len(data))
def test_file(self):
- import time, rfc822, socket
+ import rfc822, socket
h = urllib2.FileHandler()
o = h.parent = MockOpener()
@@ -988,7 +988,7 @@
def _test_basic_auth(self, opener, auth_handler, auth_header,
realm, http_handler, password_manager,
request_url, protected_url):
- import base64, httplib
+ import base64
user, password = "wile", "coyote"
# .add_password() fed through to password manager
Modified: python/branches/py3k/Lib/test/test_urllib2_localnet.py
==============================================================================
--- python/branches/py3k/Lib/test/test_urllib2_localnet.py (original)
+++ python/branches/py3k/Lib/test/test_urllib2_localnet.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-import sys
import threading
import urlparse
import urllib2
Modified: python/branches/py3k/Lib/test/test_userdict.py
==============================================================================
--- python/branches/py3k/Lib/test/test_userdict.py (original)
+++ python/branches/py3k/Lib/test/test_userdict.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
# Check every path through every method of UserDict
-import unittest
from test import test_support, mapping_tests
import collections
Modified: python/branches/py3k/Lib/test/test_userlist.py
==============================================================================
--- python/branches/py3k/Lib/test/test_userlist.py (original)
+++ python/branches/py3k/Lib/test/test_userlist.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Check every path through every method of UserList
from collections import UserList
-import unittest
from test import test_support, list_tests
class UserListTest(list_tests.CommonTest):
Modified: python/branches/py3k/Lib/test/test_userstring.py
==============================================================================
--- python/branches/py3k/Lib/test/test_userstring.py (original)
+++ python/branches/py3k/Lib/test/test_userstring.py Sat Feb 23 19:30:17 2008
@@ -2,7 +2,6 @@
# UserString is a wrapper around the native builtin string type.
# UserString instances should behave similar to builtin string objects.
-import unittest
import string
from test import test_support, string_tests
Modified: python/branches/py3k/Lib/test/test_whichdb.py
==============================================================================
--- python/branches/py3k/Lib/test/test_whichdb.py (original)
+++ python/branches/py3k/Lib/test/test_whichdb.py Sat Feb 23 19:30:17 2008
@@ -8,7 +8,6 @@
import unittest
import whichdb
import anydbm
-import tempfile
import glob
from test.test_anydbm import delete_files, dbm_iterator
Modified: python/branches/py3k/Lib/test/test_xml_etree.py
==============================================================================
--- python/branches/py3k/Lib/test/test_xml_etree.py (original)
+++ python/branches/py3k/Lib/test/test_xml_etree.py Sat Feb 23 19:30:17 2008
@@ -2,7 +2,8 @@
# all included components work as they should. For a more extensive
# test suite, see the selftest script in the ElementTree distribution.
-import doctest, sys
+import doctest
+import sys
from test import test_support
Modified: python/branches/py3k/Lib/test/test_xml_etree_c.py
==============================================================================
--- python/branches/py3k/Lib/test/test_xml_etree_c.py (original)
+++ python/branches/py3k/Lib/test/test_xml_etree_c.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,7 @@
# xml.etree test for cElementTree
-import doctest, sys
+import doctest
+import sys
from test import test_support
Modified: python/branches/py3k/Lib/test/test_xmlrpc.py
==============================================================================
--- python/branches/py3k/Lib/test/test_xmlrpc.py (original)
+++ python/branches/py3k/Lib/test/test_xmlrpc.py Sat Feb 23 19:30:17 2008
@@ -26,10 +26,6 @@
(2005, 2, 10, 11, 41, 23, 0, 1, -1)),
'datetime3': xmlrpclib.DateTime(
datetime.datetime(2005, 2, 10, 11, 41, 23)),
- 'datetime4': xmlrpclib.DateTime(
- datetime.date(2005, 2, 10)),
- 'datetime5': xmlrpclib.DateTime(
- datetime.time(11, 41, 23)),
}]
class XMLRPCTestCase(unittest.TestCase):
@@ -53,34 +49,14 @@
(newdt,), m = xmlrpclib.loads(s, use_datetime=0)
self.assertEquals(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
- def test_dump_bare_date(self):
- # This checks that an unwrapped datetime.date object can be handled
- # by the marshalling code. This can't be done via test_dump_load()
- # since the unmarshaller produces a datetime object
- d = datetime.datetime(2005, 2, 10, 11, 41, 23).date()
- s = xmlrpclib.dumps((d,))
- (newd,), m = xmlrpclib.loads(s, use_datetime=1)
- self.assertEquals(newd.date(), d)
- self.assertEquals(newd.time(), datetime.time(0, 0, 0))
- self.assertEquals(m, None)
-
- (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
- self.assertEquals(newdt, xmlrpclib.DateTime('20050210T00:00:00'))
-
- def test_dump_bare_time(self):
- # This checks that an unwrapped datetime.time object can be handled
- # by the marshalling code. This can't be done via test_dump_load()
- # since the unmarshaller produces a datetime object
- t = datetime.datetime(2005, 2, 10, 11, 41, 23).time()
- s = xmlrpclib.dumps((t,))
- (newt,), m = xmlrpclib.loads(s, use_datetime=1)
- today = datetime.datetime.now().date().strftime("%Y%m%d")
- self.assertEquals(newt.time(), t)
- self.assertEquals(newt.date(), datetime.datetime.now().date())
- self.assertEquals(m, None)
-
- (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
- self.assertEquals(newdt, xmlrpclib.DateTime('%sT11:41:23'%today))
+ def test_cmp_datetime_DateTime(self):
+ now = datetime.datetime.now()
+ dt = xmlrpclib.DateTime(now.timetuple())
+ self.assert_(dt == now)
+ self.assert_(now == dt)
+ then = now + datetime.timedelta(seconds=4)
+ self.assert_(then >= dt)
+ self.assert_(dt < then)
def test_bug_1164912 (self):
d = xmlrpclib.DateTime()
@@ -201,21 +177,6 @@
t = xmlrpclib.DateTime(d)
self.assertEqual(str(t), '20070102T03:04:05')
- def test_datetime_date(self):
- d = datetime.date(2007,9,8)
- t = xmlrpclib.DateTime(d)
- self.assertEqual(str(t), '20070908T00:00:00')
-
- def test_datetime_time(self):
- d = datetime.time(13,17,19)
- # allow for date rollover by checking today's or tomorrow's dates
- dd1 = datetime.datetime.now().date()
- dd2 = dd1 + datetime.timedelta(days=1)
- vals = (dd1.strftime('%Y%m%dT13:17:19'),
- dd2.strftime('%Y%m%dT13:17:19'))
- t = xmlrpclib.DateTime(d)
- self.assertEqual(str(t) in vals, True)
-
def test_repr(self):
d = datetime.datetime(2007,1,2,3,4,5)
t = xmlrpclib.DateTime(d)
Modified: python/branches/py3k/Lib/xml/dom/minidom.py
==============================================================================
--- python/branches/py3k/Lib/xml/dom/minidom.py (original)
+++ python/branches/py3k/Lib/xml/dom/minidom.py Sat Feb 23 19:30:17 2008
@@ -204,6 +204,8 @@
L.append(child)
if child.nodeType == Node.ELEMENT_NODE:
child.normalize()
+ if L:
+ L[-1].nextSibling = None
self.childNodes[:] = L
def cloneNode(self, deep):
Modified: python/branches/py3k/Lib/xmlrpclib.py
==============================================================================
--- python/branches/py3k/Lib/xmlrpclib.py (original)
+++ python/branches/py3k/Lib/xmlrpclib.py Sat Feb 23 19:30:17 2008
@@ -298,13 +298,6 @@
if datetime and isinstance(value, datetime.datetime):
self.value = value.strftime("%Y%m%dT%H:%M:%S")
return
- if datetime and isinstance(value, datetime.date):
- self.value = value.strftime("%Y%m%dT%H:%M:%S")
- return
- if datetime and isinstance(value, datetime.time):
- today = datetime.datetime.now().strftime("%Y%m%d")
- self.value = value.strftime(today+"T%H:%M:%S")
- return
if not isinstance(value, (tuple, time.struct_time)):
if value == 0:
value = time.time()
@@ -312,15 +305,57 @@
value = time.strftime("%Y%m%dT%H:%M:%S", value)
self.value = value
- def __eq__(self, other):
+ def make_comparable(self, other):
if isinstance(other, DateTime):
- other = other.value
- return self.value == other
+ s = self.value
+ o = other.value
+ elif datetime and isinstance(other, datetime.datetime):
+ s = self.value
+ o = other.strftime("%Y%m%dT%H:%M:%S")
+ elif isinstance(other, (str, unicode)):
+ s = self.value
+ o = other
+ elif hasattr(other, "timetuple"):
+ s = self.timetuple()
+ o = other.timetuple()
+ else:
+ otype = (hasattr(other, "__class__")
+ and other.__class__.__name__
+ or type(other))
+ raise TypeError("Can't compare %s and %s" %
+ (self.__class__.__name__, otype))
+ return s, o
+
+ def __lt__(self, other):
+ s, o = self.make_comparable(other)
+ return s < o
+
+ def __le__(self, other):
+ s, o = self.make_comparable(other)
+ return s <= o
+
+ def __gt__(self, other):
+ s, o = self.make_comparable(other)
+ return s > o
+
+ def __ge__(self, other):
+ s, o = self.make_comparable(other)
+ return s >= o
+
+ def __eq__(self, other):
+ s, o = self.make_comparable(other)
+ return s == o
def __ne__(self, other):
- if isinstance(other, DateTime):
- other = other.value
- return self.value != other
+ s, o = self.make_comparable(other)
+ return s != o
+
+ def timetuple(self):
+ return time.strptime(self.value, "%Y%m%dT%H:%M:%S")
+
+ def __cmp__(self, other):
+ s, o = self.make_comparable(other)
+ return cmp(s, o)
##
# Get date/time value.
@@ -669,19 +704,6 @@
write("</dateTime.iso8601></value>\n")
dispatch[datetime.datetime] = dump_datetime
- def dump_date(self, value, write):
- write("<value><dateTime.iso8601>")
- write(value.strftime("%Y%m%dT00:00:00"))
- write("</dateTime.iso8601></value>\n")
- dispatch[datetime.date] = dump_date
-
- def dump_time(self, value, write):
- write("<value><dateTime.iso8601>")
- write(datetime.datetime.now().date().strftime("%Y%m%dT"))
- write(value.strftime("%H:%M:%S"))
- write("</dateTime.iso8601></value>\n")
- dispatch[datetime.time] = dump_time
-
def dump_instance(self, value, write):
# check for special wrappers
if value.__class__ in WRAPPERS:
Modified: python/branches/py3k/Mac/Demo/PICTbrowse/ICONbrowse.py
==============================================================================
--- python/branches/py3k/Mac/Demo/PICTbrowse/ICONbrowse.py (original)
+++ python/branches/py3k/Mac/Demo/PICTbrowse/ICONbrowse.py Sat Feb 23 19:30:17 2008
@@ -7,8 +7,6 @@
from Carbon import Win
from Carbon import Controls
from Carbon import List
-import sys
-import struct
from Carbon import Icn
import macresource
Modified: python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse.py
==============================================================================
--- python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse.py (original)
+++ python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,6 @@
from Carbon import Win
from Carbon import Controls
from Carbon import List
-import sys
import struct
import macresource
Modified: python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse2.py
==============================================================================
--- python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse2.py (original)
+++ python/branches/py3k/Mac/Demo/PICTbrowse/PICTbrowse2.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,6 @@
from Carbon import Win
from Carbon import Controls
from Carbon import List
-import sys
import struct
import macresource
Modified: python/branches/py3k/Mac/Demo/PICTbrowse/cicnbrowse.py
==============================================================================
--- python/branches/py3k/Mac/Demo/PICTbrowse/cicnbrowse.py (original)
+++ python/branches/py3k/Mac/Demo/PICTbrowse/cicnbrowse.py Sat Feb 23 19:30:17 2008
@@ -7,8 +7,6 @@
from Carbon import Win
from Carbon import Controls
from Carbon import List
-import sys
-import struct
from Carbon import Icn
import macresource
Modified: python/branches/py3k/Mac/Demo/PICTbrowse/oldPICTbrowse.py
==============================================================================
--- python/branches/py3k/Mac/Demo/PICTbrowse/oldPICTbrowse.py (original)
+++ python/branches/py3k/Mac/Demo/PICTbrowse/oldPICTbrowse.py Sat Feb 23 19:30:17 2008
@@ -6,7 +6,6 @@
from Carbon import Qd
from Carbon import Win
from Carbon import List
-import sys
import struct
import macresource
Modified: python/branches/py3k/Mac/Demo/example1/dnslookup-1.py
==============================================================================
--- python/branches/py3k/Mac/Demo/example1/dnslookup-1.py (original)
+++ python/branches/py3k/Mac/Demo/example1/dnslookup-1.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,6 @@
import EasyDialogs
from Carbon import Res
from Carbon import Dlg
-import sys
import socket
import string
import macresource
Modified: python/branches/py3k/Mac/Demo/example2/dnslookup-2.py
==============================================================================
--- python/branches/py3k/Mac/Demo/example2/dnslookup-2.py (original)
+++ python/branches/py3k/Mac/Demo/example2/dnslookup-2.py Sat Feb 23 19:30:17 2008
@@ -2,7 +2,6 @@
import EasyDialogs
from Carbon import Res
from Carbon import Dlg
-import sys
import socket
import string
import macresource
Modified: python/branches/py3k/Mac/Demo/imgbrowse/imgbrowse.py
==============================================================================
--- python/branches/py3k/Mac/Demo/imgbrowse/imgbrowse.py (original)
+++ python/branches/py3k/Mac/Demo/imgbrowse/imgbrowse.py Sat Feb 23 19:30:17 2008
@@ -7,11 +7,9 @@
from Carbon import QuickDraw
from Carbon import Win
#ifrom Carbon mport List
-import sys
import struct
import img
import imgformat
-import struct
import mac_image
Modified: python/branches/py3k/Mac/Demo/imgbrowse/mac_image.py
==============================================================================
--- python/branches/py3k/Mac/Demo/imgbrowse/mac_image.py (original)
+++ python/branches/py3k/Mac/Demo/imgbrowse/mac_image.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
"""mac_image - Helper routines (hacks) for images"""
import imgformat
from Carbon import Qd
-import time
import struct
import MacOS
Modified: python/branches/py3k/Mac/Modules/ae/aescan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/ae/aescan.py (original)
+++ python/branches/py3k/Mac/Modules/ae/aescan.py Sat Feb 23 19:30:17 2008
@@ -3,8 +3,6 @@
# (Should learn how to tell the compiler to compile it as well.)
import sys
-import os
-import string
import MacOS
from bgenlocations import TOOLBOXDIR, BGENDIR
Modified: python/branches/py3k/Mac/Modules/ah/ahscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/ah/ahscan.py (original)
+++ python/branches/py3k/Mac/Modules/ah/ahscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
Modified: python/branches/py3k/Mac/Modules/app/appscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/app/appscan.py (original)
+++ python/branches/py3k/Mac/Modules/app/appscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/carbonevt/CarbonEvtscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/carbonevt/CarbonEvtscan.py (original)
+++ python/branches/py3k/Mac/Modules/carbonevt/CarbonEvtscan.py Sat Feb 23 19:30:17 2008
@@ -1,8 +1,6 @@
# IBCarbonscan.py
import sys
-import os
-import string
import MacOS
import sys
Modified: python/branches/py3k/Mac/Modules/cf/cfscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/cf/cfscan.py (original)
+++ python/branches/py3k/Mac/Modules/cf/cfscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
Modified: python/branches/py3k/Mac/Modules/cg/cgscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/cg/cgscan.py (original)
+++ python/branches/py3k/Mac/Modules/cg/cgscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
Modified: python/branches/py3k/Mac/Modules/cm/cmscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/cm/cmscan.py (original)
+++ python/branches/py3k/Mac/Modules/cm/cmscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/ctl/ctlscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/ctl/ctlscan.py (original)
+++ python/branches/py3k/Mac/Modules/ctl/ctlscan.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
# Scan <Controls.h>, generating ctlgen.py.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/dlg/dlgscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/dlg/dlgscan.py (original)
+++ python/branches/py3k/Mac/Modules/dlg/dlgscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/drag/dragscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/drag/dragscan.py (original)
+++ python/branches/py3k/Mac/Modules/drag/dragscan.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
# Scan <Drag.h>, generating draggen.py.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR, INCLUDEDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/evt/evtscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/evt/evtscan.py (original)
+++ python/branches/py3k/Mac/Modules/evt/evtscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/file/filescan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/file/filescan.py (original)
+++ python/branches/py3k/Mac/Modules/file/filescan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
Modified: python/branches/py3k/Mac/Modules/fm/fmscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/fm/fmscan.py (original)
+++ python/branches/py3k/Mac/Modules/fm/fmscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/folder/folderscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/folder/folderscan.py (original)
+++ python/branches/py3k/Mac/Modules/folder/folderscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
Modified: python/branches/py3k/Mac/Modules/help/helpscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/help/helpscan.py (original)
+++ python/branches/py3k/Mac/Modules/help/helpscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/ibcarbon/IBCarbonscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/ibcarbon/IBCarbonscan.py (original)
+++ python/branches/py3k/Mac/Modules/ibcarbon/IBCarbonscan.py Sat Feb 23 19:30:17 2008
@@ -1,8 +1,6 @@
# IBCarbonscan.py
import sys
-import os
-import string
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/icn/icnscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/icn/icnscan.py (original)
+++ python/branches/py3k/Mac/Modules/icn/icnscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/launch/launchscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/launch/launchscan.py (original)
+++ python/branches/py3k/Mac/Modules/launch/launchscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/list/listscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/list/listscan.py (original)
+++ python/branches/py3k/Mac/Modules/list/listscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/menu/menuscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/menu/menuscan.py (original)
+++ python/branches/py3k/Mac/Modules/menu/menuscan.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
# Scan <Menus.h>, generating menugen.py.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/mlte/mltescan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/mlte/mltescan.py (original)
+++ python/branches/py3k/Mac/Modules/mlte/mltescan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
Modified: python/branches/py3k/Mac/Modules/osa/osascan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/osa/osascan.py (original)
+++ python/branches/py3k/Mac/Modules/osa/osascan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/qd/qdscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/qd/qdscan.py (original)
+++ python/branches/py3k/Mac/Modules/qd/qdscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/qdoffs/qdoffsscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/qdoffs/qdoffsscan.py (original)
+++ python/branches/py3k/Mac/Modules/qdoffs/qdoffsscan.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/qt/qtscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/qt/qtscan.py (original)
+++ python/branches/py3k/Mac/Modules/qt/qtscan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/res/resscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/res/resscan.py (original)
+++ python/branches/py3k/Mac/Modules/res/resscan.py Sat Feb 23 19:30:17 2008
@@ -3,8 +3,6 @@
# (Should learn how to tell the compiler to compile it as well.)
import sys
-import os
-import string
import MacOS
from bgenlocations import TOOLBOXDIR, BGENDIR
Modified: python/branches/py3k/Mac/Modules/scrap/scrapscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/scrap/scrapscan.py (original)
+++ python/branches/py3k/Mac/Modules/scrap/scrapscan.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,6 @@
# generates a boilerplate to be edited by hand.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/snd/sndscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/snd/sndscan.py (original)
+++ python/branches/py3k/Mac/Modules/snd/sndscan.py Sat Feb 23 19:30:17 2008
@@ -3,7 +3,6 @@
# (Should learn how to tell the compiler to compile it as well.)
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Mac/Modules/te/tescan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/te/tescan.py (original)
+++ python/branches/py3k/Mac/Modules/te/tescan.py Sat Feb 23 19:30:17 2008
@@ -1,7 +1,6 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
Modified: python/branches/py3k/Mac/Modules/win/winscan.py
==============================================================================
--- python/branches/py3k/Mac/Modules/win/winscan.py (original)
+++ python/branches/py3k/Mac/Modules/win/winscan.py Sat Feb 23 19:30:17 2008
@@ -1,6 +1,5 @@
# Scan an Apple header file, generating a Python file of generator calls.
import sys
-import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
Modified: python/branches/py3k/Misc/ACKS
==============================================================================
--- python/branches/py3k/Misc/ACKS (original)
+++ python/branches/py3k/Misc/ACKS Sat Feb 23 19:30:17 2008
@@ -277,6 +277,7 @@
Jochen Hayek
Christian Heimes
Thomas Heller
+Malte Helmert
Lance Finn Helsten
Jonathan Hendry
James Henstridge
Modified: python/branches/py3k/Modules/syslogmodule.c
==============================================================================
--- python/branches/py3k/Modules/syslogmodule.c (original)
+++ python/branches/py3k/Modules/syslogmodule.c Sat Feb 23 19:30:17 2008
@@ -100,9 +100,10 @@
message = PyUnicode_AsString(message_object);
if (message == NULL)
return NULL;
+ Py_BEGIN_ALLOW_THREADS;
syslog(priority, "%s", message);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_END_ALLOW_THREADS;
+ Py_RETURN_NONE;
}
static PyObject *
Modified: python/branches/py3k/PC/VS8.0/build_tkinter.py
==============================================================================
--- python/branches/py3k/PC/VS8.0/build_tkinter.py (original)
+++ python/branches/py3k/PC/VS8.0/build_tkinter.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,6 @@
import os
import sys
-import shutil
here = os.path.abspath(os.path.dirname(__file__))
par = os.path.pardir
Modified: python/branches/py3k/PCbuild/build_tkinter.py
==============================================================================
--- python/branches/py3k/PCbuild/build_tkinter.py (original)
+++ python/branches/py3k/PCbuild/build_tkinter.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,6 @@
import os
import sys
-import shutil
here = os.path.abspath(os.path.dirname(__file__))
par = os.path.pardir
Modified: python/branches/py3k/Parser/asdl_c.py
==============================================================================
--- python/branches/py3k/Parser/asdl_c.py (original)
+++ python/branches/py3k/Parser/asdl_c.py Sat Feb 23 19:30:17 2008
@@ -4,7 +4,7 @@
# TO DO
# handle fields that have a type but no name
-import os, sys, traceback
+import os, sys
import asdl
Modified: python/branches/py3k/Parser/spark.py
==============================================================================
--- python/branches/py3k/Parser/spark.py (original)
+++ python/branches/py3k/Parser/spark.py Sat Feb 23 19:30:17 2008
@@ -22,7 +22,6 @@
__version__ = 'SPARK-0.7 (pre-alpha-5)'
import re
-import sys
# Compatability with older pythons.
def output(string='', end='\n'):
Modified: python/branches/py3k/Python/Python-ast.c
==============================================================================
--- python/branches/py3k/Python/Python-ast.c (original)
+++ python/branches/py3k/Python/Python-ast.c Sat Feb 23 19:30:17 2008
@@ -2,7 +2,7 @@
/*
- __version__ 57783.
+ __version__ 60978.
This module must be committed separately after each AST grammar change;
The __version__ number is set to the revision number of the commit
@@ -3171,7 +3171,7 @@
if (PyDict_SetItemString(d, "AST", (PyObject*)AST_type) < 0) return;
if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
return;
- if (PyModule_AddStringConstant(m, "__version__", "57783") < 0)
+ if (PyModule_AddStringConstant(m, "__version__", "60978") < 0)
return;
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return;
if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0)
Modified: python/branches/py3k/Python/import.c
==============================================================================
--- python/branches/py3k/Python/import.c (original)
+++ python/branches/py3k/Python/import.c Sat Feb 23 19:30:17 2008
@@ -833,7 +833,7 @@
/* Helper to open a bytecode file for writing in exclusive mode */
static FILE *
-open_exclusive(char *filename)
+open_exclusive(char *filename, mode_t mode)
{
#if defined(O_EXCL)&&defined(O_CREAT)&&defined(O_WRONLY)&&defined(O_TRUNC)
/* Use O_EXCL to avoid a race condition when another process tries to
@@ -849,9 +849,9 @@
|O_BINARY /* necessary for Windows */
#endif
#ifdef __VMS
- , 0666, "ctxt=bin", "shr=nil"
+ , mode, "ctxt=bin", "shr=nil"
#else
- , 0666
+ , mode
#endif
);
if (fd < 0)
@@ -870,11 +870,13 @@
remove the file. */
static void
-write_compiled_module(PyCodeObject *co, char *cpathname, time_t mtime)
+write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
{
FILE *fp;
+ time_t mtime = srcstat->st_mtime;
+ mode_t mode = srcstat->st_mode;
- fp = open_exclusive(cpathname);
+ fp = open_exclusive(cpathname, mode);
if (fp == NULL) {
if (Py_VerboseFlag)
PySys_WriteStderr(
@@ -911,17 +913,16 @@
static PyObject *
load_source_module(char *name, char *pathname, FILE *fp)
{
- time_t mtime;
+ struct stat st;
FILE *fpc;
char buf[MAXPATHLEN+1];
char *cpathname;
PyCodeObject *co;
PyObject *m;
-
- mtime = PyOS_GetLastModificationTime(pathname, fp);
- if (mtime == (time_t)(-1)) {
+
+ if (fstat(fileno(fp), &st) != 0) {
PyErr_Format(PyExc_RuntimeError,
- "unable to get modification time from '%s'",
+ "unable to get file status from '%s'",
pathname);
return NULL;
}
@@ -930,7 +931,7 @@
in 4 bytes. This will be fine until sometime in the year 2038,
when a 4-byte signed time_t will overflow.
*/
- if (mtime >> 32) {
+ if (st.st_mtime >> 32) {
PyErr_SetString(PyExc_OverflowError,
"modification time overflows a 4 byte field");
return NULL;
@@ -939,7 +940,7 @@
cpathname = make_compiled_pathname(pathname, buf,
(size_t)MAXPATHLEN + 1);
if (cpathname != NULL &&
- (fpc = check_compiled_module(pathname, mtime, cpathname))) {
+ (fpc = check_compiled_module(pathname, st.st_mtime, cpathname))) {
co = read_compiled_module(cpathname, fpc);
fclose(fpc);
if (co == NULL)
@@ -959,7 +960,7 @@
if (cpathname) {
PyObject *ro = PySys_GetObject("dont_write_bytecode");
if (ro == NULL || !PyObject_IsTrue(ro))
- write_compiled_module(co, cpathname, mtime);
+ write_compiled_module(co, cpathname, &st);
}
}
m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname);
Modified: python/branches/py3k/Python/mystrtoul.c
==============================================================================
--- python/branches/py3k/Python/mystrtoul.c (original)
+++ python/branches/py3k/Python/mystrtoul.c Sat Feb 23 19:30:17 2008
@@ -5,14 +5,6 @@
#define _SGI_MP_SOURCE
#endif
-/* Convert a possibly signed character to a nonnegative int */
-/* XXX This assumes characters are 8 bits wide */
-#ifdef __CHAR_UNSIGNED__
-#define Py_CHARMASK(c) (c)
-#else
-#define Py_CHARMASK(c) ((c) & 0xff)
-#endif
-
/* strtol and strtoul, renamed to avoid conflicts */
Modified: python/branches/py3k/Tools/faqwiz/faqw.py
==============================================================================
--- python/branches/py3k/Tools/faqwiz/faqw.py (original)
+++ python/branches/py3k/Tools/faqwiz/faqw.py Sat Feb 23 19:30:17 2008
@@ -20,7 +20,7 @@
try:
FAQDIR = "/usr/people/guido/python/FAQ"
SRCDIR = "/usr/people/guido/python/src/Tools/faqwiz"
- import os, sys, time, operator
+ import os, sys
os.chdir(FAQDIR)
sys.path.insert(0, SRCDIR)
import faqwiz
Modified: python/branches/py3k/Tools/modulator/Tkextra.py
==============================================================================
--- python/branches/py3k/Tools/modulator/Tkextra.py (original)
+++ python/branches/py3k/Tools/modulator/Tkextra.py Sat Feb 23 19:30:17 2008
@@ -218,7 +218,6 @@
0, 'Save', 'Save as text'))
def _test():
- import sys
global mainWidget
mainWidget = Frame()
Pack.config(mainWidget)
Modified: python/branches/py3k/Tools/pybench/systimes.py
==============================================================================
--- python/branches/py3k/Tools/pybench/systimes.py (original)
+++ python/branches/py3k/Tools/pybench/systimes.py Sat Feb 23 19:30:17 2008
@@ -31,7 +31,7 @@
the author. All Rights Reserved.
"""
-import time, sys, struct
+import time, sys
#
# Note: Please keep this module compatible to Python 1.5.2.
Modified: python/branches/py3k/Tools/pynche/ChipViewer.py
==============================================================================
--- python/branches/py3k/Tools/pynche/ChipViewer.py (original)
+++ python/branches/py3k/Tools/pynche/ChipViewer.py Sat Feb 23 19:30:17 2008
@@ -13,7 +13,6 @@
selected and nearest ChipWidgets.
"""
-from types import StringType
from Tkinter import *
import ColorDB
Modified: python/branches/py3k/Tools/pynche/TypeinViewer.py
==============================================================================
--- python/branches/py3k/Tools/pynche/TypeinViewer.py (original)
+++ python/branches/py3k/Tools/pynche/TypeinViewer.py Sat Feb 23 19:30:17 2008
@@ -12,8 +12,6 @@
you must hit Return or Tab to select the color.
"""
-import sys
-import re
from Tkinter import *
Modified: python/branches/py3k/Tools/scripts/logmerge.py
==============================================================================
--- python/branches/py3k/Tools/scripts/logmerge.py (original)
+++ python/branches/py3k/Tools/scripts/logmerge.py Sat Feb 23 19:30:17 2008
@@ -34,7 +34,7 @@
from their output.
"""
-import os, sys, errno, getopt, re
+import sys, errno, getopt, re
sep1 = '='*77 + '\n' # file separator
sep2 = '-'*28 + '\n' # revision separator
Modified: python/branches/py3k/Tools/scripts/nm2def.py
==============================================================================
--- python/branches/py3k/Tools/scripts/nm2def.py (original)
+++ python/branches/py3k/Tools/scripts/nm2def.py Sat Feb 23 19:30:17 2008
@@ -34,7 +34,7 @@
option to produce this format (since it is the original v7 Unix format).
"""
-import os,re,sys
+import os, sys
PYTHONLIB = 'libpython'+sys.version[:3]+'.a'
PC_PYTHONLIB = 'Python'+sys.version[0]+sys.version[2]+'.dll'
Modified: python/branches/py3k/Tools/scripts/pindent.py
==============================================================================
--- python/branches/py3k/Tools/scripts/pindent.py (original)
+++ python/branches/py3k/Tools/scripts/pindent.py Sat Feb 23 19:30:17 2008
@@ -81,7 +81,6 @@
TABSIZE = 8
EXPANDTABS = 0
-import os
import re
import sys
Modified: python/branches/py3k/Tools/scripts/pysource.py
==============================================================================
--- python/branches/py3k/Tools/scripts/pysource.py (original)
+++ python/branches/py3k/Tools/scripts/pysource.py Sat Feb 23 19:30:17 2008
@@ -20,7 +20,7 @@
__all__ = ["has_python_ext", "looks_like_python", "can_be_compiled", "walk_python_files"]
-import sys, os, re
+import os, re
binary_re = re.compile('[\x00-\x08\x0E-\x1F\x7F]')
Modified: python/branches/py3k/Tools/scripts/xxci.py
==============================================================================
--- python/branches/py3k/Tools/scripts/xxci.py (original)
+++ python/branches/py3k/Tools/scripts/xxci.py Sat Feb 23 19:30:17 2008
@@ -7,7 +7,6 @@
import sys
import os
from stat import *
-import commands
import fnmatch
EXECMAGIC = '\001\140\000\010'
Modified: python/branches/py3k/Tools/ssl/get-remote-certificate.py
==============================================================================
--- python/branches/py3k/Tools/ssl/get-remote-certificate.py (original)
+++ python/branches/py3k/Tools/ssl/get-remote-certificate.py Sat Feb 23 19:30:17 2008
@@ -6,7 +6,7 @@
#
# By Bill Janssen.
-import sys, os
+import sys
def fetch_server_certificate (host, port):
Modified: python/branches/py3k/Tools/unicode/gencodec.py
==============================================================================
--- python/branches/py3k/Tools/unicode/gencodec.py (original)
+++ python/branches/py3k/Tools/unicode/gencodec.py Sat Feb 23 19:30:17 2008
@@ -26,7 +26,7 @@
"""#"
-import re, os, time, marshal, codecs
+import re, os, marshal, codecs
# Maximum allowed size of charmap tables
MAX_TABLE_SIZE = 8192
Modified: python/branches/py3k/Tools/webchecker/wcgui.py
==============================================================================
--- python/branches/py3k/Tools/webchecker/wcgui.py (original)
+++ python/branches/py3k/Tools/webchecker/wcgui.py Sat Feb 23 19:30:17 2008
@@ -63,7 +63,6 @@
from Tkinter import *
import tktools
import webchecker
-import random
# Override some for a weaker platform
if sys.platform == 'mac':
Modified: python/branches/py3k/Tools/webchecker/wsgui.py
==============================================================================
--- python/branches/py3k/Tools/webchecker/wsgui.py (original)
+++ python/branches/py3k/Tools/webchecker/wsgui.py Sat Feb 23 19:30:17 2008
@@ -7,9 +7,7 @@
"""
from Tkinter import *
-import Tkinter
import websucker
-import sys
import os
import threading
import Queue
More information about the Python-3000-checkins
mailing list