summaryrefslogtreecommitdiffstats
path: root/Modules/stropmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-14 13:32:22 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-14 13:32:22 (GMT)
commit602099a7560ab65cd3e0fde9a3defc9e2beb9d87 (patch)
treedfc4b4549b3466e81bccd5ceac4bc25ae926089e /Modules/stropmodule.c
parenta96720907a040a331f4a75c254a6172daa7273e7 (diff)
downloadcpython-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.c12
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();