Conversation
vmuriart
commented
Feb 1, 2017
| 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 |
Contributor
Author
There was a problem hiding this comment.
@filmor Since you just worked on this, any reason this wouldn't work or is a bad idea?
Member
There was a problem hiding this comment.
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.
|
filmor
approved these changes
Feb 2, 2017
| IntPtr mod = Runtime.PyDict_GetItemString(dict, "__builtin__"); | ||
| py_import = Runtime.PyObject_GetAttrString(mod, "__import__"); | ||
| #endif | ||
| py_import = Runtime.PyObject_GetAttrString(mod, "__import__"); |
Member
There was a problem hiding this comment.
You could instead use PyEval_GetBuiltins() on both Py2 and 3.
Contributor
Author
There was a problem hiding this comment.
Saw this comment after I merged it in 😞
| 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 |
Member
There was a problem hiding this comment.
Nope, this should work fine, IMO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
Refactor
importhook.csDoes this close any currently open issues?
I wish...