mirror of
https://github.com/python/cpython.git
synced 2025-07-25 12:14:38 +00:00
Changed to use regex directly instead of regexp.
This commit is contained in:
parent
9022fceae8
commit
354166fa05
2 changed files with 8 additions and 6 deletions
|
@ -250,12 +250,13 @@ _parse_func = { \
|
||||||
# This function parses a line, and returns either
|
# This function parses a line, and returns either
|
||||||
# a string or a tuple (name,value)
|
# a string or a tuple (name,value)
|
||||||
|
|
||||||
import regexp
|
import regex
|
||||||
|
prog = regex.compile('^\([^:]*\): *\(.*\)')
|
||||||
|
|
||||||
def _parse_line(line):
|
def _parse_line(line):
|
||||||
a = regexp.match('^([^:]*): *(.*)', line)
|
if prog.match(line) < 0:
|
||||||
if not a:
|
|
||||||
return line
|
return line
|
||||||
|
a = prog.regs
|
||||||
name = line[:a[1][1]]
|
name = line[:a[1][1]]
|
||||||
if name[0] == 'N':
|
if name[0] == 'N':
|
||||||
name = string.joinfields(string.split(name),'')
|
name = string.joinfields(string.split(name),'')
|
||||||
|
|
|
@ -250,12 +250,13 @@ _parse_func = { \
|
||||||
# This function parses a line, and returns either
|
# This function parses a line, and returns either
|
||||||
# a string or a tuple (name,value)
|
# a string or a tuple (name,value)
|
||||||
|
|
||||||
import regexp
|
import regex
|
||||||
|
prog = regex.compile('^\([^:]*\): *\(.*\)')
|
||||||
|
|
||||||
def _parse_line(line):
|
def _parse_line(line):
|
||||||
a = regexp.match('^([^:]*): *(.*)', line)
|
if prog.match(line) < 0:
|
||||||
if not a:
|
|
||||||
return line
|
return line
|
||||||
|
a = prog.regs
|
||||||
name = line[:a[1][1]]
|
name = line[:a[1][1]]
|
||||||
if name[0] == 'N':
|
if name[0] == 'N':
|
||||||
name = string.joinfields(string.split(name),'')
|
name = string.joinfields(string.split(name),'')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue