Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
logilab-common
Commits
26f8c06f6721
Commit
2ba0ca56
authored
May 22, 2020
by
Simon Chabot
Browse files
fix: restore strptime, but set a deprecation warning
(removed in
46942c92b211
)
parent
4781929fdec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
logilab/common/date.py
View file @
26f8c06f
...
...
@@ -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
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment