8000 Drop LoadLibrary by amos402 · Pull Request #880 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Drop LoadLibrary #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Explain for getting _PyObject_NextNotImplemented
  • Loading branch information
amos402 committed Jun 13, 2019
commit f000e0846407a5f0a8c30b612b3c874981330feb
4 changes: 4 additions & 0 deletions src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ internal static void Initialize(bool initSigs = false)

IntPtr dllLocal = IntPtr.Zero;

// Since `_PyObject_NextNotImplemented` would set to a heap class
// for tp_iternext which doesn't implement __next__.
// Thus we need a heap class to get it, the ZipImportError is a
// heap class and it's in builtins, so we can use it as a trick.
var zipimport = PyImport_ImportModule("zipimport");
var ZipImportError = PyObject_GetAttrString(zipimport, "ZipImportError");
_PyObject_NextNotImplemented = Marshal.ReadIntPtr(ZipImportError, TypeOffset.tp_iternext);
Expand Down
0