summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-11 15:33:12 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-11 15:33:12 (GMT)
commitc54b8ceb91306359d1b7eb2c4c4ae356a8a0a271 (patch)
treebb31e568f3fa736049b6a49a6ea0ea2baf766590
parent9665cca16d031b929d1c652654870657aeb127f4 (diff)
downloadcpython-c54b8ceb91306359d1b7eb2c4c4ae356a8a0a271.zip
cpython-c54b8ceb91306359d1b7eb2c4c4ae356a8a0a271.tar.gz
cpython-c54b8ceb91306359d1b7eb2c4c4ae356a8a0a271.tar.bz2
Issue #7759: Fixed the mhlib module on filesystems that doesn't support
link counting for directories.
-rw-r--r--Lib/mhlib.py8
-rw-r--r--Misc/NEWS3
2 files changed, 7 insertions, 4 deletions
diff --git a/Lib/mhlib.py b/Lib/mhlib.py
index 856e878..46311fc 100644
--- a/Lib/mhlib.py
+++ b/Lib/mhlib.py
@@ -159,7 +159,7 @@ class MH:
# 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)
@@ -171,7 +171,7 @@ class MH:
# Stop looking for subfolders when
# we've seen them all
nlinks = nlinks - 1
- if nlinks <= 2:
+ if nlinks == 2:
break
subfolders.sort()
return subfolders
@@ -186,7 +186,7 @@ class MH:
# 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)
@@ -203,7 +203,7 @@ class MH:
# Stop looking for subfolders when
# we've seen them all
nlinks = nlinks - 1
- if nlinks <= 2:
+ if nlinks == 2:
break
subfolders.sort()
return subfolders
diff --git a/Misc/NEWS b/Misc/NEWS
index 0c7e52b..265d2cf 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -49,6 +49,9 @@ Core and Builtins
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