forked from orbit-oss/flask
Hopefully fixed release script date parsing thingy. This fixes #299
This commit is contained in:
parent
5b16532000
commit
505cd663cd
1 changed files with 3 additions and 2 deletions
|
|
@ -16,6 +16,8 @@ import re
|
|||
from datetime import datetime, date
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
_date_clean_re = re.compile(r'(\d+)(st|nd|rd|th)')
|
||||
|
||||
|
||||
def parse_changelog():
|
||||
with open('CHANGES') as f:
|
||||
|
|
@ -52,8 +54,7 @@ def bump_version(version):
|
|||
|
||||
|
||||
def parse_date(string):
|
||||
string = string.replace('th ', ' ').replace('nd ', ' ') \
|
||||
.replace('rd ', ' ').replace('st ', ' ')
|
||||
string = _date_clean_re.sub(r'\1', string)
|
||||
return datetime.strptime(string, '%B %d %Y')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue