1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Copy debuglevel and _http_vsn attrs into response classes

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
This commit is contained in:
Michał Górny
2023-08-03 06:51:45 +02:00
committed by Jair Henrique
parent 469a10b980
commit 69621c67fb

View File

@@ -389,6 +389,8 @@ class VCRHTTPConnection(VCRConnection):
_baseclass = HTTPConnection _baseclass = HTTPConnection
_protocol = "http" _protocol = "http"
debuglevel = _baseclass.debuglevel
_http_vsn = _baseclass._http_vsn
class VCRHTTPSConnection(VCRConnection): class VCRHTTPSConnection(VCRConnection):
@@ -397,3 +399,5 @@ class VCRHTTPSConnection(VCRConnection):
_baseclass = HTTPSConnection _baseclass = HTTPSConnection
_protocol = "https" _protocol = "https"
is_verified = True is_verified = True
debuglevel = _baseclass.debuglevel
_http_vsn = _baseclass._http_vsn