From 0dda73be6724cae67fce2140d950ae93fca9cde4 Mon Sep 17 00:00:00 2001 From: Santosh Passoubady <61618641+ssantoshp@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:47:28 -0400 Subject: [PATCH] Update main.py --- src/empyrial/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/empyrial/main.py b/src/empyrial/main.py index ec70841e..e76dc1cd 100644 --- a/src/empyrial/main.py +++ b/src/empyrial/main.py @@ -764,7 +764,10 @@ def valid_range(start_date, end_date, rebalance) -> tuple: return start_date, rebalance[-1] # make the end date to a datetime - end_date = dt.datetime.strptime(end_date, "%Y-%m-%d") + try: + end_date = dt.datetime.strptime(end_date, "%Y-%m-%d") + except TypeError: + pass # gets the number of days