File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def __repr__(self) -> str:
81
81
_repr_cls = f"{ cls .__module__ } .{ cls .__name__ } "
82
82
83
83
closed = ' closed' if self .closed else ''
84
- if self . _sockets :
84
+ if getattr ( self , " _sockets" , None ) :
85
85
n_sockets = len (self ._sockets )
86
86
s = 's' if n_sockets > 1 else ''
87
87
sockets = f"{ n_sockets } socket{ s } "
Original file line number Diff line number Diff line change @@ -37,9 +37,14 @@ def await_gc(obj, rc):
37
37
Necessary because of the zero-copy gc thread,
38
38
which can take some time to receive its DECREF message.
39
39
"""
40
+ # count refs for this function
41
+ if sys .version_info < (3 , 11 ):
42
+ my_refs = 2
43
+ else :
44
+ my_refs = 1
40
45
for i in range (50 ):
41
46
# rc + 2 because of the refs in this function
42
- if grc (obj ) <= rc + 2 :
47
+ if grc (obj ) <= rc + my_refs :
43
48
return
44
49
time .sleep (0.05 )
45
50
You can’t perform that action at this time.
0 commit comments