[Python-checkins] cpython (merge default -> default): Branch merge
eric.araujo
python-checkins at python.org
Thu May 26 16:51:50 CEST 2011
http://hg.python.org/cpython/rev/04e7989e032c
changeset: 70414:04e7989e032c
parent: 70403:772d9825f154
parent: 70413:da1fbc125a32
user: Éric Araujo <merwok at netwok.org>
date: Thu May 26 16:35:14 2011 +0200
summary:
Branch merge
files:
Doc/documenting/style.rst | 4 ++--
Doc/library/site.rst | 4 ++++
Lib/html/parser.py | 2 +-
Lib/pkgutil.py | 2 +-
Lib/sysconfig.py | 5 ++---
Lib/test/test_sysconfig.py | 19 ++++---------------
Tools/scripts/findnocoding.py | 4 ++--
Tools/scripts/pysource.py | 2 +-
8 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/Doc/documenting/style.rst b/Doc/documenting/style.rst
--- a/Doc/documenting/style.rst
+++ b/Doc/documenting/style.rst
@@ -136,7 +136,7 @@
Economy of Expression
---------------------
-More documentation is not necessarily better documentation. Error on the side
+More documentation is not necessarily better documentation. Err on the side
of being succinct.
It is an unfortunate fact that making documentation longer can be an impediment
@@ -198,7 +198,7 @@
The tone of the tutorial (and all the docs) needs to be respectful of the
reader's intelligence. Don't presume that the readers are stupid. Lay out the
relevant information, show motivating use cases, provide glossary links, and do
-our best to connect-the-dots, but don't talk down to them or waste their time.
+your best to connect-the-dots, but don't talk down to them or waste their time.
The tutorial is meant for newcomers, many of whom will be using the tutorial to
evaluate the language as a whole. The experience needs to be positive and not
diff --git a/Doc/library/site.rst b/Doc/library/site.rst
--- a/Doc/library/site.rst
+++ b/Doc/library/site.rst
@@ -129,6 +129,10 @@
unless the :program:`python` interpreter was started with the :option:`-S`
flag.
+ .. versionchanged:: 3.3
+ This function used to be called unconditionnally.
+
+
.. function:: addsitedir(sitedir, known_paths=None)
Adds a directory to sys.path and processes its pth files.
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -124,7 +124,7 @@
_markupbase.ParserBase.reset(self)
def feed(self, data):
- """Feed data to the parser.
+ r"""Feed data to the parser.
Call this as often as you want, with as little or as much text
as you want (may include '\n').
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -8,7 +8,7 @@
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_loader',
- 'walk_packages', 'iter_modules',
+ 'walk_packages', 'iter_modules', 'get_data',
'ImpImporter', 'ImpLoader', 'read_code', 'extend_path',
]
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -658,11 +658,10 @@
# to. This makes the compatibility story a bit more sane because the
# machine is going to compile and link as if it were
# MACOSX_DEPLOYMENT_TARGET.
- #
cfgvars = get_config_vars()
macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
- if 1:
+ if True:
# Always calculate the release of the running machine,
# needed to determine if we can build fat binaries or not.
@@ -757,7 +756,7 @@
print('Platform: "%s"' % get_platform())
print('Python version: "%s"' % get_python_version())
print('Current installation scheme: "%s"' % _get_default_scheme())
- print('')
+ print()
_print_dict('Paths', get_paths())
print()
_print_dict('Variables', get_config_vars())
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -1,9 +1,3 @@
-"""Tests for 'site'.
-
-Tests assume the initial paths in sys.path once the interpreter has begun
-executing have not been removed.
-
-"""
import unittest
import sys
import os
@@ -20,10 +14,10 @@
_get_default_scheme, _expand_vars,
get_scheme_names, get_config_var, _main)
+
class TestSysConfig(unittest.TestCase):
def setUp(self):
- """Make a copy of sys.path"""
super(TestSysConfig, self).setUp()
self.sys_path = sys.path[:]
# patching os.uname
@@ -52,7 +46,6 @@
self._added_envvars.append(var)
def tearDown(self):
- """Restore sys.path"""
sys.path[:] = self.sys_path
self._cleanup_testfn()
if self.uname is not None:
@@ -142,8 +135,6 @@
('Darwin Kernel Version 8.11.1: '
'Wed Oct 10 18:23:28 PDT 2007; '
'root:xnu-792.25.20~1/RELEASE_I386'), 'PowerPC'))
-
-
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
@@ -158,7 +149,6 @@
finally:
sys.maxsize = maxint
-
self._set_uname(('Darwin', 'macziade', '8.11.1',
('Darwin Kernel Version 8.11.1: '
'Wed Oct 10 18:23:28 PDT 2007; '
@@ -216,9 +206,9 @@
get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
'/Developer/SDKs/MacOSX10.4u.sdk '
'-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3'%(arch,))
+ '-dynamic -DNDEBUG -g -O3' % arch)
- self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
+ self.assertEqual(get_platform(), 'macosx-10.4-%s' % arch)
# linux debian sarge
os.name = 'posix'
@@ -286,7 +276,6 @@
self.assertIn(ldflags, ldshared)
-
@unittest.skipUnless(sys.platform == "darwin", "test only relevant on MacOSX")
def test_platform_in_subprocess(self):
my_platform = sysconfig.get_platform()
@@ -312,7 +301,6 @@
self.assertEqual(status, 0)
self.assertEqual(my_platform, test_platform)
-
# Test with MACOSX_DEPLOYMENT_TARGET in the environment, and
# using a value that is unlikely to be the default one.
env = os.environ.copy()
@@ -334,6 +322,7 @@
class MakefileTests(unittest.TestCase):
+
@unittest.skipIf(sys.platform.startswith('win'),
'Test is not Windows compatible')
def test_get_makefile_filename(self):
diff --git a/Tools/scripts/findnocoding.py b/Tools/scripts/findnocoding.py
--- a/Tools/scripts/findnocoding.py
+++ b/Tools/scripts/findnocoding.py
@@ -2,7 +2,7 @@
"""List all those Python files that require a coding directive
-Usage: nocoding.py dir1 [dir2...]
+Usage: findnocoding.py dir1 [dir2...]
"""
__author__ = "Oleg Broytmann, Georg Brandl"
@@ -50,7 +50,7 @@
def needs_declaration(fullpath):
try:
- infile = open(fullpath, 'rU')
+ infile = open(fullpath)
except IOError: # Oops, the file was removed - ignore it
return None
diff --git a/Tools/scripts/pysource.py b/Tools/scripts/pysource.py
--- a/Tools/scripts/pysource.py
+++ b/Tools/scripts/pysource.py
@@ -42,7 +42,7 @@
return None
try:
- return open(fullpath, 'rU')
+ return open(fullpath)
except IOError as err: # Access denied, or a special file - ignore it
print_debug("%s: access denied: %s" % (fullpath, err))
return None
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list