[Python-modules-commits] [python-pyld] 228/276: Use last path component if paths are equal w/no query or fragment.
Wolfgang Borgert
debacle at moszumanska.debian.org
Wed Oct 8 23:48:14 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 c818bdc9c0058091916cef02264a804d5f381f37
Author: Dave Longley <dlongley at digitalbazaar.com>
Date: Sat Oct 5 00:14:25 2013 -0400
Use last path component if paths are equal w/no query or fragment.
- Closes #26.
---
lib/pyld/jsonld.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 2f6eb56..b5fdd8e 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -429,6 +429,9 @@ def remove_base(base, iri):
path = posixpath.relpath(rel.path, base.path) if rel.path else ''
path = posixpath.normpath(path)
+ if path == '.' and not rel.path.endswith('/') and not (
+ rel.query or rel.fragment):
+ path = posixpath.basename(rel.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