Revision: 8888
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8888&view=rev
Author: leejjoon
Date: 2011-01-05 15:43:30 +0000 (Wed, 05 Jan 2011)
Log Message:
-----------
gridspec.GridSpecBase.__getitem__ checks its index (original patch from Paul Ivanov)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/gridspec.py
Modified: trunk/matplotlib/lib/matplotlib/gridspec.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/gridspec.py 2011-01-05 15:43:01 UTC (rev 8887)
+++ trunk/matplotlib/lib/matplotlib/gridspec.py 2011-01-05 15:43:30 UTC (rev 8888)
@@ -145,6 +145,8 @@
else:
if k1 < 0:
k1 += nrows
+ if k1 >= nrows or k1 < 0 :
+ raise IndexError("index out of range")
row1, row2 = k1, k1+1
@@ -153,6 +155,8 @@
else:
if k2 < 0:
k2 += ncols
+ if k2 >= ncols or k2 < 0 :
+ raise IndexError("index out of range")
col1, col2 = k2, k2+1
@@ -167,6 +171,8 @@
else:
if key < 0:
key += total
+ if key >= total or key < 0 :
+ raise IndexError("index out of range")
num1, num2 = key, None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|