Skip to content

Commit

Permalink
small error handling change
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredly committed Jun 19, 2010
1 parent b4dc2db commit b0d0e6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clevercss/engine.py
Expand Up @@ -27,8 +27,10 @@ def __init__(self, source, parser=None, fname=None):
def evaluate(self, context=None):
"""Evaluate code."""
expr = None
if not isinstance(context, dict):
if context is None:
context = {}
elif not isinstance(context, dict):
raise TypeError("context argument must be a dictionary")

for key, value in context.iteritems():
if isinstance(value, str):
Expand Down

0 comments on commit b0d0e6f

Please sign in to comment.