Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Call PyErr_NormalizeException for exceptions#1265

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lostmsu merged 17 commits intopythonnet:masterfromslide:normalize_exceptions
Dec 21, 2020
Merged
Changes from1 commit
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
84197d4
Call PyErr_NormalizeException for exceptions
slideOct 15, 2020
eddd657
Add CHANGELOG entry
slideOct 15, 2020
a923e99
Add test
slideOct 15, 2020
9b3d14b
Localize call to PyErr_NormalizeException to the Format method.
slideOct 15, 2020
cc584dd
Merge branch 'master' into normalize_exceptions
slideNov 12, 2020
d1fe930
Merge branch 'master' into normalize_exceptions
slideNov 17, 2020
4229a38
Merge branch 'master' into normalize_exceptions
filmorNov 18, 2020
04c8b66
Merge branch 'master' into normalize_exceptions
slideNov 20, 2020
95940aa
Merge branch 'master' into normalize_exceptions
filmorDec 10, 2020
7a5ded5
Merge branch 'master' into normalize_exceptions
slideDec 10, 2020
092e961
incref before the call to PyErr_NormalizeException
slideNov 12, 2020
caa0922
Add test for __init__ that causes exception
slideDec 11, 2020
c28951f
Fix test for exception during normalization
slideDec 14, 2020
4654330
Merge branch 'master' into normalize_exceptions
slideDec 14, 2020
62a0b00
Merge branch 'master' into normalize_exceptions
slideDec 18, 2020
4ac9c48
Fixup test
slideDec 19, 2020
946aa1f
Merge branch 'normalize_exceptions' of github.com:slide/pythonnet int…
slideDec 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Localize call to PyErr_NormalizeException to the Format method.
  • Loading branch information
@slide
slide committedOct 15, 2020
commit9b3d14b9996d72717e11db1d960c4fc3b51a5445
18 changes: 11 additions & 7 deletionssrc/runtime/pythonexception.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,6 @@ public PythonException()
{
IntPtr gs = PythonEngine.AcquireLock();
Runtime.PyErr_Fetch(out _pyType, out _pyValue, out _pyTB);
Runtime.PyErr_NormalizeException(ref _pyType, ref _pyValue, ref _pyTB);
if (_pyType != IntPtr.Zero && _pyValue != IntPtr.Zero)
{
string type;
Expand DownExpand Up@@ -159,12 +158,17 @@ public string Format()
{
if (_pyTB != IntPtr.Zero && _pyType != IntPtr.Zero && _pyValue != IntPtr.Zero)
{
Runtime.XIncref(_pyType);
Runtime.XIncref(_pyValue);
Runtime.XIncref(_pyTB);
using (PyObject pyType = new PyObject(_pyType))
using (PyObject pyValue = new PyObject(_pyValue))
using (PyObject pyTB = new PyObject(_pyTB))
IntPtr tb = _pyTB;
IntPtr type = _pyType;
IntPtr value = _pyValue;
Runtime.PyErr_NormalizeException(ref type, ref value, ref tb);

Runtime.XIncref(type);
Runtime.XIncref(value);
Runtime.XIncref(tb);
using (PyObject pyType = new PyObject(type))
using (PyObject pyValue = new PyObject(value))
using (PyObject pyTB = new PyObject(tb))
using (PyObject tb_mod = PythonEngine.ImportModule("traceback"))
{
var buffer = new StringBuilder();
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp