Fixed #20212 - __reduce__ should only be defined for Py3+.