Fixed bundle module after issue in carputilsGUI
What does this MR do?
In some specific situations (for example in the carputilsGUI environment, or when running a script from the Python interpreter), sys.modules['main'] doesn't have a 'file' attribute, which is used in the bundle module.
A condition was added so that the --bundle
option can only be used in proper environments.
Related issues
https://opencarp.org/q2a/279/installation-of-carputisgui-on-windows
Author's checklist
-
Follow the Contribution Guidelines. -
Apply the appropriate labels.
Reviewer's checklist
All reviewers can help ensure accuracy, clarity, completeness, and adherence to the Contribution Guidelines.
Reviewer
-
Review by a code reviewer or other selected colleague to confirm accuracy, clarity, and completeness. This can be skipped for minor fixes without substantive content changes.
Maintainer
-
Review by assigned maintainer, who can always request/require the above reviews. -
Ensure a release milestone is set.