# HG changeset patch # User Jeff Hammel # Date 1374345459 25200 # Node ID 77e7cab3e9f25ff31135fd03ad9985e7bef57ad2 # Parent ace6c399fcb157a49f3e1d8cc683abd1b256fbda modularize diff -r ace6c399fcb1 -r 77e7cab3e9f2 python/lsex.py --- a/python/lsex.py Tue Jul 16 15:24:46 2013 -0700 +++ b/python/lsex.py Sat Jul 20 11:37:39 2013 -0700 @@ -16,13 +16,17 @@ def lsex(path=None): """ - list executable files on the path - - path: list of directories to search. if not specified, use system path + list of executable files on the path + + - path: list or PATH-style string of directories to search. + if not specified, use system PATH """ if path is None: # use system path - path = ordered_set(os.environ['PATH'].split(':')) + path = os.environ['PATH'] + if isinstance(path, basestring): + path = ordered_set(path.split(os.pathsep)) executables = []