Depend on FilePath.asTextMode().

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-11-02 21:41:10 +00:00
parent 08f34a11ec
commit bafac70c13

View File

@ -297,12 +297,7 @@ def unicode_segments_from(base_fp, ancestor_fp):
precondition(isinstance(base_fp, FilePath), base_fp=base_fp) precondition(isinstance(base_fp, FilePath), base_fp=base_fp)
precondition(isinstance(ancestor_fp, FilePath), ancestor_fp=ancestor_fp) precondition(isinstance(ancestor_fp, FilePath), ancestor_fp=ancestor_fp)
if hasattr(FilePath, 'asTextMode'): return base_fp.asTextMode().segmentsFrom(ancestor_fp.asTextMode())
return base_fp.asTextMode().segmentsFrom(ancestor_fp.asTextMode())
else:
bpt, apt = (type(base_fp.path), type(ancestor_fp.path))
_assert(bpt == apt, bpt=bpt, apt=apt)
return map(_decode, base_fp.segmentsFrom(ancestor_fp))
def unicode_platform(): def unicode_platform():
""" """