[Python-checkins] r69829 - python/branches/io-c/Modules/_stringio.c
benjamin.peterson
python-checkins at python.org
Sat Feb 21 03:02:28 CET 2009
Author: benjamin.peterson
Date: Sat Feb 21 03:02:28 2009
New Revision: 69829
Log:
this assertions makes more sense here
Modified:
python/branches/io-c/Modules/_stringio.c
Modified: python/branches/io-c/Modules/_stringio.c
==============================================================================
--- python/branches/io-c/Modules/_stringio.c (original)
+++ python/branches/io-c/Modules/_stringio.c Sat Feb 21 03:02:28 2009
@@ -94,7 +94,6 @@
PyObject *decoded = NULL;
assert(self->buf != NULL);
assert(self->pos >= 0);
- assert(len >= 0);
if (self->decoder != NULL) {
decoded = _PyIncrementalNewlineDecoder_decode(
@@ -117,6 +116,8 @@
str = PyUnicode_AS_UNICODE(decoded);
len = PyUnicode_GET_SIZE(decoded);
+ assert(len >= 0);
+
/* This overflow check is not strictly necessary. However, it avoids us to
deal with funky things like comparing an unsigned and a signed
integer. */
More information about the Python-checkins
mailing list