Ed Leafe wrote:
> On Aug 25, 2008, at 2:25 PM, Paul McNett wrote:
> 
>> Another dead object exception was going uncaught in Windows. Fixed.
>>
>> Diff:
>> Modified: trunk/dabo/ui/uiwx/dGrid.py
>> ===================================================================
>> --- trunk/dabo/ui/uiwx/dGrid.py      2008-08-22 20:01:21 UTC (rev 4441)
>> +++ trunk/dabo/ui/uiwx/dGrid.py      2008-08-25 19:25:22 UTC (rev 4442)
>> @@ -578,9 +578,12 @@
>>                              try:
>>                                      setattr(self, prop, func(*args, 
>> **kwargs))
>>                              except dabo.ui.deadObjectException:
>> +                                    pass
>> +                            try:
>> +                                    if needRefresh or oldVal != 
>> getattr(self, prop):
>> +                                            needRefresh = True
>> +                            except dabo.ui.deadObjectException:
>>                                      needRefresh = False
>> -                            if needRefresh or oldVal != getattr(self, prop):
>> -                                    needRefresh = True
> 
> 
> 
>       That looks like two successive try/excepts to catch dead objects. A  
> better solution is to add the lines:
> 
> if not self:
>       return

Does that *always* work? IIRC, you can't check for self in the pre-init 
phase.

> ...to the top of the method. Maybe we should create a decorator so all  
> we have to do is:
> 
> @checkForDeadObjects
> def someMethod(...

Can we use decorators yet?

Paul


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to