Update of /cvsroot/jython/jython/org/python/modules/sre
In directory usw-pr-cvs1:/tmp/cvs-serv539
Modified Files:
MatchObject.java
Log Message:
Fix "[ #458945 ] Missing 'lastindex' on match objects"
Index: MatchObject.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/modules/sre/MatchObject.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MatchObject.java 2000/10/28 11:57:42 1.3
--- MatchObject.java 2001/10/28 15:11:47 1.4
***************
*** 206,209 ****
--- 206,215 ----
if (key == "re")
return pattern;
+ if (key == "pos")
+ return Py.newInteger(pos);
+ if (key == "endpos")
+ return Py.newInteger(endpos);
+ if (key == "lastindex")
+ return lastindex == -1 ? Py.None : Py.newInteger(lastindex);
return super.__findattr__(key);
}
|