Skip to content

Commit ee85c54

Browse files
committed
Remove roundup/anypy/hashlib_.py
The hashlib_ module was being used to provide backwards compatibility for python v2.4. Roundup has dropped support for python v2.4 so we can get rid of it.
1 parent cee288b commit ee85c54

File tree

8 files changed

+6
-176
lines changed

8 files changed

+6
-176
lines changed

2to3-done.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ TODO
9090
./test/session_common.py
9191
./test/test_actions.py
9292
./test/test_anydbm.py
93-
./test/test_anypy_hashlib.py
9493
./test/test_cgi.py
9594
./test/test_dates.py
9695
./test/test_hyperdbvals.py
@@ -148,7 +147,6 @@ NOTHING DONE
148147
./roundup/__init__.py
149148
./roundup/actions.py
150149
./roundup/anypy/__init__.py
151-
./roundup/anypy/hashlib_.py
152150
./roundup/anypy/sets_.py
153151
./roundup/backends/blobfiles.py
154152
./roundup/backends/indexer_xapian.py

roundup/anypy/README.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,4 @@ To avoid unnecessary imports, you can::
3636
except NameError:
3737
from roundup.anypy.sets_ import set
3838

39-
hashlib_: md5/sha/hashlib compatibility
40-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41-
42-
The md5 and sha modules are deprecated since Python 2.6; the hashlib
43-
module, introduced with Python 2.5, is recommended instead.
44-
45-
Change all::
46-
import md5
47-
md5.md5(), md5.new()
48-
import sha
49-
sha.sha(), sha.new()
50-
51-
to::
52-
from roundup.anypy.hashlib_ import md5
53-
md5()
54-
from roundup.anypy.hashlib_ import sha1
55-
sha1()
56-
5739
# vim: si

roundup/anypy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"""
44
VERSION = '.'.join(map(str,
55
(0,
6-
1, # hashlib_, sets_
6+
2, # set_
77
)))

roundup/anypy/hashlib_.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

roundup/install_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
__docformat__ = 'restructuredtext'
2222

2323
import os, shutil
24-
from roundup.anypy.hashlib_ import sha1
24+
from hashlib import sha1
2525

2626
sgml_file_types = [".xml", ".ent", ".html"]
2727
hash_file_types = [".py", ".sh", ".conf", ".cgi"]

roundup/password.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
import re, string, random
2323
from base64 import b64encode, b64decode
24-
from roundup.anypy.hashlib_ import md5, sha1, shamodule
24+
from hashlib import md5, sha1
25+
2526
try:
2627
import crypt
2728
except ImportError:
@@ -65,7 +66,7 @@ def xor_bytes(left, right):
6566
def _pbkdf2(password, salt, rounds, keylen):
6667
digest_size = 20 # sha1 generates 20-byte blocks
6768
total_blocks = int((keylen+digest_size-1)/digest_size)
68-
hmac_template = HMAC(password, None, shamodule)
69+
hmac_template = HMAC(password, None, sha1)
6970
out = _bempty
7071
for i in xrange(1, total_blocks+1):
7172
hmac = hmac_template.copy()

test/test_anypy_hashlib.py

Lines changed: 0 additions & 138 deletions
This file was deleted.

test/test_hyperdbvals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010

1111
import unittest, os, shutil, errno, sys, difflib, cgi, re
12-
from roundup.anypy.hashlib_ import sha1
12+
from hashlib import sha1
1313

1414
from roundup import init, instance, password, hyperdb, date
1515

0 commit comments

Comments
 (0)