Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
cpython
Commits
11db64e5
Commit
11db64e5
authored
15 years ago
by
Nick Coghlan
Browse files
Options
Download
Email Patches
Plain Diff
Issue #7328: don't corrupt sys.path when running pydoc with the -m switch
parent
ccd5e02d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Lib/pydoc.py
Lib/pydoc.py
+7
-5
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/pydoc.py
View file @
11db64e5
...
...
@@ -2254,11 +2254,13 @@ def cli():
import
getopt
class
BadUsage
:
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'
)
...
...
This diff is collapsed.
Click to expand it.
Misc/NEWS
View file @
11db64e5
...
...
@@ -429,6 +429,8 @@ Core and Builtins
Library
-------
- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch
- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using
TLS or SSL. Patch by Giampaolo Rodola'.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment