]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fixed release script
authorArmin Ronacher <armin.ronacher@active-4.com>
Wed, 7 Aug 2013 13:25:19 +0000 (14:25 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Wed, 7 Aug 2013 13:25:19 +0000 (14:25 +0100)
scripts/make-release.py

index 144c2a447ba351c133348c892449e1fee41debf7..2c2cbb61525da1beb424b954c8a9409339bcc1a8 100644 (file)
@@ -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')