Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 909a537 commit 79457feCopy full SHA for 79457fe
pythonnet/src/runtime/classbase.cs
@@ -170,7 +170,17 @@ public static IntPtr tp_str(IntPtr ob) {
170
if (co == null) {
171
return Exceptions.RaiseTypeError("invalid object");
172
}
173
- return Runtime.PyString_FromString(co.inst.ToString());
+ try {
174
+ return Runtime.PyString_FromString(co.inst.ToString());
175
+ }
176
+ catch (Exception e)
177
+ {
178
+ if (e.InnerException != null) {
179
+ e = e.InnerException;
180
181
+ Exceptions.SetError(e);
182
+ return IntPtr.Zero;
183
184
185
186
0 commit comments