Incorporate a workaround for Python Issue 16609.