[Jython-checkins] jython (2.5): #1716 Backport fix: xrange slicing raises NPE. Thanks Andreas Stührkf!

frank.wierzbicki jython-checkins at python.org
Wed Feb 6 19:22:23 CET 2013


http://hg.python.org/jython/rev/3345d6e15c79
changeset:   6999:3345d6e15c79
branch:      2.5
parent:      6884:4c3155645812
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Wed Feb 06 10:08:46 2013 -0800
summary:
  #1716 Backport fix: xrange slicing raises NPE. Thanks Andreas Stührkf!

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


diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,12 @@
 Jython 2.7a1
   Bugs Fixed
 
+Jython 2.5.4rc1
+  Bugs Fixed
+    - [ 1716 ] xrange slicing raises NPE.
+
 Jython 2.5.3rc1
+  Bugs Fixed
     - [ 1952 ] __import__(): Handling of non-dict globals argument incompatible with CPython
     - [ 1900 ] Python imports from Java cause some Python imports to fail
 
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