-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Should grass.script expose ScriptError
from wildcard imports?
#4838
Comments
@petrasovaa Maybe you'd have an opinion on this |
I think |
That's what I used in #4841. I also think it should be in the GUI code too. It might also help in reducing the circular imports noticed by Pylint 3 (but disabled for now in order to be able to upgrade). |
And for the usages of ScriptError imported from grass.script.core (found in some GUI code), should they be changed to the correct import? As currently, they rely on a side effect of having ScriptError imported inside grass.script.core (for grass.script.core's purposes, but not declared) |
Yes I think so. |
I'm pretty sure the variations are from before creation of grass.exceptions. We should import from where it is defined. @arohanajit can you please make the changes? @echoix let us know if you are already working on it. |
No I didn't work on it, but since the decision is made, it's quite straightforward to do |
I'll standardize across all the files. |
Thanks! |
Describe the bug
https://github.com/OSGeo/grass/blob/3b5184f3454c69afdf2844479403a5d8ef5d24e0/python/grass/script/__init__.py now lists the names for wildcard imports, in the
__all__
variable.The text
ScriptError
is found 55 times. In some calls in gui, it is used likegs.ScriptError
multiple timesgcore.ScriptError
in gui/wxpython/animation/dialogs.pygrass.ScriptError
in gui/wxpython/gui_core/forms.py, where grass isfrom grass.script import core as grass
ScriptError
in gui/wxpython/core/toolboxes.py and more, wherefrom grass.exceptions import ScriptError, CalledModuleError
is usedWhat should be done? Technically, we show that ScriptError isn't listed from grass.script in the init file.
The text was updated successfully, but these errors were encountered: