diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-01-02 22:02:02 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-01-02 22:02:02 (GMT) |
commit | be614ee732e5b0f292c272372794f940d7e1f4e6 (patch) | |
tree | 06af4765d98edcf0b367cfb0abdd415cb9ffae23 /Mac/scripts/fullbuild.py | |
parent | ef92edd9036fd446cf5d51fbd8342957dcc3cf60 (diff) | |
download | cpython-be614ee732e5b0f292c272372794f940d7e1f4e6.zip cpython-be614ee732e5b0f292c272372794f940d7e1f4e6.tar.gz cpython-be614ee732e5b0f292c272372794f940d7e1f4e6.tar.bz2 |
Use re in stead of regex.
Diffstat (limited to 'Mac/scripts/fullbuild.py')
-rw-r--r-- | Mac/scripts/fullbuild.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Mac/scripts/fullbuild.py b/Mac/scripts/fullbuild.py index 73ccc8f..4f718fd 100644 --- a/Mac/scripts/fullbuild.py +++ b/Mac/scripts/fullbuild.py @@ -16,7 +16,7 @@ import sys import macfs import MacOS import EasyDialogs -import regex +import re import string import aetools @@ -278,11 +278,11 @@ def incbuildno(filename): line = fp.readline() fp.close() - pat = regex.compile('#define BUILD \([0-9][0-9]*\)') - pat.match(line) - buildno = pat.group(1) - if not buildno: + pat = re.compile('#define BUILD ([0-9]+)') + m = pat.search(line) + if not m or not m.group(1): raise 'Incorrect macbuildno.h line', line + buildno = m.group(1) new = string.atoi(buildno) + 1 fp = open(filename, 'w') fp.write('#define BUILD %d\n'%new) |