File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -322,23 +322,15 @@ def on_touch_up(self, touch):
322
322
raise Exception ('Grab works only for Touch MotionEvents.' )
323
323
if self .grab_exclusive_class is not None :
324
324
raise Exception ('Cannot grab the touch, touch is exclusive' )
325
- try :
326
- class_instance = weakref .ref (class_instance )
327
- except TypeError :
328
- # handle weakproxy objects which cannot be weakref'd
329
- class_instance = weakref .ref (class_instance .__self__ )
325
+ class_instance = weakref .ref (class_instance .__self__ )
330
326
if exclusive :
331
327
self .grab_exclusive_class = class_instance
332
328
self .grab_list .append (class_instance )
333
329
334
330
def ungrab (self , class_instance ):
335
331
'''Ungrab a previously grabbed touch
336
332
'''
337
- try :
338
- class_instance = weakref .ref (class_instance )
339
- except TypeError :
340
- # handle weakproxy objects which cannot be weakref'd
341
- class_instance = weakref .ref (class_instance .__self__ )
333
+ class_instance = weakref .ref (class_instance .__self__ )
342
334
if self .grab_exclusive_class == class_instance :
343
335
self .grab_exclusive_class = None
344
336
if class_instance in self .grab_list :
You can’t perform that action at this time.
0 commit comments