Index: org/python/core/PyLong.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyLong.java,v retrieving revision 2.16 diff -c -r2.16 PyLong.java *** org/python/core/PyLong.java 31 Oct 2002 19:43:37 -0000 2.16 --- org/python/core/PyLong.java 20 Dec 2002 18:59:59 -0000 *************** *** 339,351 **** public PyObject __lshift__(PyObject right) { if (!canCoerce(right)) return null; ! return new PyLong(value.shiftLeft(coerceInt(right))); } public PyObject __rshift__(PyObject right) { if (!canCoerce(right)) return null; ! return new PyLong(value.shiftRight(coerceInt(right))); } public PyObject __and__(PyObject right) { --- 339,357 ---- public PyObject __lshift__(PyObject right) { if (!canCoerce(right)) return null; ! int rightv = coerceInt(right); ! if(rightv < 0) ! throw Py.ValueError("negative shift count"); ! return new PyLong(value.shiftLeft(rightv)); } public PyObject __rshift__(PyObject right) { if (!canCoerce(right)) return null; ! int rightv = coerceInt(right); ! if(rightv < 0) ! throw Py.ValueError("negative shift count"); ! return new PyLong(value.shiftRight(rightv)); } public PyObject __and__(PyObject right) {