Skip to content

Commit

Permalink
Work around Pendulum type issue
Browse files Browse the repository at this point in the history
This a work-around for python-pendulum/pendulum#450.
  • Loading branch information
Éric Lemoine committed Mar 13, 2020
1 parent bf9bc55 commit 1372947
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions procrastinate/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import contextlib
import datetime
import json
import logging
import os
Expand Down Expand Up @@ -207,7 +206,9 @@ def load_json_args(json_args: str, json_loads: Callable) -> types.JSONDict:
return args


def get_schedule_at(at: Optional[str]) -> Optional[datetime.datetime]:
# return type should not be Optional[str], but there's a typing bug in
# Pendulum 2.1.0 (https://github.com/sdispater/pendulum/issues/450)
def get_schedule_at(at: Optional[str]) -> Optional[str]:
if at is None:
return None

Expand Down

0 comments on commit 1372947

Please sign in to comment.