Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r58763:82ea27f54373 Date: 2012-11-05 16:40 -0800 http://bitbucket.org/pypy/pypy/changeset/82ea27f54373/
Log: merge default diff --git a/pypy/objspace/std/longobject.py b/pypy/objspace/std/longobject.py --- a/pypy/objspace/std/longobject.py +++ b/pypy/objspace/std/longobject.py @@ -219,7 +219,7 @@ def pow__Long_Long_Long(space, w_long1, w_long2, w_long3): # XXX need to replicate some of the logic, to get the errors right - if w_long2.num.lt(rbigint.fromint(0)): + if w_long2.num.sign < 0: raise OperationError( space.w_TypeError, space.wrap( @@ -233,7 +233,7 @@ def pow__Long_Long_None(space, w_long1, w_long2, w_long3): # XXX need to replicate some of the logic, to get the errors right - if w_long2.num.lt(rbigint.fromint(0)): + if w_long2.num.sign < 0: raise FailedToImplementArgs( space.w_ValueError, space.wrap("long pow() too negative")) @@ -256,7 +256,7 @@ def lshift__Long_Long(space, w_long1, w_long2): # XXX need to replicate some of the logic, to get the errors right - if w_long2.num.lt(rbigint.fromint(0)): + if w_long2.num.sign < 0: raise OperationError(space.w_ValueError, space.wrap("negative shift count")) try: @@ -268,7 +268,7 @@ def rshift__Long_Long(space, w_long1, w_long2): # XXX need to replicate some of the logic, to get the errors right - if w_long2.num.lt(rbigint.fromint(0)): + if w_long2.num.sign < 0: raise OperationError(space.w_ValueError, space.wrap("negative shift count")) try: diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py --- a/pypy/rlib/rbigint.py +++ b/pypy/rlib/rbigint.py @@ -969,7 +969,8 @@ while i > 1 and self._digits[i - 1] == NULLDIGIT: i -= 1 - + assert i > 0 + if i != self.numdigits(): self.size = i if self.numdigits() == 1 and self._digits[0] == NULLDIGIT: _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit