Skip to content

Commit

Permalink
urlutils: hashlib and md5
Browse files Browse the repository at this point in the history
* BETTER Uses `md5` from `hashlib` when available. (closes inveniosoftware#3382)

Signed-off-by: Tibor Simko <[email protected]>
  • Loading branch information
tiborsimko committed Nov 14, 2016
1 parent b3c774a commit 93c21a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/miscutil/lib/urlutils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2016 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -36,12 +36,12 @@
from urllib import urlencode, quote_plus, quote, FancyURLopener
from urlparse import urlparse
from cgi import parse_qs, escape
from md5 import md5

try:
from hashlib import sha256, sha1
from hashlib import sha256, sha1, md5
HASHLIB_IMPORTED = True
except ImportError:
from md5 import md5
HASHLIB_IMPORTED = False

from invenio import webinterface_handler_config as apache
Expand Down

0 comments on commit 93c21a5

Please sign in to comment.