Remove hard error on session reuse (#7026)

Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
This commit is contained in:
Robert Brennan 2025-03-01 07:58:01 -05:00 committed by GitHub
parent 2e4911dc59
commit d0cde6baf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@ class HttpSession:
logger.error(
'Session is being used after close!', stack_info=True, exc_info=True
)
raise RuntimeError('Session is being used after close!')
self.session = requests.Session()
return getattr(self.session, name)
@property
@ -31,7 +31,7 @@ class HttpSession:
logger.error(
'Session is being used after close!', stack_info=True, exc_info=True
)
raise RuntimeError('Session is being used after close!')
self.session = requests.Session()
# Cast to CaseInsensitiveDict[str] since mypy doesn't know the exact type
return cast(CaseInsensitiveDict[str], self.session.headers)