diff options
author | Aneesh Dogra <lionaneesh@gmail.com> | 2012-12-05 16:17:33 (GMT) |
---|---|---|
committer | Aneesh Dogra <lionaneesh@gmail.com> | 2012-12-05 16:22:09 (GMT) |
commit | f48992f42e8261dfc8a79b0d58e30d5b89deac3f (patch) | |
tree | 6d8db1589f0ec4f9f72ae5c53a6964e71a730beb | |
parent | fa0bf8ee2d79bd7ae73410a4de8d051221a02e52 (diff) |
plotlib:Fix invalid reference error.
plotlib gives out an invalid reference error when provided with equations like
"plot(plot())".
Its due to the fact that plotlib doesn't check for the number of arguments
provided. This patch adds that check, hence fixing the bug.
-rw-r--r-- | plotlib.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -29,6 +29,7 @@ class _PlotBase: Evaluation of values is done using the EqnParser class.""" def __init__(self, parser): + print "We are in init.\n\n\n" self.svg_data = "" self.parser = parser @@ -82,6 +83,10 @@ class _PlotBase: _logger.debug('plot(): %r, %r', eqn, kwargs) + if len(kwargs) == 0: + _logger.error('No variables specified.') + return None + points = kwargs.pop('points', 100) if len(kwargs) > 1: _logger.error('Too many variables specified') |