From a4e2d4fcf15e5973df1f0035a94b086b72b55443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Mon, 2 May 2011 22:59:15 +0200 Subject: Add missing name in pkgutil.__all__ --- Lib/pkgutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py index 0ec6ec5..e2d630a 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', ] -- cgit v0.12 From 39f180bb1f5407b89ed40c840fe0356566995da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Wed, 4 May 2011 15:55:47 +0200 Subject: Fix display of html.parser.HTMLParser.feed docstring --- Lib/html/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/html/parser.py b/Lib/html/parser.py index 3f68e18..bef5c3c 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -99,7 +99,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'). -- cgit v0.12 From 1e794f66f4503561f651547d08653d8ee3a87c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Thu, 5 May 2011 20:18:16 +0200 Subject: Remove obsolete 'rU' mode in Tools/scripts too (see be5b8d1ded34) --- Tools/scripts/findnocoding.py | 4 ++-- Tools/scripts/pysource.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- cgit v0.12 From 17b60f0367db0ae8cd6d4ce6a6ea8330b4802029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 6 May 2011 18:50:08 +0200 Subject: Also add versionchanged directive to the function doc (#11591) --- Doc/library/site.rst | 4 ++++ 1 file changed, 4 insertions(+) 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. -- cgit v0.12 From d4701f426261b93fa528712c0c44426bccdfed41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Wed, 25 May 2011 18:13:29 +0200 Subject: Fix two typos --- Doc/documenting/style.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/documenting/style.rst b/Doc/documenting/style.rst index ade845c..2548cb0 100644 --- a/Doc/documenting/style.rst +++ b/Doc/documenting/style.rst @@ -135,7 +135,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 @@ -197,7 +197,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 -- cgit v0.12 From 559b5f1ca0a5dec9d485f01895b61e3d7da5075c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Wed, 25 May 2011 18:21:43 +0200 Subject: Minor cleanup in sysconfig. Also remove outdated and unhelpful docstrings in test_sysconfig. --- Lib/sysconfig.py | 5 ++--- Lib/test/test_sysconfig.py | 15 --------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 4c1fd1b..59073f4 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -656,11 +656,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. @@ -755,7 +754,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 214fc70..77c2364 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 @@ -23,7 +17,6 @@ from sysconfig import (get_paths, get_platform, get_config_vars, class TestSysConfig(unittest.TestCase): def setUp(self): - """Make a copy of sys.path""" super(TestSysConfig, self).setUp() self.sys_path = sys.path[:] self.makefile = None @@ -53,7 +46,6 @@ class TestSysConfig(unittest.TestCase): self._added_envvars.append(var) def tearDown(self): - """Restore sys.path""" sys.path[:] = self.sys_path if self.makefile is not None: os.unlink(self.makefile) @@ -145,8 +137,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 ' @@ -161,7 +151,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; ' @@ -295,7 +284,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() @@ -321,7 +309,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() @@ -342,8 +329,6 @@ class TestSysConfig(unittest.TestCase): self.assertEqual(my_platform, test_platform) - - def test_main(): run_unittest(TestSysConfig) -- cgit v0.12