Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClosedNamespace KeyError -> AttributeError #827

Merged
merged 1 commit into from May 14, 2018

Conversation

tgbugs
Copy link
Contributor

@tgbugs tgbugs commented May 14, 2018

The current implementation of ClosedNamespace raises a KeyError via __getattr__ which breaks hasattr. This patch fixes it by raising an AttributeError instead.

raise AttributeError instead of KeyError so that hasattr does not fail
@gromgull
Copy link
Member

Nice and easy! Thanks!

@gromgull gromgull merged commit 5db2437 into RDFLib:master May 14, 2018
tgbugs added a commit to tgbugs/rdflib that referenced this pull request May 14, 2018
This merge includes the changes from

RDFLib#663
RDFLib#793
RDFLib#827

which were branches

tgbugs:fix-uri-spec
tgbugs:total-order-patch
tgbugs:closed-namespace-attribute-error

respectively.
@RDFLib RDFLib deleted a comment from coveralls Oct 27, 2018
@joernhees joernhees added this to the rdflib 5.0.0 milestone Oct 27, 2018
@joernhees
Copy link
Member

actually on second thought will change so that the appropriate exception is returned for both...

  • RDFS['xyz'] --> KeyError
  • RDFS.xyz --> AttributeError

@joernhees joernhees added enhancement New feature or request cleanup labels Oct 27, 2018
joernhees added a commit that referenced this pull request Oct 27, 2018
ClosedNamespace returns right exception for way of access, enhances #827
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants