[pybank] add uint check



commit 3d6f1481e99cd17f3e33e5fc71ca7f6c1b5e6717
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date:   Mon May 11 12:05:00 2009 +0200

    add uint check
---
 bank/btypes.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bank/btypes.py b/bank/btypes.py
index 21a19f4..64e00de 100644
--- a/bank/btypes.py
+++ b/bank/btypes.py
@@ -52,7 +52,8 @@ class Callable(object):
                      repo.TYPE_TAG_INT32):
             if not isinstance(value, int):
                 raise TypeError("%s must be int, not %s" % (name, type(value).__name__))
-            if tag in (repo.TYPE_TAG_UINT8,
+            if tag in (repo.TYPE_TAG_UINT,
+                       repo.TYPE_TAG_UINT8,
                        repo.TYPE_TAG_UINT16) and value < 0:
                 raise TypeError("%s must be an unsigned value, not %s", name, value)
         elif tag in (repo.TYPE_TAG_UINT32,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]