X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fbup%2Fhelpers.py;h=d3eea3777676294a04c25e57e5ae0503ecd2919b;hb=014cdaff5d18ef054b57e4f0f540b6c75d35c0f1;hp=fad48faa5f5f8db577f3920751a06977a86da218;hpb=63f423bc54152eee82cd9708a2566c8713023994;p=bup.git diff --git a/lib/bup/helpers.py b/lib/bup/helpers.py index fad48fa..d3eea37 100644 --- a/lib/bup/helpers.py +++ b/lib/bup/helpers.py @@ -1,7 +1,7 @@ """Helper functions and classes for bup.""" import sys, os, pwd, subprocess, errno, socket, select, mmap, stat, re, struct -import heapq, operator, time, platform, grp +import hashlib, heapq, operator, time, platform, grp from bup import _version, _helpers import bup._helpers as _helpers @@ -800,18 +800,7 @@ def grafted_path_components(graft_points, path): return result return path_components(clean_path) -# hashlib is only available in python 2.5 or higher, but the 'sha' module -# produces a DeprecationWarning in python 2.6 or higher. We want to support -# python 2.4 and above without any stupid warnings, so let's try using hashlib -# first, and downgrade if it fails. -try: - import hashlib -except ImportError: - import sha - Sha1 = sha.sha -else: - Sha1 = hashlib.sha1 - +Sha1 = hashlib.sha1 def version_date(): """Format bup's version date string for output."""