Permalink
Browse files

[#690] Fixed parent path detection

  • Loading branch information...
1 parent ae29928 commit 284041230488ea6fb2916ee4704119f42115b468 @trecloux committed May 1, 2011
Showing with 1 addition and 11 deletions.
  1. +1 −11 framework/pym/play/utils.py
@@ -35,17 +35,7 @@ def secretKey():
return ''.join([random.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') for i in range(64)])
def isParentOf(path1, path2):
- if len(path2) < len(path1) or len(path2) < 2:
- return False
- if (path1 == path2):
- return True
- return isParentOf(path1, os.path.dirname(path2))
-
-def isParentOf(path1, path2):
- if len(path2) < len(path1) or len(path2) < 2:
- return False
- if (path1 == path2):
- return True
+ return path2.startswith(path1 + '/' )
ryenus
ryenus Oct 17, 2011

shouldn't we use os.sep instead of hardcoded '/' here?

pepite
pepite Apr 6, 2012

Yes I think you are right

def getWithModules(args, env):
withModules = []

0 comments on commit 2840412

Please sign in to comment.