From 097b2fe60ba7bb1f113ff69b6b68275ecc89dd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 17 Dec 2009 11:29:16 +0100 Subject: [PATCH] Use digest instead of hexdigest for key of safe_eval cache --- tryton/common/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index a1599bf2ce..61e24323f8 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -1186,9 +1186,9 @@ def safe_eval(source, data=None): if '__subclasses__' in source: raise ValueError('__subclasses__ not allowed') if hashlib: - key = hashlib.md5(source).hexdigest() + key = hashlib.md5(source).digest() else: - key = md5.new(source).hexdigest() + key = md5.new(source).digest() c = _SAFE_EVAL_CACHE.get(key) if not c: c = compile(source, '', 'eval')