From: Guido van Rossum Date: Tue, 25 Aug 1992 12:31:03 +0000 (+0000) Subject: Changed to use regex directly instead of regexp. X-Git-Tag: v0.9.8~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=354166fa0557c0873100890a0e0ad70a6e33e68c;p=thirdparty%2FPython%2Fcpython.git Changed to use regex directly instead of regexp. --- diff --git a/Lib/irix5/flp.py b/Lib/irix5/flp.py index fcc95f02cb9b..39b45dcd4557 100755 --- a/Lib/irix5/flp.py +++ b/Lib/irix5/flp.py @@ -250,12 +250,13 @@ _parse_func = { \ # This function parses a line, and returns either # a string or a tuple (name,value) -import regexp +import regex +prog = regex.compile('^\([^:]*\): *\(.*\)') def _parse_line(line): - a = regexp.match('^([^:]*): *(.*)', line) - if not a: + if prog.match(line) < 0: return line + a = prog.regs name = line[:a[1][1]] if name[0] == 'N': name = string.joinfields(string.split(name),'') diff --git a/Lib/plat-irix5/flp.py b/Lib/plat-irix5/flp.py index fcc95f02cb9b..39b45dcd4557 100755 --- a/Lib/plat-irix5/flp.py +++ b/Lib/plat-irix5/flp.py @@ -250,12 +250,13 @@ _parse_func = { \ # This function parses a line, and returns either # a string or a tuple (name,value) -import regexp +import regex +prog = regex.compile('^\([^:]*\): *\(.*\)') def _parse_line(line): - a = regexp.match('^([^:]*): *(.*)', line) - if not a: + if prog.match(line) < 0: return line + a = prog.regs name = line[:a[1][1]] if name[0] == 'N': name = string.joinfields(string.split(name),'')