_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.
This commit is contained in:
Tim Peters 2002-03-02 04:18:04 +00:00
parent db30ac41de
commit 5329cdb3ce
2 changed files with 2 additions and 1 deletions

View file

@ -63,7 +63,7 @@ _PyLong_Copy(PyLongObject *src)
i = -(i);
result = _PyLong_New(i);
if (result != NULL) {
result->ob_size = i;
result->ob_size = src->ob_size;
while (--i >= 0)
result->ob_digit[i] = src->ob_digit[i];
}