| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,12 +35,19 @@ public PythonException() : base() | |||
| 35 | 35 | if ((_pyType != IntPtr.Zero) && (_pyValue != IntPtr.Zero)) | |
| 36 | 36 | { | |
| 37 | 37 | string type; | |
| 38 | + string message; | ||
| 38 | 39 | using (PyObject pyType = new PyObject(_pyType)) | |
| 39 | 40 | using (PyObject pyTypeName = pyType.GetAttr("__name__")) | |
| 40 | 41 | { | |
| 41 | 42 | type = pyTypeName.ToString(); | |
| 42 | 43 | } | |
| 43 | - string message = Runtime.GetManagedString(_pyValue); | ||
| 44 | + | ||
| 45 | + using (PyObject pyValue = new PyObject(_pyValue)) | ||
| 46 | + { | ||
| 47 | + message = pyValue.ToString(); | ||
| 48 | + } | ||
| 49 | + ; | ||
| 50 | + | ||
| 44 | 51 | _message = type + " : " + message; | |
| 45 | 52 | } | |
| 46 | 53 | if (_pyTB != IntPtr.Zero) | |
@@ -99,6 +106,18 @@ public IntPtr PyValue | |||
| 99 | 106 | get { return _pyValue; } | |
| 100 | 107 | } | |
| 101 | 108 | ||
| 109 | + /// <summary> | ||
| 110 | + /// PyTB Property | ||
| 111 | + /// </summary> | ||
| 112 | + /// | ||
| 113 | + /// <remarks> | ||
| 114 | + /// Returns the TraceBack as a Python object. | ||
| 115 | + /// </remarks> | ||
| 116 | + | ||
| 117 | + public IntPtr PyTB { | ||
| 118 | + get { return _pyTB; } | ||
| 119 | + } | ||
| 120 | + | ||
| 102 | 121 | /// <summary> | |
| 103 | 122 | /// Message Property | |
| 104 | 123 | /// </summary> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments