File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -264,21 +264,24 @@ def __init__(self, *args):
264
264
DeprecationWarning )
265
265
self .callbacks = dict ()
266
266
self ._cid = 0
267
- self ._func_cid_map = WeakKeyDictionary ()
267
+ self ._func_cid_map = {}
268
268
269
269
def connect (self , s , func ):
270
270
"""
271
271
register *func* to be called when a signal *s* is generated
272
272
func will be called
273
273
"""
274
- if func in self ._func_cid_map :
275
- return self ._func_cid_map [func ]
276
- proxy = self .BoundMethodProxy (func )
274
+ self ._func_cid_map .setdefault (s , WeakKeyDictionary ())
275
+ if func in self ._func_cid_map [s ]:
276
+ return self ._func_cid_map [s ][func ]
277
+
277
278
self ._cid += 1
279
+ cid = self ._cid
280
+ self ._func_cid_map [s ][func ] = cid
278
281
self .callbacks .setdefault (s , dict ())
279
- self . callbacks [ s ][ self . _cid ] = proxy
280
- self ._func_cid_map [ func ] = self . _cid
281
- return self . _cid
282
+ proxy = self . BoundMethodProxy ( func )
283
+ self .callbacks [ s ][ cid ] = proxy
284
+ return cid
282
285
283
286
def disconnect (self , cid ):
284
287
"""
You can’t perform that action at this time.
0 commit comments