#2410 closed defect (fixed)
Python ScriptError
Reported by: | martinl | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.0 |
Component: | Python | Version: | svn-trunk |
Keywords: | ScriptError | Cc: | zarch |
CPU: | Unspecified | Platform: | Unspecified |
Description
In trunk Python Scripting Library is used ScriptError from PyGRASS source:grass/trunk/lib/python/script/core.py#L36. It was introduced in r61187 by zarch. In relbr70 is still used it's own implementation of ScriptError
source:grass/branches/releasebranch_7_0/lib/python/script/core.py#L70 which defines attribute value
. This attribute is accessed on many places of Python Scripting Library or wxGUI, eg.
except ScriptError as e: self.errorMsg = e.value
Since ScriptError
from PyGRASS doesn't have this attribute, it fails with
File "/opt/src/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/script/task.py", line 70, in __init__ self.errorMsg = e.value AttributeError: 'ScriptError' object has no attribute 'value'
Change History (4)
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
Replying to zarch:
Personally I think that we should change the ScriptError class definition.
for record - has been fixed in r61959.
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to martinl:
Right I did this change, we can modify ScriptError back to:
or change the e.value to e.args[0]
The value property seems to be used in:
Personally I think that we should change the ScriptError class definition.