
python-checkins at python
Nov 15, 2009, 4:20 PM
Post #1 of 1
(116 views)
Permalink
|
|
r76315 - in python/branches/release31-maint: Lib/pydoc.py Misc/NEWS
|
|
Author: nick.coghlan Date: Mon Nov 16 00:27:31 2009 New Revision: 76315 Log: Recorded merge of revisions 76314 via svnmerge from svn+ssh://pythondev [at] svn/python/branches/py3k ................ r76314 | nick.coghlan | 2009-11-16 09:04:33 +1000 (Mon, 16 Nov 2009) | 9 lines Merged revisions 76312 via svnmerge from svn+ssh://pythondev [at] svn/python/trunk ........ r76312 | nick.coghlan | 2009-11-16 08:36:47 +1000 (Mon, 16 Nov 2009) | 1 line Issue #7328: don't corrupt sys.path when running pydoc with the -m switch ........ ................ Modified: python/branches/release31-maint/ (props changed) python/branches/release31-maint/Lib/pydoc.py python/branches/release31-maint/Misc/NEWS Modified: python/branches/release31-maint/Lib/pydoc.py ============================================================================== --- python/branches/release31-maint/Lib/pydoc.py (original) +++ python/branches/release31-maint/Lib/pydoc.py Mon Nov 16 00:27:31 2009 @@ -2249,11 +2249,13 @@ import getopt class BadUsage(Exception): pass - # Scripts don't get the current directory in their path by default. - scriptdir = os.path.dirname(sys.argv[0]) - if scriptdir in sys.path: - sys.path.remove(scriptdir) - sys.path.insert(0, '.') + # Scripts don't get the current directory in their path by default + # unless they are run with the '-m' switch + if '' not in sys.path: + scriptdir = os.path.dirname(sys.argv[0]) + if scriptdir in sys.path: + sys.path.remove(scriptdir) + sys.path.insert(0, '.') try: opts, args = getopt.getopt(sys.argv[1:], 'gk:p:w') Modified: python/branches/release31-maint/Misc/NEWS ============================================================================== --- python/branches/release31-maint/Misc/NEWS (original) +++ python/branches/release31-maint/Misc/NEWS Mon Nov 16 00:27:31 2009 @@ -46,6 +46,8 @@ Library ------- +- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch + - Issue #7318: multiprocessing now uses a timeout when it fails to establish a connection with another process, rather than looping endlessly. The default timeout is 20 seconds, which should be amply sufficient for _______________________________________________ Python-checkins mailing list Python-checkins [at] python http://mail.python.org/mailman/listinfo/python-checkins
|