Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename Path.scandir() to Path._scandir()
  • Loading branch information
barneygale committed Jan 1, 2022
commit 613a1718b474b8f7401edebdb8fa40af940d7299
6 changes: 3 additions & 3 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def __init__(self, pat, child_parts, flavour):

def _select_from(self, parent_path, is_dir, exists):
try:
with parent_path.scandir() as scandir_it:
with parent_path._scandir() as scandir_it:
Comment thread
barneygale marked this conversation as resolved.
Outdated
entries = list(scandir_it)
for entry in entries:
if self.dironly:
Expand Down Expand Up @@ -380,7 +380,7 @@ def __init__(self, pat, child_parts, flavour):
def _iterate_directories(self, parent_path, is_dir):
yield parent_path
try:
with parent_path.scandir() as scandir_it:
with parent_path._scandir() as scandir_it:
entries = list(scandir_it)
for entry in entries:
entry_is_dir = False
Expand Down Expand Up @@ -929,7 +929,7 @@ def iterdir(self):
continue
yield self._make_child_relpath(name)

def scandir(self):
def _scandir(self):
return os.scandir(self)

def glob(self, pattern):
Expand Down