]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport tim_one's checkin of
authorMichael W. Hudson <mwh@python.net>
Tue, 5 Mar 2002 15:38:43 +0000 (15:38 +0000)
committerMichael W. Hudson <mwh@python.net>
Tue, 5 Mar 2002 15:38:43 +0000 (15:38 +0000)
    revision 1.116 of test_descr.py

_PyLong_Copy():  was creating a copy of the absolute value, but should
copy the sign too.  Added a test to test_descr to ensure that it does.

Bugfix candidate.

Lib/test/test_descr.py

index e667efb18af72c6f4e8bb75a5e9e2d84e14a0228..de9bba163660a0d4890a268bd4d2d54493ce9bd0 100644 (file)
@@ -1751,6 +1751,7 @@ def inherits():
     # Check that negative clones don't segfault
     a = longclone(-1)
     vereq(a.__dict__, {})
+    vereq(long(a), -1)  # verify PyNumber_Long() copies the sign bit
 
     class precfloat(float):
         __slots__ = ['prec']