Commits

Stian Andreassen  committed bc1b37b

Do sign checks directly.

  • Participants
  • Parent commits 46d142d

Comments (0)

Files changed (1)

File pypy/objspace/std/longobject.py

 
 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(
 
 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"))
 
 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:
 
 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: