Skip to content
Browse files

Don't add a slash to tree_uri if it's blank

  • Loading branch information...
1 parent f659985 commit 39a846534ae65a4e8b1d62258687ad2bda10cad4 @bendmorris bendmorris committed with etal Feb 20, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 Bio/Phylo/
5 Bio/Phylo/
@@ -48,8 +48,9 @@ def node_uri(graph, uri):
'''Returns the full URI of a node by appending the node URI to the graph URI.'''
if graph.endswith('/'):
return urlparse.urljoin(graph, uri)
- else:
+ elif graph:
return urlparse.urljoin(graph, '#%s' % uri)
+ else: return uri
def new_storage():
@@ -283,7 +284,7 @@ def add_trees_to_handle(self, handle, trees=None, tree_uri='', context=None):
"""Add triples describing a set of trees to handle, which can be either
a file or a librdf model."""
- if not tree_uri.endswith('/'): tree_uri = tree_uri + '/'
+ if tree_uri and not tree_uri.endswith('/'): tree_uri = tree_uri + '/'
is_librdf_model = isinstance(handle, RDF.Model)

0 comments on commit 39a8465

Please sign in to comment.
Something went wrong with that request. Please try again.