Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-12-05 16:17:33 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-12-05 16:22:09 (GMT)
commitf48992f42e8261dfc8a79b0d58e30d5b89deac3f (patch)
tree6d8db1589f0ec4f9f72ae5c53a6964e71a730beb
parentfa0bf8ee2d79bd7ae73410a4de8d051221a02e52 (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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/plotlib.py b/plotlib.py
index d6527b9..7c52f6d 100644
--- a/plotlib.py
+++ b/plotlib.py
@@ -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')