Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ce87a1f authored by Doug Zongker's avatar Doug Zongker
Browse files

fix merge-event-log-tags.py deprecation warning

Prefer using the hashlib module if it's available, instead of the
deprecated md5 module.

Change-Id: Id5e50af125ae47f34d011d8612059424472c7c3f
parent 4da2f9ca
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -26,7 +26,10 @@ and fails if they do.

import cStringIO
import getopt
import md5
try:
  import hashlib
except ImportError:
  import md5 as hashlib
import struct
import sys

@@ -141,7 +144,7 @@ if warnings:
# versions of python.  Using md5 is overkill here but is the same from
# platform to platform and speed shouldn't matter in practice.
def hashname(str):
  d = md5.md5(str).digest()[:4]
  d = hashlib.md5(str).digest()[:4]
  return struct.unpack("!I", d)[0]

# Assign a tag number to all the entries that say they want one