-
Notifications
You must be signed in to change notification settings - Fork 748
Import hook clean-up #350
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
Import hook clean-up #350
Conversation
#elif PYTHON2 | ||
Runtime.XIncref(root.pyHandle); // we are using the module two times | ||
Runtime.PyDict_SetItemString(dict, "CLR", root.pyHandle); | ||
Runtime.PyDict_SetItemString(dict, "clr", root.pyHandle); | ||
py_clr_module = root.pyHandle; // Alias handle for PY2/PY3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filmor Since you just worked on this, any reason this wouldn't work or is a bad idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this should work fine, IMO.
Codecov Report@@ Coverage Diff @@
## master #350 +/- ##
==========================================
- Coverage 61.65% 61.62% -0.03%
==========================================
Files 61 61
Lines 5286 5280 -6
Branches 893 892 -1
==========================================
- Hits 3259 3254 -5
Misses 1806 1806
+ Partials 221 220 -1
Continue to review full report at Codecov.
|
#endif | ||
py_import = Runtime.PyObject_GetAttrString(mod, "__import__"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could instead use PyEval_GetBuiltins()
on both Py2 and 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw this comment after I merged it in 😞
#elif PYTHON2 | ||
Runtime.XIncref(root.pyHandle); // we are using the module two times | ||
Runtime.PyDict_SetItemString(dict, "CLR", root.pyHandle); | ||
Runtime.PyDict_SetItemString(dict, "clr", root.pyHandle); | ||
py_clr_module = root.pyHandle; // Alias handle for PY2/PY3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this should work fine, IMO.
What does this implement/fix? Explain your changes.
Refactor
importhook.cs
Does this close any currently open issues?
I wish...