Commits

Jean-Tiare Le Bigot committed ba7984d

remove 3 dead try/except blocks

  • Participants
  • Parent commits ee0a4c3

Comments (0)

Files changed (1)

ddbmock/database/table.py

 
     def delete_item(self, key, expected):
         key = Item(key)
-        try:
-            hash = key.read_key(self.hash_key, u'HashKeyElement')
-            range = key.read_key(self.range_key, u'RangeKeyElement')
-        except KeyError:
-            raise ValidationException("Either hash, range or both key is missing")
+        hash = key.read_key(self.hash_key, u'HashKeyElement')
+        range = key.read_key(self.range_key, u'RangeKeyElement')
 
         old = self.data[hash][range]
         old.assert_match_expected(expected)
 
     def put(self, item, expected):
         item = Item(item)
-        try:
-            hash = item.read_key(self.hash_key)
-            range = item.read_key(self.range_key)
-        except KeyError:
-            raise ValidationException("Either hash, range or both key is missing")
+        hash = item.read_key(self.hash_key)
+        range = item.read_key(self.range_key)
 
         old = self.data[hash][range]
         old.assert_match_expected(expected)
 
     def get(self, key, fields):
         key = Item(key)
-        try:
-            hash = key.read_key(self.hash_key, u'HashKeyElement')
-            range = key.read_key(self.range_key, u'RangeKeyElement')
-        except KeyError:
-            raise ValidationException("Either hash, range or both key is missing")
+        hash = key.read_key(self.hash_key, u'HashKeyElement')
+        range = key.read_key(self.range_key, u'RangeKeyElement')
 
         item = self.data[hash][range]