Skip to content

Commit

Permalink
Use hashlib.md5 (2.7 and py3) as md5_new()
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Kaindl <[email protected]>
  • Loading branch information
bernhardkaindl committed Nov 6, 2023
1 parent 93929ff commit c53c2aa
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions xen-bugtool
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c53c2aa

Please sign in to comment.