summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Sutch <samuraiblog@gmail.com>2012-02-07 11:21:50 -0800
committerSamuel Sutch <samuraiblog@gmail.com>2012-02-07 11:21:50 -0800
commiteab0aaef969bf658d7586d5437bfe081d89ea236 (patch)
tree29d78f27c8004c2c8a99bb507554487118a74cc4
parente76163065a6813b3bd4205918fc6c75b7e526988 (diff)
downloadboto-eab0aaef969bf658d7586d5437bfe081d89ea236.tar.gz
Unbound local error in get_dynamodb_type when using set types.
-rw-r--r--boto/dynamodb/layer2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/boto/dynamodb/layer2.py b/boto/dynamodb/layer2.py
index 858c3998..b972e841 100644
--- a/boto/dynamodb/layer2.py
+++ b/boto/dynamodb/layer2.py
@@ -183,6 +183,7 @@ class Layer2(object):
the corresponding Amazon DynamoDB type. If the value passed in is
not a supported type, raise a TypeError.
"""
+ dynamodb_type = None
if is_num(val):
dynamodb_type = 'N'
elif is_str(val):
@@ -192,7 +193,7 @@ class Layer2(object):
dynamodb_type = 'NS'
elif False not in map(is_str, val):
dynamodb_type = 'SS'
- else:
+ if dynamodb_type is None:
raise TypeError('Unsupported type "%s" for value "%s"' % (type(val), val))
return dynamodb_type