Merge lp:~cwilson/spud/pythonnewkeywarning into lp:spud
Proposed by
Cian Wilson
Status: | Merged |
---|---|
Merged at revision: | 539 |
Proposed branch: | lp:~cwilson/spud/pythonnewkeywarning |
Merge into: | lp:spud |
Diff against target: |
113 lines (+29/-18) 2 files modified
python/libspud.c (+22/-18) python/test_libspud.py (+7/-0) |
To merge this branch: | bzr merge lp:~cwilson/spud/pythonnewkeywarning |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stephan Kramer | Approve | ||
Review via email:
|
Description of the change
This merge implements a fix for exception handling in set_option through the python interface- specifically handling SpudNewKeyWarnings.
Previously it would raise an exception but not return the right state (NULL) for it to be caught. Now SpudNewKeyWarning can be caught in python.
Additionally it was not possible to set a new option with type double through python. This appears to be because the PyArg_Parse function is broken (and its use discouraged in the documentation). Switching this to PyFloat_AS_DOUBLE, which works.
Modifying the python tests to reflect these changes.
Also tidying up messages associated with python exceptions.
To post a comment you must log in.
Looks glorious!