> Mark Hammond wrote:
>
> >Try leaving the events class as an "old style" class (ie, don't
> derive from
> >object)
> >
> >
> Hmm..  I did that, and got pretty much the same output - does this stack
> trace help at all?  The code listed at the bottom is my complete code
> for my test.  I don't need anything else to do this do I?

That all looks fine to me - but I'm a little confused:

> File "C:\Python24\Lib\site-packages\win32com\server\policy.py", line
> 463, in _wrap_
>   tlb_guid = getattr(ob, '_typelib_guid_', None)
> File "C:\Python24\Lib\site-packages\win32com\client\__init__.py", line
> 454, in __getattr__
>   raise AttributeError, "'%s' object has no attribute '%s'" %
> (repr(self), attr)

It looks like this code:

>   tlb_guid = getattr(ob, '_typelib_guid_', None)

Is somehow managing to cause an AttributeError.  The 3rd param (None) should
prevent that from happening.  If you examine that code, you can see that it
fully expects the object to not have a _typelib_guid_ attribute - but it
does that by relying on that fact an AttributeError will *not* be raised,
but None returned instead.

I'm not sure what could cause this - accidently assigning to AttributeError
could possibly cause it, but I can't see any such thing in the code snippet.
Is that code snippet your *entire* test program?

Mark

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to