16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2000-2002 Free Software Foundation |
# Copyright 2000-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# GTypecast.py |
# GTypecast.py |
153 |
try: |
try: |
154 |
v = int("%s" % value) |
v = int("%s" % value) |
155 |
if v < 0: |
if v < 0: |
156 |
raise TypecastError, _("Whole numbers must be positive or 0") |
tmsg = _("Whole numbers must be positive or 0") |
157 |
|
raise TypecastError, tmsg |
158 |
return v |
return v |
159 |
except ValueError: |
except ValueError: |
160 |
raise TypecastError |
raise TypecastError |