[Jython-checkins] jython: #1716 Fixes xrange slicing raises NPE. Thanks Andreas Stührkf!

frank.wierzbicki jython-checkins at python.org
Wed Feb 6 18:11:45 CET 2013


http://hg.python.org/jython/rev/d77503b7a755
changeset:   6998:d77503b7a755
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Wed Feb 06 09:11:32 2013 -0800
summary:
  #1716 Fixes xrange slicing raises NPE. Thanks Andreas Stührkf!

files:
  NEWS                              |  3 ++-
  src/org/python/core/PyXRange.java |  3 +--
  2 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
 Jython NEWS
 
-Jython 2.7a3
+Jython 2.7b1
   Bugs Fixed
+    - [ 1716 ] xrange slicing raises NPE.
     - [ 1968 ] Fixes for test_csv.py.
     - [ 1989 ] condition.notify_all() is missing.
     - [ 1994 ] threading.Event doesn't have is_set method fixed.
diff --git a/src/org/python/core/PyXRange.java b/src/org/python/core/PyXRange.java
--- a/src/org/python/core/PyXRange.java
+++ b/src/org/python/core/PyXRange.java
@@ -127,8 +127,7 @@
 
     @Override
     protected PyObject getslice(int start, int stop, int step) {
-        // not supported
-        return null;
+        throw Py.TypeError("xrange index must be integer, not 'slice'");
     }
 
     @Override

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list