[Python-modules-commits] [python-pyld] 222/276: Do not make path relative to base when there is no path.

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 8 23:48:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-pyld.

commit eab07a359726f824340958fa5410ce98ff267bd1
Author: Dave Longley <dlongley at digitalbazaar.com>
Date:   Thu Oct 3 15:31:58 2013 -0400

    Do not make path relative to base when there is no path.
    
    Closes #24.
---
 lib/pyld/jsonld.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 83a449c..26e8625 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -427,7 +427,8 @@ def remove_base(base, iri):
     if not (base.scheme == rel.scheme and base.netloc == rel.netloc):
         return iri
 
-    path = posixpath.normpath(posixpath.relpath(rel.path, base.path))
+    path = posixpath.relpath(rel.path, base.path) if rel.path else ''
+    path = posixpath.normpath(path)
     if rel.path.endswith('/') and not path.endswith('/'):
         path += '/'
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pyld.git



More information about the Python-modules-commits mailing list