pyscripter / python4delphi

Free components that wrap up Python into Delphi and Lazarus (FPC)
MIT License
906 stars 310 forks source link

Less dramatic error handling if incorrect dll? #423

Closed wilkojohnny closed 1 year ago

wilkojohnny commented 1 year ago

Hi,

I'm trying to use python4delphi within a much larger program, and I think a tweak is needed. If an incorrect dll is given to python4delphi and it fails to load it in, it gives the error 'Python could not be properly initialized. We must quit', and proceeds to shut down the entire program.

Is there any chance this could please be changed to be less dramatic, e,g. by raising an exception which I could handle somewhere else in the code? In our case, shutting down the entire program just because one component won't load would be very irritating to the end user.

pyscripter commented 1 year ago

Set FatalAbort to False. Note also the FatalMsgDlg property.