Permalink
Browse files

Raise instances instead of classes

--HG--
branch : sneakylang
  • Loading branch information...
1 parent 06a2e56 commit 59419ed4bdd3bbc99ddfb2615977a072b3ac0966 almad committed Mar 24, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 sneakylang/treebuilder.py
View
6 sneakylang/treebuilder.py
@@ -7,7 +7,7 @@ def root_required(fn):
"""
def _innerWrapper(self, *args, **kwargs):
if self.root is None:
- raise ValueError, "For this operation, root for treebuilder must be set"
+ raise ValueError("For this operation, root for treebuilder must be set")
return fn(self, *args, **kwargs)
return _innerWrapper
@@ -39,7 +39,7 @@ def insert(self, node, index, move_actual=True):
@root_required
def move_up(self):
if self.actual_node.parent is None:
- raise ValueError, 'Cannot move up as there is no parent of current node'
+ raise ValueError('Cannot move up as there is no parent of current node')
else:
self._actual_node = self.actual_node.parent
@@ -85,6 +85,6 @@ def set_actual_node(self, node):
if self.root == node or (self.root is not None and self.get_node_from_children(node, self.root.children) == node):
self._actual_node = node
else:
- raise ValueError, 'Node %s not found in tree' % node
+ raise ValueError('Node %s not found in tree' % node)
actual_node = property(fget=get_actual_node)

0 comments on commit 59419ed

Please sign in to comment.