mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merged revisions 61964-61979 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61964 | benjamin.peterson | 2008-03-27 01:25:33 +0100 (Thu, 27 Mar 2008) | 2 lines add commas for introductory clauses ........ r61965 | christian.heimes | 2008-03-27 02:36:21 +0100 (Thu, 27 Mar 2008) | 1 line Hopefully added _fileio module to the Windows build system ........ r61966 | christian.heimes | 2008-03-27 02:38:47 +0100 (Thu, 27 Mar 2008) | 1 line Revert commit accident ........ r61967 | neal.norwitz | 2008-03-27 04:49:54 +0100 (Thu, 27 Mar 2008) | 3 lines Fix bytes so it works on 64-bit platforms. (Also remove some #if 0 code that is already handled in _getbytevalue.) ........ r61968 | neal.norwitz | 2008-03-27 05:40:07 +0100 (Thu, 27 Mar 2008) | 1 line Fix memory leaks ........ r61969 | neal.norwitz | 2008-03-27 05:40:50 +0100 (Thu, 27 Mar 2008) | 3 lines Fix warnings about using char as an array subscript. This is not portable since char is signed on some platforms and unsigned on others. ........ r61970 | neal.norwitz | 2008-03-27 06:02:57 +0100 (Thu, 27 Mar 2008) | 1 line Fix test_compiler after adding unicode_literals ........ r61971 | neal.norwitz | 2008-03-27 06:03:11 +0100 (Thu, 27 Mar 2008) | 1 line Fix compiler warnings ........ r61972 | neal.norwitz | 2008-03-27 07:52:01 +0100 (Thu, 27 Mar 2008) | 1 line Pluralss only need one s, not 2 (intss -> ints) ........ r61973 | christian.heimes | 2008-03-27 10:02:33 +0100 (Thu, 27 Mar 2008) | 1 line Quick 'n dirty hack: Increase the magic by 2 to force a rebuild of pyc/pyo files on the build bots ........ r61974 | eric.smith | 2008-03-27 10:42:35 +0100 (Thu, 27 Mar 2008) | 3 lines Added test cases for single quoted strings, both forms of triple quotes, and some string concatenations. Removed unneeded __future__ print_function import. ........ r61975 | christian.heimes | 2008-03-27 11:35:52 +0100 (Thu, 27 Mar 2008) | 1 line Build bots are working again - removing the hack ........ r61976 | christian.heimes | 2008-03-27 12:46:37 +0100 (Thu, 27 Mar 2008) | 2 lines Fixed tokenize tests The tokenize module doesn't understand __future__.unicode_literals yet ........ r61977 | georg.brandl | 2008-03-27 14:27:31 +0100 (Thu, 27 Mar 2008) | 2 lines #2248: return result of QUIT from quit(). ........ r61978 | georg.brandl | 2008-03-27 14:34:59 +0100 (Thu, 27 Mar 2008) | 2 lines The bug for which there was a test in outstanding_bugs.py was agreed not to be a bug. ........ r61979 | amaury.forgeotdarc | 2008-03-28 00:23:54 +0100 (Fri, 28 Mar 2008) | 5 lines Issue2495: tokenize.untokenize did not insert space between two consecutive string literals: "" "" => """", which is invalid code. Will backport ........
This commit is contained in:
parent
3a93212824
commit
ba4af493a5
14 changed files with 71 additions and 74 deletions
|
@ -2609,17 +2609,21 @@ bytes_extend(PyBytesObject *self, PyObject *arg)
|
|||
if (! _getbytevalue(item, &value)) {
|
||||
Py_DECREF(item);
|
||||
Py_DECREF(it);
|
||||
PyMem_Free(buf);
|
||||
return NULL;
|
||||
}
|
||||
buf[len++] = value;
|
||||
Py_DECREF(item);
|
||||
if (len >= buf_size) {
|
||||
char *new_buf;
|
||||
buf_size = len + (len >> 1) + 1;
|
||||
buf = (char *)PyMem_Realloc(buf, buf_size * sizeof(char));
|
||||
if (buf == NULL) {
|
||||
new_buf = (char *)PyMem_Realloc(buf, buf_size * sizeof(char));
|
||||
if (new_buf == NULL) {
|
||||
Py_DECREF(it);
|
||||
PyMem_Free(buf);
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
buf = new_buf;
|
||||
}
|
||||
}
|
||||
Py_DECREF(it);
|
||||
|
|
|
@ -1607,7 +1607,7 @@ PyFloat_Fini(void)
|
|||
}
|
||||
else {
|
||||
fprintf(stderr,
|
||||
": %" PY_FORMAT_SIZE_T "d unfreed floats%s in %"
|
||||
": %" PY_FORMAT_SIZE_T "d unfreed float%s in %"
|
||||
PY_FORMAT_SIZE_T "d out of %"
|
||||
PY_FORMAT_SIZE_T "d block%s\n",
|
||||
fsum, fsum == 1 ? "" : "s",
|
||||
|
|
|
@ -1620,7 +1620,7 @@ long_from_binary_base(char **str, int base)
|
|||
n >>= 1;
|
||||
/* n <- total # of bits needed, while setting p to end-of-string */
|
||||
n = 0;
|
||||
while (_PyLong_DigitValue[Py_CHARMASK(*p)] < base)
|
||||
while (_PyLong_DigitValue[(unsigned)Py_CHARMASK(*p)] < base)
|
||||
++p;
|
||||
*str = p;
|
||||
/* n <- # of Python digits needed, = ceiling(n/PyLong_SHIFT). */
|
||||
|
@ -1641,7 +1641,7 @@ long_from_binary_base(char **str, int base)
|
|||
bits_in_accum = 0;
|
||||
pdigit = z->ob_digit;
|
||||
while (--p >= start) {
|
||||
int k = _PyLong_DigitValue[Py_CHARMASK(*p)];
|
||||
int k = _PyLong_DigitValue[(unsigned)Py_CHARMASK(*p)];
|
||||
assert(k >= 0 && k < base);
|
||||
accum |= (twodigits)(k << bits_in_accum);
|
||||
bits_in_accum += bits_per_char;
|
||||
|
@ -1828,7 +1828,7 @@ digit beyond the first.
|
|||
|
||||
/* Find length of the string of numeric characters. */
|
||||
scan = str;
|
||||
while (_PyLong_DigitValue[Py_CHARMASK(*scan)] < base)
|
||||
while (_PyLong_DigitValue[(unsigned)Py_CHARMASK(*scan)] < base)
|
||||
++scan;
|
||||
|
||||
/* Create a long object that can contain the largest possible
|
||||
|
@ -1854,10 +1854,10 @@ digit beyond the first.
|
|||
/* Work ;-) */
|
||||
while (str < scan) {
|
||||
/* grab up to convwidth digits from the input string */
|
||||
c = (digit)_PyLong_DigitValue[Py_CHARMASK(*str++)];
|
||||
c = (digit)_PyLong_DigitValue[(unsigned)Py_CHARMASK(*str++)];
|
||||
for (i = 1; i < convwidth && str != scan; ++i, ++str) {
|
||||
c = (twodigits)(c * base +
|
||||
_PyLong_DigitValue[Py_CHARMASK(*str)]);
|
||||
_PyLong_DigitValue[(unsigned)Py_CHARMASK(*str)]);
|
||||
assert(c < PyLong_BASE);
|
||||
}
|
||||
|
||||
|
|
|
@ -512,13 +512,13 @@ PyObject *PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
|
|||
/* Single characters are shared when using this constructor.
|
||||
Restrict to ASCII, since the input must be UTF-8. */
|
||||
if (size == 1 && Py_CHARMASK(*u) < 128) {
|
||||
unicode = unicode_latin1[Py_CHARMASK(*u)];
|
||||
unicode = unicode_latin1[(unsigned)Py_CHARMASK(*u)];
|
||||
if (!unicode) {
|
||||
unicode = _PyUnicode_New(1);
|
||||
if (!unicode)
|
||||
return NULL;
|
||||
unicode->str[0] = Py_CHARMASK(*u);
|
||||
unicode_latin1[Py_CHARMASK(*u)] = unicode;
|
||||
unicode_latin1[(unsigned)Py_CHARMASK(*u)] = unicode;
|
||||
}
|
||||
Py_INCREF(unicode);
|
||||
return (PyObject *)unicode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue