Ticket #20212: simple_lazy_object.patch

File simple_lazy_object.patch, 796 bytes (added by Iru Hwang <iru@…>, 12 years ago)
  • django/utils/functional.py

    diff --git django/utils/functional.py django/utils/functional.py
    index 13aec9c..48ab673 100644
    class SimpleLazyObject(LazyObject):  
    326326    # Python 3.3 will call __reduce__ when pickling; these methods are needed
    327327    # to serialize and deserialize correctly. They are not called in earlier
    328328    # versions of Python.
    329     @classmethod
    330     def __newobj__(cls, *args):
    331         return cls.__new__(cls, *args)
    332 
    333329    def __reduce__(self):
    334         return (self.__newobj__, (self.__class__,), self.__getstate__())
     330        return (self.__class__.__new__, (self.__class__,), self.__getstate__())
    335331
    336332    # Return a meaningful representation of the lazy object for debugging
    337333    # without evaluating the wrapped object.
Back to Top