diff options
author | Éric Araujo <merwok@netwok.org> | 2011-05-26 14:35:14 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-05-26 14:35:14 (GMT) |
commit | f46676d48fe0e06ee76c6158cb915c20e8751ced (patch) | |
tree | bd77e24b11f2a378e60ff432ef9f0330dfb3f82f | |
parent | 92236e5651ade38b31281ed92e2c2846f8ccd0d8 (diff) | |
parent | aa1ef2d735772b7a4c4b4164998da2883208ea48 (diff) | |
download | cpython-f46676d48fe0e06ee76c6158cb915c20e8751ced.zip cpython-f46676d48fe0e06ee76c6158cb915c20e8751ced.tar.gz cpython-f46676d48fe0e06ee76c6158cb915c20e8751ced.tar.bz2 |
Branch merge
-rw-r--r-- | Doc/documenting/style.rst | 4 | ||||
-rw-r--r-- | Doc/library/site.rst | 4 | ||||
-rw-r--r-- | Lib/html/parser.py | 2 | ||||
-rw-r--r-- | Lib/pkgutil.py | 2 | ||||
-rw-r--r-- | Lib/sysconfig.py | 5 | ||||
-rw-r--r-- | Lib/test/test_sysconfig.py | 19 | ||||
-rwxr-xr-x | Tools/scripts/findnocoding.py | 4 | ||||
-rw-r--r-- | Tools/scripts/pysource.py | 2 |
8 files changed, 17 insertions, 25 deletions
diff --git a/Doc/documenting/style.rst b/Doc/documenting/style.rst index 1fdc139..71a52f2 100644 --- a/Doc/documenting/style.rst +++ b/Doc/documenting/style.rst @@ -136,7 +136,7 @@ Good example (establishing confident knowledge in the effective use of the langu 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 @@ Audience 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 index 23ce465..46bd5dc 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -129,6 +129,10 @@ empty, and the path manipulations are skipped; however the import of 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 index a3586eb..9412280 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -124,7 +124,7 @@ class HTMLParser(_markupbase.ParserBase): _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 index b0cefee..2dd20cd 100644 --- a/Lib/pkgutil.py +++ b/Lib/pkgutil.py @@ -8,7 +8,7 @@ from types import ModuleType __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 index 63becb2..d07784d 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -658,11 +658,10 @@ def get_platform(): # 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 @@ def _main(): 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 index 5c84a75..96f75f2 100644 --- 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 @@ from sysconfig import (get_paths, get_platform, get_config_vars, _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 @@ class TestSysConfig(unittest.TestCase): 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 @@ class TestSysConfig(unittest.TestCase): ('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 @@ class TestSysConfig(unittest.TestCase): 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 @@ class TestSysConfig(unittest.TestCase): 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 @@ class TestSysConfig(unittest.TestCase): 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 @@ class TestSysConfig(unittest.TestCase): 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 TestSysConfig(unittest.TestCase): 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 index 77607ce..c42fa7c 100755 --- 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 has_correct_encoding(text, codec): 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 index 048131e..c7dbe60 100644 --- a/Tools/scripts/pysource.py +++ b/Tools/scripts/pysource.py @@ -42,7 +42,7 @@ def _open(fullpath): 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 |