-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #181 In general, we should accept `[]const u8` and return `[:0]const u8` where possible. We switch from using PyObject_GetAttrString and equivalents to PyObject_GetAttr since the former simply creates a PyUnicode object anyway. By creating the object ourselves, we're able to construct it from non-null terminated slices without making a second copy. The actual bug we had, was the `PyModule.from_code` function was using `[]const u8` slices as `value.ptr` without requirement them to be null terminated.
- Loading branch information
Showing
3 changed files
with
30 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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