Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-99952: [ctypes] fix refcount issues in from_param() result.#100169

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 8 commits intopython:mainfromynkdir:fix-issue-99952
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from1 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
PrevPrevious commit
NextNext commit
add some comments.
  • Loading branch information
@gpshead
gpshead committedJan 26, 2023
commita0b6672656a414e9f6a453f3e28b7c2e3947ab20
2 changes: 2 additions & 0 deletionsLib/test/test_ctypes/test_parameters.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -273,6 +273,7 @@ def test_from_param_result_refcount(self):
from ctypes import PyDLL, c_int, c_void_p, py_object, Structure

class X(Structure):
"""This struct size is <= sizeof(void*)."""
_fields_ = [("a", c_void_p)]

def __del__(self):
Expand All@@ -295,6 +296,7 @@ def from_param(cls, value):
self.assertEqual(trace, [1, 2, 3, 4, 5])

class Y(Structure):
"""This struct size is > sizeof(void*)."""
_fields_ = [("a", c_void_p), ("b", c_void_p)]

def __del__(self):
Expand Down
2 changes: 1 addition & 1 deletionModules/_ctypes/_ctypes.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -412,7 +412,7 @@ _ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
typedef struct {
PyObject_HEAD
void *ptr;
PyObject *keep;
PyObject *keep; // If set, a reference to the original CDataObject.
} StructParamObject;


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp