DRY parse{2,3} code

Add test for last bug.
This commit is contained in:
rocky
2016-05-08 18:15:07 -04:00
parent ce2ae463c4
commit dddb486d78
5 changed files with 37 additions and 47 deletions

Binary file not shown.

View File

@@ -0,0 +1,9 @@
# Python < 3.5 bug in not getting jumps with
# end of loop inside the if
def _splitext(p, sep, altsep, extsep):
if p > sep:
while sep < p:
if p[sep:sep+1] != extsep:
return p[:sep], p[sep:]
altsep += 1
return p, p[:0]