From e9b40a12c8dec7489af35bc619c8f20690036bae Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Mon, 14 Jan 2013 00:26:46 -0500 Subject: [PATCH] Fix for Python 2.6 --- flask_security/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flask_security/utils.py b/flask_security/utils.py index 547e231..91bd65f 100644 --- a/flask_security/utils.py +++ b/flask_security/utils.py @@ -196,7 +196,8 @@ def config_value(key, app=None, default=None): def get_max_age(key, app=None): now = datetime.utcnow() expires = now + get_within_delta(key + '_WITHIN', app) - return (expires - now).total_seconds() + td = (expires - now) + return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1e6) / 1e6 def get_within_delta(key, app=None):