mhammond / pywin32

Python for Windows (pywin32) Extensions
5.04k stars 796 forks source link

Adding application objects too Python scriptengine triggers bug in pyscript.py #1959

Open Tizznt opened 1 year ago

Tizznt commented 1 year ago

Note that issues in this repository are only for bugs or feature requests in the pywin32.

If you need support or help using this package, please follow these instructions - support or help requests will be closed without comment.

For all bugs, please provide the following information.

Tizznt commented 1 year ago

Python version 3.10.7 pywin32 version 304.

context: simple scripthost in Bowpad editor that should run plugins.

expected behaviour:

Add Bowpad application object to Python script engine and be able too use its goodies.

actual behaviour:

Adding Bowpad application object too Python script engine causes an AttributeError on line 167 of pyscript.py because the object doesnt implement ITypeInfo.

Solution:

Put line 167 in a test.

if typeinfo is not None: clsid = typeinfo.GetTypeAttr()[0]

With this change everything works perfect!