From c53c2aaea781ae7d8081d52c46683495c19ccbb3 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Mon, 6 Nov 2023 15:52:39 +0100 Subject: [PATCH] Use hashlib.md5 (2.7 and py3) as md5_new() Signed-off-by: Bernhard Kaindl --- xen-bugtool | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/xen-bugtool b/xen-bugtool index 5984baae..08e576bc 100755 --- a/xen-bugtool +++ b/xen-bugtool @@ -55,6 +55,7 @@ import traceback import urllib import xml import zipfile +from hashlib import md5 as md5_new from select import select from signal import SIGHUP, SIGTERM, SIGUSR1 from subprocess import PIPE, Popen @@ -64,15 +65,6 @@ from xml.etree.ElementTree import Element import defusedxml.sax -try: - import hashlib - def md5_new(): - return hashlib.md5() -except: - import md5 - def md5_new(): - return md5.new() - # Monkey-patch zipfile's __del__ function to be less stupid # Specifically, it calls close which further writes to the file, which # fails with ENOSPC if the root filesystem is full