mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
- fixed split behaviour on empty matches
- fixed compiler problems when using locale/unicode flags - fixed group/octal code parsing in sub/subn templates
This commit is contained in:
parent
5d6ae76c09
commit
01016fe972
4 changed files with 55 additions and 42 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue