Refs #28909 -- Simplifed code using unpacking generalizations.

This commit is contained in:
Mariusz Felisiak 2018-02-26 18:23:31 +01:00 committed by GitHub
parent 5b589a47b9
commit 074a2f7f58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 34 deletions

View file

@ -219,9 +219,7 @@ class QuerySet:
def __getstate__(self):
# Force the cache to be fully populated.
self._fetch_all()
obj_dict = self.__dict__.copy()
obj_dict[DJANGO_VERSION_PICKLE_KEY] = get_version()
return obj_dict
return {**self.__dict__, DJANGO_VERSION_PICKLE_KEY: get_version()}
def __setstate__(self, state):
msg = None