File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -199,14 +199,16 @@ def __setstate__(self, state):
199
199
200
200
def connect (self , s , func ):
201
201
"""Register *func* to be called when signal *s* is generated."""
202
- self ._func_cid_map .setdefault (s , {})
202
+ signal = s
203
+ self ._func_cid_map .setdefault (signal , {})
203
204
proxy = _weak_or_strong_ref (func , self ._remove_proxy )
204
- if proxy in self ._func_cid_map [s ]:
205
- return self ._func_cid_map [s ][proxy ]
205
+ if proxy in self ._func_cid_map [signal ]:
206
+ return self ._func_cid_map [signal ][proxy ]
207
+
206
208
cid = next (self ._cid_gen )
207
- self ._func_cid_map [s ][proxy ] = cid
208
- self .callbacks .setdefault (s , {})
209
- self .callbacks [s ][cid ] = proxy
209
+ self ._func_cid_map [signal ][proxy ] = cid
210
+ self .callbacks .setdefault (signal , {})
211
+ self .callbacks [signal ][cid ] = proxy
210
212
return cid
211
213
212
214
# Keep a reference to sys.is_finalizing, as sys may have been cleared out
You can’t perform that action at this time.
0 commit comments