summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-02-13 13:57:31 -0800
committerZac Medico <zmedico@gentoo.org>2012-02-13 13:57:31 -0800
commit36883148297f4ff96c404ab23d75739dd21de31c (patch)
treeadca796f63f96973e63003d0259468803042ba39
parent8346a62a08c91de8b7672faa0ebfb91d0e647fa0 (diff)
downloadportage-36883148297f4ff96c404ab23d75739dd21de31c.tar.gz
portage-36883148297f4ff96c404ab23d75739dd21de31c.tar.bz2
portage-36883148297f4ff96c404ab23d75739dd21de31c.zip
checksum.py: remove PyPy 1.7 workarounds
The corresponding hashlib issues are fixed in PyPy 1.8: https://bugs.pypy.org/issue957
-rw-r--r--pym/portage/checksum.py31
1 files changed, 1 insertions, 30 deletions
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
index 77035b600..73e01b519 100644
--- a/pym/portage/checksum.py
+++ b/pym/portage/checksum.py
@@ -1,5 +1,5 @@
# checksum.py -- core Portage functionality
-# Copyright 1998-2011 Gentoo Foundation
+# Copyright 1998-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import portage
@@ -9,7 +9,6 @@ from portage import os
from portage import _encodings
from portage import _unicode_encode
import errno
-import platform
import stat
import tempfile
@@ -62,28 +61,6 @@ class _generate_hash_function(object):
return (checksum.hexdigest(), size)
-_test_hash_func = False
-if platform.python_implementation() == 'PyPy':
- def _test_hash_func(constructor):
- """
- Test for PyPy crashes observed with hashlib's ripemd160 and whirlpool
- functions executed under pypy-1.7 with Python 2.7.1:
- *** glibc detected *** pypy-c1.7: free(): invalid next size (fast): 0x0b963a38 ***
- *** glibc detected *** pypy-c1.7: free(): corrupted unsorted chunks: 0x09c490b0 ***
- """
- import random
- pid = os.fork()
- if pid == 0:
- data = list(b'abcdefg')
- for i in range(10):
- checksum = constructor()
- random.shuffle(data)
- checksum.update(b''.join(data))
- checksum.hexdigest()
- os._exit(os.EX_OK)
- pid, status = os.waitpid(pid, 0)
- return os.WIFEXITED(status) and os.WEXITSTATUS(status) == os.EX_OK
-
# Define hash functions, try to use the best module available. Later definitions
# override earlier ones
@@ -152,12 +129,6 @@ try:
except ValueError:
pass
else:
- if _test_hash_func and \
- not _test_hash_func(functools.partial(hashlib.new, hash_name)):
- portage.util.writemsg("\n!!! hash function appears to "
- "crash python: %s from %s\n" %
- (hash_name, "hashlib"), noiselevel=-1)
- continue
globals()['%shash' % local_name] = \
_generate_hash_function(local_name.upper(), \
functools.partial(hashlib.new, hash_name), \