We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1928dc commit f000e08Copy full SHA for f000e08
src/runtime/runtime.cs
@@ -304,6 +304,10 @@ internal static void Initialize(bool initSigs = false)
304
305
IntPtr dllLocal = IntPtr.Zero;
306
307
+ // Since `_PyObject_NextNotImplemented` would set to a heap class
308
+ // for tp_iternext which doesn't implement __next__.
309
+ // Thus we need a heap class to get it, the ZipImportError is a
310
+ // heap class and it's in builtins, so we can use it as a trick.
311
var zipimport = PyImport_ImportModule("zipimport");
312
var ZipImportError = PyObject_GetAttrString(zipimport, "ZipImportError");
313
_PyObject_NextNotImplemented = Marshal.ReadIntPtr(ZipImportError, TypeOffset.tp_iternext);
0 commit comments