Use python3 if available

This commit incorporates [fievel's work](0863e1434e) to use python3 if possible.

I have not personally test vim+python3 but overdue dates still works with
python2.
This commit is contained in:
David Beniamine
2016-09-05 15:31:10 +02:00
parent 3e3251f8b5
commit 85c215b4cc
2 changed files with 5 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ def _year_regex_before(year):
year_regex += ')'
return '-'.join((year_regex, r'\d{2}', r'\d{2}'))
def _month_regex_before(year, month):
if month == '01':
return None
@@ -63,6 +64,7 @@ def _day_regex_before(year, month, day):
def regex_date_before(given_date):
year, month, day = given_date.isoformat().split('-')