diff options
| author | Nicholas Piper <nicholas@users.sourceforge.net> | 2006-04-08 21:02:31 +0000 |
|---|---|---|
| committer | Nicholas Piper <nicholas@users.sourceforge.net> | 2006-04-08 21:02:31 +0000 |
| commit | e0d16167d95a568f612675bc4dbbebe161890af7 (patch) | |
| tree | 966e29b3b36f92a888224d52951565cdaab370b9 /bindings/python | |
| parent | fd70d43ed0eadb07c3b892f579f9443107dc49ef (diff) | |
| download | libgpod-e0d16167d95a568f612675bc4dbbebe161890af7.tar.gz libgpod-e0d16167d95a568f612675bc4dbbebe161890af7.tar.xz libgpod-e0d16167d95a568f612675bc4dbbebe161890af7.zip | |
Allow fetching guint8 values into Python. Include function name in exception when checking guint8.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1241 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python')
| -rw-r--r-- | bindings/python/gpod.i | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bindings/python/gpod.i b/bindings/python/gpod.i index 482e5eb..1c0edc7 100644 --- a/bindings/python/gpod.i +++ b/bindings/python/gpod.i @@ -81,13 +81,17 @@ typedef char gchar; long ival; ival = PyInt_AsLong($input); if (( ival > 255 ) || ( ival < 0 )) { - PyErr_SetString(PyExc_ValueError, "Value must be between 0 and 255"); + PyErr_SetString(PyExc_ValueError, "$symname: Value must be between 0 and 255"); SWIG_fail; } else { $1 = (guint8) ival; } } +%typemap(out) guint8 { + $result = PyInt_FromLong($1); +} + typedef int gboolean; typedef int gint32; |
