summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-06-30 00:27:46 +0000
committerFredrik Lundh <fredrik@pythonware.com>2000-06-30 00:27:46 +0000
commita03e23ee8763328df4fa6007d1cf73d8843ff43a (patch)
tree52eee3364e0f1a001602ac161bc257de63264fe2 /Modules
parent38042872446ed2e21b5f1291435414dc7c0e19d7 (diff)
downloadcpython-a03e23ee8763328df4fa6007d1cf73d8843ff43a.tar.gz
- fixed split behaviour on empty matches
- fixed compiler problems when using locale/unicode flags - fixed group/octal code parsing in sub/subn templates
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sre.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 6b0fa61a70..7b1adbd177 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -1534,6 +1534,9 @@ pattern_getattr(PatternObject* self, char* name)
if (!strcmp(name, "flags"))
return Py_BuildValue("i", self->flags);
+ if (!strcmp(name, "groups"))
+ return Py_BuildValue("i", self->groups);
+
if (!strcmp(name, "groupindex") && self->groupindex) {
Py_INCREF(self->groupindex);
return self->groupindex;
@@ -1939,9 +1942,6 @@ scanner_getattr(ScannerObject* self, char* name)
return self->pattern;
}
- if (!strcmp(name, "groups"))
- return Py_BuildValue("i", ((PatternObject*) self->pattern)->groups);
-
PyErr_SetString(PyExc_AttributeError, name);
return NULL;
}