https://bugs.documentfoundation.org/show_bug.cgi?id=170564

Jean-Pierre Ledure <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #6 from Jean-Pierre Ledure <[email protected]> ---
The ExecutePythonScript() method uses in the background the same UNO interfaces
as the example in comment#4, i.e.
- script = provider.getScript()
- script.invoke()

The error message which is considered in this bug report is related to the
execution of getScript().
The major reasons for getScript() being unsuccessful are reflected in the
message: either the file does not exist or the called [def] function is not
found.

The case in the example is different: it is a *compile* error: the import
statement is indeed executed at module loading.

It is rather unusual to run a Python script from Basic while it even does not
compile stand alone.

Compare with next variant. If you move the import statement to inside the
function, the import is delayed up to the invoke() method. It fails - obvously
- too. But it is now an *execution* error that is reported in detail in the
error message displayed to the user, as would any other run-time error.

The distinction in error reporting was made deliberately.
It can nevertheless be reviewed.
But, is it really relevant and useful to review it ?

More comments welcome.

Thanks for reporting the bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to