Skip to content

Commit

Permalink
Copy debuglevel and _http_vsn attrs into response classes
Browse files Browse the repository at this point in the history
Copy the `debuglevel` and `_http_vsn` attributes from base connection
class into response classes, in order to fix compatibility with
Python 3.12.  For reasons I don't comprehend, these end up being called
on the class rather than instance, so regular proxying logic does not
work.

Fixes #707
  • Loading branch information
mgorny authored and jairhenrique committed Aug 9, 2023
1 parent 469a10b commit 69621c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vcr/stubs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ class VCRHTTPConnection(VCRConnection):

_baseclass = HTTPConnection
_protocol = "http"
debuglevel = _baseclass.debuglevel
_http_vsn = _baseclass._http_vsn


class VCRHTTPSConnection(VCRConnection):
Expand All @@ -397,3 +399,5 @@ class VCRHTTPSConnection(VCRConnection):
_baseclass = HTTPSConnection
_protocol = "https"
is_verified = True
debuglevel = _baseclass.debuglevel
_http_vsn = _baseclass._http_vsn

0 comments on commit 69621c6

Please sign in to comment.