◐ Shell
clean mode source ↗

[3.7] bpo-16575: Fix refleak on passing unions in ctypes by ammaraskar · Pull Request #17064 · python/cpython

The master and 3.8 versions of the previous change work as expected
because we perform the lookup for the from_param after the union
check. However, in 3.7, this lookup happens before the union
validation and so we must decrease the reference for cnv before
returning.

https://bugs.python.org/issue16575