8000 Replace with `nt._path_abspath` · python/cpython@a538218 · GitHub
[go: up one dir, main page]

Skip to content

Commit a538218

Browse files
committed
Replace with nt._path_abspath
1 parent 111df43 commit a538218

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Lib/ctypes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def __init__(self, name, mode=DEFAULT_MODE, handle=None,
380380
import nt
381381
mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
382382
if '/' in name or '\\' in name:
383-
self._name = nt._getfullpathname(self._name)
383+
self._name = nt._path_abspath(self._name)
384384
mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
385385

386386
class _FuncPtr(_CFuncPtr):

Lib/ntpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def normpath(path):
583583

584584
def _abspath_fallback(path):
585585
"""Return the absolute version of a path as a fallback function in case
586-
`nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
586+
`nt._path_abspath` is not available or raises OSError. See bpo-31047 for
587587
more.
588588
589589
"""

Lib/test/test_ctypes/test_loading.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ def should_fail(command):
188188
should_pass("windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)")
189189

190190
# Full path load without DLL_LOAD_DIR shouldn't find dependency
191-
should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +
191+
should_fail("WinDLL(nt._path_abspath('_sqlite3.dll'), " +
192192
"winmode=nt._LOAD_LIBRARY_SEARCH_SYSTEM32)")
193193

194194
# Full path load with DLL_LOAD_DIR should succeed
195-
should_pass("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +
195+
should_pass("WinDLL(nt._path_abspath('_sqlite3.dll'), " +
196196
"winmode=nt._LOAD_LIBRARY_SEARCH_SYSTEM32|" +
197197
"nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)")
198198

0 commit comments

Comments
 (0)
0