Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it run on python 2.6 too #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions mcl_id_triples_by_blat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
min_space_on_scratch = 100000 #in mb; fail if less than this amount of free space

def splitpath_rec(path, maxdepth=20):
( head, tail ) = os.path.split(path)
return splitpath_rec(head, maxdepth - 1) + [ tail ] \
if maxdepth and head and head != path \
else [ head or tail ]
( head, tail ) = os.path.split(path)
# make it work on python 2.6
if maxdepth and head and head != path:
return splitpath_rec(head, maxdepth - 1) + [ tail ]
else:
return [ head or tail ]


def splitpath(path):
pathli = splitpath_rec(path)
Expand Down