From 4cdd41c1046cef12601602bd38dc8ebf42d1550d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 14 Apr 2011 10:05:33 -0700 Subject: grc: replaced asserts in python subdirectory --- grc/python/expr_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grc/python/expr_utils.py') diff --git a/grc/python/expr_utils.py b/grc/python/expr_utils.py index 3c39f5d89..a2e56eedf 100644 --- a/grc/python/expr_utils.py +++ b/grc/python/expr_utils.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -118,7 +118,7 @@ def sort_variables(exprs): Get a list of variables in order of dependencies. @param exprs a mapping of variable name to expression @return a list of variable names - @throws AssertionError circular dependencies + @throws Exception circular dependencies """ var_graph = get_graph(exprs) sorted_vars = list() @@ -126,7 +126,7 @@ def sort_variables(exprs): while var_graph.get_nodes(): #get a list of nodes with no edges indep_vars = filter(lambda var: not var_graph.get_edges(var), var_graph.get_nodes()) - assert indep_vars + if not indep_vars: raise Exception('circular dependency caught in sort_variables') #add the indep vars to the end of the list sorted_vars.extend(sorted(indep_vars)) #remove each edge-less node from the graph -- cgit