From 459f30f73e489356cf128abb3e9f357a7bffed0a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 3 May 2019 13:15:52 +0300 Subject: [PATCH] Removed unnecessary wrapping of __bytes__ in proxy class in lazy(). --- django/utils/functional.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/django/utils/functional.py b/django/utils/functional.py index 4220cbc4b68..be5fac23ad1 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -126,8 +126,6 @@ def lazy(func, *resultclasses): "Cannot call lazy() with both bytes and text return types." ) - if cls._delegate_bytes: - cls.__bytes__ = cls.__bytes_cast @classmethod def __promise__(cls, method_name): @@ -140,9 +138,6 @@ def lazy(func, *resultclasses): return __wrapper__ - def __bytes_cast(self): - return bytes(func(*self.__args, **self.__kw)) - def __cast(self): return func(*self.__args, **self.__kw)