link counting for directories.
# Get the link count so we can avoid listing folders
# that have no subfolders.
nlinks = os.stat(fullname).st_nlink
- if nlinks <= 2:
+ if nlinks == 2:
return []
subfolders = []
subnames = os.listdir(fullname)
# Stop looking for subfolders when
# we've seen them all
nlinks = nlinks - 1
- if nlinks <= 2:
+ if nlinks == 2:
break
subfolders.sort()
return subfolders
# Get the link count so we can avoid listing folders
# that have no subfolders.
nlinks = os.stat(fullname).st_nlink
- if nlinks <= 2:
+ if nlinks == 2:
return []
subfolders = []
subnames = os.listdir(fullname)
# Stop looking for subfolders when
# we've seen them all
nlinks = nlinks - 1
- if nlinks <= 2:
+ if nlinks == 2:
break
subfolders.sort()
return subfolders
Library
-------
+- Issue #7759: Fixed the mhlib module on filesystems that doesn't support
+ link counting for directories.
+
- Issue #892902: Fixed pickling recursive objects.
- Issue #18010: Fix the pydoc GUI's search function to handle exceptions