diff options
author | Guido van Rossum <guido@python.org> | 1994-09-14 13:32:22 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-09-14 13:32:22 (GMT) |
commit | 602099a7560ab65cd3e0fde9a3defc9e2beb9d87 (patch) | |
tree | dfc4b4549b3466e81bccd5ceac4bc25ae926089e /Modules/stropmodule.c | |
parent | a96720907a040a331f4a75c254a6172daa7273e7 (diff) | |
download | cpython-602099a7560ab65cd3e0fde9a3defc9e2beb9d87.zip cpython-602099a7560ab65cd3e0fde9a3defc9e2beb9d87.tar.gz cpython-602099a7560ab65cd3e0fde9a3defc9e2beb9d87.tar.bz2 |
* various modules: #include "Python.h" and remove most remporary
renaming hacks
Diffstat (limited to 'Modules/stropmodule.c')
-rw-r--r-- | Modules/stropmodule.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index 68df4de..578a771 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -206,10 +206,8 @@ strop_find(self, args) if (getargs(args, "(s#s#i)", &s, &len, &sub, &n, &i)) { if (i < 0) i += len; - if (i < 0 || i+n > len) { - err_setstr(ValueError, "start offset out of range"); - return NULL; - } + if (i < 0) + i = 0; } else { err_clear(); @@ -242,10 +240,8 @@ strop_rfind(self, args) if (getargs(args, "(s#s#i)", &s, &len, &sub, &n, &i)) { if (i < 0) i += len; - if (i < 0 || i+n > len) { - err_setstr(ValueError, "start offset out of range"); - return NULL; - } + if (i < 0) + i = 0; } else { err_clear(); |