# HG changeset patch -- Bitbucket.org
# Project pylib
# URL http://bitbucket.org/hpk42/pylib/overview
# User holger krekel <hol...@merlinux.eu>
# Date 1289147700 -3600
# Node ID 64c4901145ffb29356f00cbdd4aea35fce9474c2
# Parent  50db633de97b3626c0a07fbe8911856e2c14988b
fix recursion handling (failed on windows)

--- a/py/_path/common.py
+++ b/py/_path/common.py
@@ -327,13 +327,13 @@ class Visitor:
     def __init__(self, fil, rec, ignore, bf, sort):
         if isinstance(fil, str):
             fil = FNMatcher(fil)
-        if rec:
-            if isinstance(rec, str):
-                rec = fnmatch(fil)
-            else:
-                assert hasattr(rec, '__call__')
+        if isinstance(rec, str):
+            self.rec = fnmatch(fil)
+        elif not hasattr(rec, '__call__') and rec:
+            self.rec = lambda path: True
+        else:
+            self.rec = rec
         self.fil = fil
-        self.rec = rec
         self.ignore = ignore
         self.breadthfirst = bf
         self.optsort = sort and sorted or (lambda x: x)
_______________________________________________
py-svn mailing list
py-svn@codespeak.net
http://codespeak.net/mailman/listinfo/py-svn

Reply via email to