]> granicus.if.org Git - python/commitdiff
Issue #7759: Fixed the mhlib module on filesystems that doesn't support
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 11 Nov 2015 15:33:12 +0000 (17:33 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 11 Nov 2015 15:33:12 +0000 (17:33 +0200)
link counting for directories.

Lib/mhlib.py
Misc/NEWS

index 856e87804cd968ca90a21e27c5be22e30236c1ce..46311fc20fc47ed0d7b2a331db485d39ecf1f43b 100644 (file)
@@ -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
index 0c7e52b5fea7339f85805fd8e4c696e6be29ea5a..265d2cf96a2615d11aea07ba36759f79bd8bc6e4 100644 (file)
--- 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