From 85c6ae159c47ea19cb0f3741cb6f8a91c0b175d1 Mon Sep 17 00:00:00 2001 From: empasize Date: Mon, 29 Mar 2021 13:22:11 +0200 Subject: [PATCH] revert changes to temp to reflect #180 --- lingua_franca/lang/parse_de.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lingua_franca/lang/parse_de.py b/lingua_franca/lang/parse_de.py index 72427b0d..f6c194e4 100644 --- a/lingua_franca/lang/parse_de.py +++ b/lingua_franca/lang/parse_de.py @@ -777,13 +777,8 @@ def date_found(): datestr = datestr.replace(months[idx], en_month) for idx, en_month in enumerate(en_monthsShort): datestr = datestr.replace(monthsShort[idx], en_month) - - try: - temp = datetime.strptime(datestr, "%B %d").replace(tzinfo=extractedDate.tzinfo) - except ValueError: - # Try again, allowing the year - temp = datetime.strptime(datestr, "%B %d %Y").replace(tzinfo=extractedDate.tzinfo) - + + temp = datetime.strptime(datestr, "%B %d") if not hasYear: temp = temp.replace(year=extractedDate.year) if extractedDate < temp: