Fix the custom unpickler on Python 2.x.
Review Request #10559 — Created May 21, 2019 and submitted — Latest diff uploaded
The custom unpickler was previously only being used on newer versions
of Python and Django. However, a recent change resulted in it being
imported on Python 2.x as well, and it turns out that this wasn't
actually compatible on 2.x. We were making use ofpickle._Unpickler
Python implementation as the parent class (Python 3.x exposes a native
implementation of the unpickler asUnpickler
), while 2.x didn't have
this. Furthermore, we were callingsuper
on it, which didn't work on
2.x in thatUnpickler
was an old-style class.This fixes up the compatibility issues to work on both versions.
Unit tests pass on Python 2.x and 3.x.