diff --git a/CHANGES b/CHANGES index 291850b9..8a6053b3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ -4.2.0 (2022-111-03) +4.2.1 (2022-11-10) +------------------- + - Fix error regarding closing session in async transport (#1347) + +4.2.0 (2022-11-03) ------------------- - Drop support for Python 3.6 - Allow embedding CDATA elements in simple types (#1339) diff --git a/src/zeep/transports.py b/src/zeep/transports.py index ffde356b..8e6970d2 100644 --- a/src/zeep/transports.py +++ b/src/zeep/transports.py @@ -37,7 +37,7 @@ def __init__(self, cache=None, timeout=300, operation_timeout=None, session=None self.operation_timeout = operation_timeout self.logger = logging.getLogger(__name__) - self.__close_session = not session + self._close_session = not session self.session = session or requests.Session() self.session.mount("file://", FileAdapter()) self.session.headers["User-Agent"] = "Zeep/%s (www.python-zeep.org)" % ( @@ -156,7 +156,7 @@ def settings(self, timeout=None): self.operation_timeout = old_timeout def __del__(self): - if self.__close_session: + if self._close_session: self.session.close() @@ -181,6 +181,7 @@ def __init__( if httpx is None: raise RuntimeError("The AsyncTransport is based on the httpx module") + self._close_session = False self.cache = cache self.wsdl_client = wsdl_client or httpx.Client( verify=verify_ssl,