Skip to content

Fix crash when abstract methods aren't implemented#196

Merged
tonyroberts merged 2 commits intopythonnet:developfrom
tonyroberts:develop
Apr 4, 2016
Merged

Fix crash when abstract methods aren't implemented#196
tonyroberts merged 2 commits intopythonnet:developfrom
tonyroberts:develop

Conversation

@tonyroberts
Copy link
Copy Markdown
Contributor

and add simple example showing how to implement events.

When deriving from managed classes in Python don't create the final base method wrapper for abstract methods.

If an abstract method that hasn't been implemented in Python raise an Exception. Previously the base method was called, resulting in a crash.

This behaviour was noticed when trying to implement events declared on an interface when the implicit add_X and remove_X methods weren't implemented, and tests have been added to cover that case.
Test events can be implemented in Python and that raising them invokes any handlers added in managed code.
@tonyroberts tonyroberts merged commit de142ae into pythonnet:develop Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant