FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement writing the __cause__ attribute on exceptions by filmor · Pull Request #287 · pythonnet/pythonnet · GitHub

Implement writing the __cause__ attribute on exceptions - #287

Merged
den-run-ai merged 2 commits into
pythonnet:masterfrom
filmor:add-cause
Nov 21, 2016
Merged

Implement writing the __cause__ attribute on exceptions#287
den-run-ai merged 2 commits into
pythonnet:masterfrom
filmor:add-cause

Conversation

filmor commented Nov 10, 2016

Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

No tests? :)

filmor commented Nov 10, 2016

Copy link
Copy Markdown
Member Author

That's why it reads "WIP" ;)

filmor changed the title [WIP] Implement writing the __cause__ attribute on exceptions. Implement writing the __cause__ attribute on exceptions. Nov 14, 2016

filmor commented Nov 14, 2016

Copy link
Copy Markdown
Member Author

Tests added, could someone comment on whether the XIncref there is correct? I take it GetInstHandle doesn't increase the ref-count by itself?

filmor changed the title Implement writing the __cause__ attribute on exceptions. Implement writing the __cause__ attribute on exceptions Nov 14, 2016

Copy link
Copy Markdown
Contributor

@filmor you can always stress-test for memory growth of this exception in a for-loop.

Looks like it is NOT needed to call XIncref like in this case:

IntPtr op = CLRObject.GetInstHandle(ob);

Note that PyObject(IntPtr tp) constructor does not incref the ref. count.

filmor commented Nov 19, 2016

Copy link
Copy Markdown
Member Author

@denfromufa @vmuriart @tonyroberts Please review.

Copy link
Copy Markdown
Contributor

I don't think an incref is necessary as the CLRObject constructor creates a new python object (so reference count of 1) and never decrefs it.

filmor commented Nov 21, 2016

Copy link
Copy Markdown
Member Author

Yep, changed that already.

den-run-ai merged commit 071f25d into pythonnet:master Nov 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL