| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -304,6 +304,10 @@ internal static void Initialize(bool initSigs = false) | |||
| 304 | 304 | ||
| 305 | 305 | IntPtr dllLocal = IntPtr.Zero; | |
| 306 | 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. | ||
| 307 | 311 | var zipimport = PyImport_ImportModule("zipimport"); | |
| 308 | 312 | var ZipImportError = PyObject_GetAttrString(zipimport, "ZipImportError"); | |
| 309 | 313 | _PyObject_NextNotImplemented = Marshal.ReadIntPtr(ZipImportError, TypeOffset.tp_iternext); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments