From: Armin Ronacher Date: Wed, 7 Aug 2013 13:25:19 +0000 (+0100) Subject: Fixed release script X-Git-Tag: 2.7.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=078a0bb612a76cd4e40713b10588c8937c943c47;p=thirdparty%2Fjinja.git Fixed release script --- diff --git a/scripts/make-release.py b/scripts/make-release.py index 144c2a44..2c2cbb61 100644 --- a/scripts/make-release.py +++ b/scripts/make-release.py @@ -17,6 +17,9 @@ from datetime import datetime, date from subprocess import Popen, PIPE +_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)') + + def parse_changelog(): with open('CHANGES') as f: lineiter = iter(f) @@ -53,8 +56,7 @@ def bump_version(version): def parse_date(string): - string = string.replace('th ', ' ').replace('nd ', ' ') \ - .replace('rd ', ' ').replace('st ', ' ') + string = _date_strip_re.sub('', string) return datetime.strptime(string, '%B %d %Y')