Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1a5c4bd

Browse files
authored
bpo-33185: Improve wording and markup (GH-6477)
Adds some working and markup fixes that I missedin the initial commit for this issue.(Follow-up toGH-6419)
1 parent82a9481 commit1a5c4bd

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

‎Doc/whatsnew/3.7.rst‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,13 @@ Changes in Python behavior
11441144
parentheses can be omitted only on calls.
11451145
(Contributed by Serhiy Storchaka in:issue:`32012` and:issue:`32023`.)
11461146

1147-
* When using the ``-m`` switch, the starting directory is now added to sys.path,
1148-
rather than the current working directory. Any programs that are checking for
1149-
the empty string in:data:`sys.path`, or otherwise relying on the previous
1150-
behaviour, will need to be updated accordingly (e.g. by checking for
1151-
``os.getcwd()`` in addition to checking for the empty string).
1147+
* When using the:option:`-m` switch, the initial working directory is now added
1148+
to:data:`sys.path`, rather than an empty string (which dynamically denoted
1149+
the current working directory at the time of each import). Any programs that
1150+
are checking for the empty string, or otherwise relying on the previous
1151+
behaviour, will need to be updated accordingly (e.g. by also checking for
1152+
``os.getcwd()`` or ``os.path.dirname(__main__.__file__)``, depending on why
1153+
the code was checking for the empty string in the first place).
11521154

11531155

11541156
Changes in the Python API

‎Lib/pydoc.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,7 @@ def _get_revised_path(given_path, argv0):
26432643

26442644
# Note: the tests only cover _get_revised_path, not _adjust_cli_path itself
26452645
def_adjust_cli_sys_path():
2646-
"""Ensures current directory is on sys.path, and __main__ directory is not
2646+
"""Ensures current directory is on sys.path, and __main__ directory is not.
26472647
26482648
Exception: __main__ dir is left alone if it's also pydoc's directory.
26492649
"""

‎Lib/test/test_pydoc.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ def _get_revised_path(self, given_path, argv0=None):
11031103
returnpydoc._get_revised_path(given_path,argv0)
11041104

11051105
def_get_starting_path(self):
1106-
# Get a copy of sys.path without the current directory
1106+
# Get a copy of sys.path without the current directory.
11071107
clean_path=sys.path.copy()
11081108
forspellinginself.curdir_spellings:
11091109
for__inrange(clean_path.count(spelling)):
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Fixed regression when running pydoc with the``-m`` switch. (The regression
2-
was introduced in 3.7.0b3 by the resolution ofbpo-33053)
1+
Fixed regression when running pydoc with the:option:`-m` switch. (The regression
2+
was introduced in 3.7.0b3 by the resolution of:issue:`33053`)
33

4-
This fix also changed pydoc to add ``os.getcwd()`` to``sys.path`` when
4+
This fix also changed pydoc to add ``os.getcwd()`` to:data:`sys.path` when
55
necessary, rather than adding ``"."``.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp