Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ae5cf4

Browse files
committed
#1047 ModuleObject __getattribute__ doesn't treat exceptions ocurred during internal GetAttribute
1 parent f5548e3 commit 8ae5cf4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/runtime/moduleobject.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,18 @@ public static IntPtr tp_getattro(IntPtr ob, IntPtr key)
280280
return self.dict;
281281
}
282282

283-
ManagedType attr = self.GetAttribute(name, true);
283+
ManagedType attr = null;
284+
285+
try
286+
{
287+
attr = self.GetAttribute(name, true);
288+
}
289+
catch (Exception e)
290+
{
291+
Exceptions.SetError(e);
292+
return IntPtr.Zero;
293+
}
294+
284295

285296
if (attr == null)
286297
{

0 commit comments

Comments
 (0)