summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-30 12:50:44 (GMT)
committerGitHub <noreply@github.com>2019-08-30 12:50:44 (GMT)
commit17f61ed25a856ed673ad6f2e9782c3d5e556f151 (patch)
treea5d2ac5780b2fe9ba5f9e196027158177dd7ebf3 /Python/sysmodule.c
parent1553e3b5fc97512940826f4fa2c8bc45d88c84cb (diff)
downloadcpython-17f61ed25a856ed673ad6f2e9782c3d5e556f151.zip
cpython-17f61ed25a856ed673ad6f2e9782c3d5e556f151.tar.gz
cpython-17f61ed25a856ed673ad6f2e9782c3d5e556f151.tar.bz2
bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)
Fix a ctypes regression of Python 3.8. When a ctypes.Structure is passed by copy to a function, ctypes internals created a temporary object which had the side effect of calling the structure finalizer (__del__) twice. The Python semantics requires a finalizer to be called exactly once. Fix ctypes internals to no longer call the finalizer twice. Create a new internal StructParam_Type which is only used by _ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument). StructUnionType_paramfunc() creates such object. (cherry picked from commit 96b4087ce784ee7434dffdf69c475f5b40543982) Co-authored-by: Victor Stinner <vstinner@redhat.com>
Diffstat (limited to 'Python/sysmodule.c')
0 files changed, 0 insertions, 0 deletions