Skip to content

Commit 4b76c14

Browse files
authored
Merge pull request #123 from nsoranzo/patch-1
Temporarily support for Python 2.7.0-2.7.8
2 parents 8a8263e + 6b25e39 commit 4b76c14

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bagit.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ def find_locale_dir():
122122
# Payload-Oxum is autogenerated
123123
]
124124

125-
CHECKSUM_ALGOS = hashlib.algorithms_guaranteed
125+
try:
126+
CHECKSUM_ALGOS = hashlib.algorithms_guaranteed
127+
except AttributeError:
128+
# FIXME: remove when we drop Python 2 (https://github.com/LibraryOfCongress/bagit-python/issues/102)
129+
# Python 2.7.0-2.7.8
130+
CHECKSUM_ALGOS = set(hashlib.algorithms)
126131
DEFAULT_CHECKSUMS = ["sha256", "sha512"]
127132

128133
#: Block size used when reading files for hashing:

0 commit comments

Comments
 (0)