From 399f911afa6e1ed073d9f80794edd95d9975ebdf Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Wed, 22 Feb 2017 01:34:24 +0100 Subject: [PATCH] Make sage.doctest.sources.get_basename work in more situations This lets you specify SAGE_SRC like /path/to/test/dir/../../src/dir, which avoids post-install test failures in sage/doctest/test.py --- src/sage/doctest/sources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/doctest/sources.py b/src/sage/doctest/sources.py index 7d759069f89..dceca5be537 100644 --- a/src/sage/doctest/sources.py +++ b/src/sage/doctest/sources.py @@ -85,8 +85,8 @@ def get_basename(path): root = os.path.dirname(path) # If the file is in the sage library, we can use our knowledge of # the directory structure - dev = SAGE_SRC - sp = os.path.join(SAGE_LOCAL, 'lib', 'python', 'site-packages') + dev = os.path.normpath(SAGE_SRC) + sp = os.path.normpath(os.path.join(SAGE_LOCAL, 'lib', 'python', 'site-packages')) if path.startswith(dev): # there will be a branch name i = path.find(os.path.sep, len(dev))