Skip to content

Commit

Permalink
Merge pull request #1070 from abhishekvickyvyas/master
Browse files Browse the repository at this point in the history
issue_771_add_key_error_if_spaces
  • Loading branch information
nicholascar committed Mar 5, 2021
2 parents 9f0f296 + 4276aa7 commit b41560f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rdflib/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ def bind(self, prefix, namespace, override=True, replace=False):
# When documenting explain that override only applies in what cases
if prefix is None:
prefix = ""
elif " " in prefix:
raise KeyError("Prefixes may not contain spaces.")

bound_namespace = self.store.namespace(prefix)
# Check if the bound_namespace contains a URI
# and if so convert it into a URIRef for comparison
Expand Down

0 comments on commit b41560f

Please sign in to comment.