diff --git a/haas/plugins/discoverer.py b/haas/plugins/discoverer.py index bb9a997..ff52ba1 100644 --- a/haas/plugins/discoverer.py +++ b/haas/plugins/discoverer.py @@ -41,10 +41,11 @@ def test_error(self): def get_relpath(top_level_directory, fullpath): + normalized_top_level = os.path.normpath(top_level_directory) normalized = os.path.normpath(fullpath) logger.debug('Determine if %r is within %r', - normalized, top_level_directory) - relpath = os.path.relpath(normalized, top_level_directory) + normalized, normalized_top_level) + relpath = os.path.relpath(normalized, normalized_top_level) logger.debug('Relative path is %r', relpath) if os.path.isabs(relpath) or relpath.startswith('..'): raise ValueError('Path not within project: {0}'.format(fullpath))