# HG changeset patch # User Denis Laxalde # Date 1509351276 -3600 # Node ID 3ba6016a459c377f57234cd76d33ddce14da541e # Parent 4b5f1b6763664f063d15e96e1da550a5e7b8271e [server] Do not use logilab.common.date.strptime in sqlutils This function is aliased to datetime.datetime.strptime() and exists only for compatibility with Python <= 2.5 which we no longer support. diff -r 4b5f1b676366 -r 3ba6016a459c cubicweb/server/sqlutils.py --- a/cubicweb/server/sqlutils.py Mon Oct 30 09:08:35 2017 +0100 +++ b/cubicweb/server/sqlutils.py Mon Oct 30 09:14:36 2017 +0100 @@ -543,13 +543,11 @@ return _limit_size(text, maxsize) cnx.create_function("TEXT_LIMIT_SIZE", 2, limit_size2) - from logilab.common.date import strptime - def weekday(ustr): try: - dt = strptime(ustr, '%Y-%m-%d %H:%M:%S') + dt = datetime.strptime(ustr, '%Y-%m-%d %H:%M:%S') except: - dt = strptime(ustr, '%Y-%m-%d') + dt = datetime.strptime(ustr, '%Y-%m-%d') # expect sunday to be 1, saturday 7 while weekday method return 0 for # monday return (dt.weekday() + 1) % 7