backport to 3.13