pybank r99 - in trunk: . bank
- From: marklee svn gnome org
- To: svn-commits-list gnome org
- Subject: pybank r99 - in trunk: . bank
- Date: Tue, 31 Mar 2009 21:49:16 +0000 (UTC)
Author: marklee
Date: Tue Mar 31 21:49:16 2009
New Revision: 99
URL: http://svn.gnome.org/viewvc/pybank?rev=99&view=rev
Log:
Make the uint8 unit test pass.
* bank/bank-argument.c (pyg_argument_from_pyobject): Add proper
support for uint8.
* bank/btypes.py (Callable.type_check): Enforce the unsigned modifier.
Modified:
trunk/ChangeLog
trunk/bank/bank-argument.c
trunk/bank/btypes.py
Modified: trunk/bank/bank-argument.c
==============================================================================
--- trunk/bank/bank-argument.c (original)
+++ trunk/bank/bank-argument.c Tue Mar 31 21:49:16 2009
@@ -41,6 +41,9 @@
else
arg.v_pointer = PyString_AsString(object);
break;
+ case GI_TYPE_TAG_UINT8:
+ arg.v_uint8 = PyInt_AsLong(object);
+ break;
case GI_TYPE_TAG_INT8:
case GI_TYPE_TAG_INT:
case GI_TYPE_TAG_BOOLEAN:
Modified: trunk/bank/btypes.py
==============================================================================
--- trunk/bank/btypes.py (original)
+++ trunk/bank/btypes.py Tue Mar 31 21:49:16 2009
@@ -46,6 +46,8 @@
repo.TYPE_TAG_UINT8):
if not isinstance(value, int):
raise TypeError("%s must be int, not %s" % (name, type(value).__name__))
+ if tag in (repo.TYPE_TAG_UINT8,) and value < 0:
+ raise TypeError("%s must be an unsigned value, not %s", name, value)
elif tag in (repo.TYPE_TAG_FLOAT,
repo.TYPE_TAG_DOUBLE):
if not isinstance(value, float):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]