From 024608bdcd6d2844a5c8a78ec2866788c95928de Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 1 Feb 2007 21:28:21 +0100 Subject: [PATCH] [svn r37767] Fixed Windows issues in doctests. --HG-- branch : trunk --- py/doc/path.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/py/doc/path.txt b/py/doc/path.txt index 25c8fed5b..a2454c1b9 100644 --- a/py/doc/path.txt +++ b/py/doc/path.txt @@ -109,9 +109,9 @@ specific directory. >>> results = [] >>> for fpath in dirpath.visit('*.txt'): ... if 'bar' in fpath.read(): - ... results.append(fpath.relto(dirpath)) + ... results.append(fpath.basename) >>> results - ['textfile1.txt', 'textfile2.txt', 'subdir/textfile2.txt'] + ['textfile1.txt', 'textfile2.txt', 'textfile2.txt'] Joining path types ++++++++++++++++++++ @@ -122,9 +122,10 @@ performed on a string level (so the paths don't have to exist, either):: >>> p1 = py.path.local('/foo/bar') >>> p2 = p1.join('baz/qux') - >>> p2.strpath - '/foo/bar/baz/qux' - >>> p2.relto(p1) + >>> p2 == py.path.local('/foo/bar/baz/qux') + True + >>> sep = py.path.local.sep + >>> p2.relto(p1).replace(sep, '/') # os-specific path sep in the string 'baz/qux' >>> p3 = p1 / 'baz/qux' # the / operator allows joining, too >>> p2 == p3