File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1702,10 +1702,10 @@ features:
1702
1702
.. function :: get_current_dir_name()
1703
1703
1704
1704
Return a string representing the current working directory taking into
1705
- consideration the users `` PWD ` ` environment variable if it exists. This is
1706
- opposed to :func: `getcwd() ` which dereferences symlinks in the path. This
1707
- function is identical to :func: `getcwd() ` on systems that do **not **
1708
- support the `` PWD ` ` environment variable.
1705
+ consideration the users :envvar: ` PWD ` environment variable if it exists. This is
1706
+ opposed to :func: `getcwd ` which dereferences symlinks in the path. This
1707
+ function is identical to :func: `getcwd ` on systems that do **not **
1708
+ support the :envvar: ` PWD ` environment variable.
1709
1709
1710
1710
.. versionadded :: 3.8
1711
1711
Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ by right-clicking the button. (Contributed by Tal Einat in :issue:`1529353`.)
141
141
The changes above have been backported to 3.7 maintenance releases.
142
142
143
143
144
+ os
145
+ --
146
+
147
+ Added :func: `~os.get_current_dir_name ` function.
148
+ (Contributed by Braden Groom in :issue: `1154351 `.)
149
+
144
150
os.path
145
151
-------
146
152
Original file line number Diff line number Diff line change @@ -660,15 +660,12 @@ def get_current_dir_name():
660
660
the *PWD* environment variable.
661
661
"""
662
662
cwd = getcwd ()
663
-
664
663
if name == 'nt' :
665
664
return cwd
666
-
667
665
try :
668
666
pwd = environ ["PWD" ]
669
667
except KeyError :
670
668
return cwd
671
-
672
669
if path .samefile (cwd , pwd ):
673
670
return pwd
674
671
return cwd
Original file line number Diff line number Diff line change 1
1
Add get_current_dir_name() to the os module.
2
+ Patch by Braden Groom
You can’t perform that action at this time.
0 commit comments