Skip to content
Myr

Don't pickle request/response extensions (#1892)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by GitHub · parent 885314a · Browse files · 1 file+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:httpx/_models.py+4 added-2 removed
1183 unmodified lines
1184 def __getstate__(self) -> typing.Dict[str, typing.Any]:1185 return {1186 name: value1187 for name, value in self.__dict__.items()1188 if name not in ["stream"]1188 if name not in ["extensions", "stream"]1189 }11901191 def __setstate__(self, state: typing.Dict[str, typing.Any]) -> None:1192 for name, value in state.items():1193 setattr(self, name, value)1194 self.extensions = {}1195 self.stream = UnattachedStream()119611971198class Response:
346 unmodified lines
1545 def __getstate__(self) -> typing.Dict[str, typing.Any]:1546 return {1547 name: value1548 for name, value in self.__dict__.items()1548 if name not in ["stream", "is_closed", "_decoder"]1549 if name not in ["extensions", "stream", "is_closed", "_decoder"]1550 }15511552 def __setstate__(self, state: typing.Dict[str, typing.Any]) -> None:1553 for name, value in state.items():1554 setattr(self, name, value)1555 self.is_closed = True1556 self.extensions = {}1557 self.stream = UnattachedStream()15581559 def read(self) -> bytes:1560 """
385 unmodified lines