From: Daira Hopwood Date: Mon, 2 Nov 2015 21:41:10 +0000 (+0000) Subject: Depend on FilePath.asTextMode(). X-Git-Url: https://git.rkrishnan.org/pf/content/-?a=commitdiff_plain;h=7ab8d49b1014186ddb8c69f2b7f90adf1ce90524;p=tahoe-lafs%2Ftahoe-lafs.git Depend on FilePath.asTextMode(). Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/util/encodingutil.py b/src/allmydata/util/encodingutil.py index efd1e218..de40482b 100644 --- a/src/allmydata/util/encodingutil.py +++ b/src/allmydata/util/encodingutil.py @@ -297,12 +297,7 @@ def unicode_segments_from(base_fp, ancestor_fp): precondition(isinstance(base_fp, FilePath), base_fp=base_fp) precondition(isinstance(ancestor_fp, FilePath), ancestor_fp=ancestor_fp) - if hasattr(FilePath, '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)) + return base_fp.asTextMode().segmentsFrom(ancestor_fp.asTextMode()) def unicode_platform(): """