[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ftp-team/dak][master] 2 commits: use hashlib instead of deprecated md5 module



Title: GitLab

Ansgar Burchardt pushed to branch master at Debian FTP Team / dak

Commits:

1 changed file:

Changes:

  • dak/examine_package.py
    ... ... @@ -42,17 +42,11 @@ to stdout. Those functions can be used in multithreaded parts of dak.
    42 42
     
    
    43 43
     ################################################################################
    
    44 44
     
    
    45
    -# suppress some deprecation warnings in squeeze related to md5 module
    
    46
    -import warnings
    
    47
    -warnings.filterwarnings('ignore',
    
    48
    -    "the md5 module is deprecated; use hashlib instead",
    
    49
    -    DeprecationWarning)
    
    50
    -
    
    51 45
     import errno
    
    46
    +import hashlib
    
    52 47
     import os
    
    53 48
     import re
    
    54 49
     import sys
    
    55
    -import md5
    
    56 50
     import apt_pkg
    
    57 51
     import apt_inst
    
    58 52
     import shutil
    
    ... ... @@ -526,7 +520,7 @@ def get_copyright(deb_filename):
    526 520
     
    
    527 521
         o = os.popen("dpkg-deb --fsys-tarfile %s | tar xvOf - %s 2>/dev/null" % (deb_filename, cright))
    
    528 522
         cright = o.read()
    
    529
    -    copyrightmd5 = md5.md5(cright).hexdigest()
    
    523
    +    copyrightmd5 = hashlib.md5(cright).hexdigest()
    
    530 524
     
    
    531 525
         res = ""
    
    532 526
         if copyrightmd5 in printed.copyrights and printed.copyrights[copyrightmd5] != "%s (%s)" % (package, os.path.basename(deb_filename)):
    


  • Reply to: