Commit 2ba0ca56 authored by Simon Chabot's avatar Simon Chabot
Browse files

fix: restore strptime, but set a deprecation warning

(removed in
46942c92b211)
parent 4781929fdec8
......@@ -29,6 +29,7 @@ from time import strptime as time_strptime
from calendar import monthrange, timegm
from typing import Union, List, Any, Optional, Generator
from logilab.common.deprecation import callable_deprecated
try:
from mx.DateTime import RelativeDateTime, Date, DateTimeType
......@@ -213,6 +214,8 @@ def date_range(
ONEDAY: timedelta = timedelta(days=1)
ONEWEEK: timedelta = timedelta(days=7)
strptime = callable_deprecated("Use strptime from datetime.datetime instead")(datetime.strptime)
def strptime_time(value, format="%H:%M"):
return time(*time_strptime(value, format)[3:6])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment