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