summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-06-30 00:27:46 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-06-30 00:27:46 (GMT)
commit01016fe972a90eb57bafeb1f4a73f334c201c3c2 (patch)
tree14f34bb2cea2e9f688fba020dfd00adb8c8aaa96 /Modules/_sre.c
parent5d6ae76c0925b9f0fce059f5372f633532535b67 (diff)
downloadcpython-01016fe972a90eb57bafeb1f4a73f334c201c3c2.zip
cpython-01016fe972a90eb57bafeb1f4a73f334c201c3c2.tar.gz
cpython-01016fe972a90eb57bafeb1f4a73f334c201c3c2.tar.bz2
- 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/_sre.c')
-rw-r--r--Modules/_sre.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 6b0fa61..7b1adbd 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;
}