Author: p_ziesch...@yahoo.de Branch: ep2016sprint Changeset: r85831:d9a653291715 Date: 2016-07-23 17:33 +0200 http://bitbucket.org/pypy/pypy/changeset/d9a653291715/
Log: removed long codepath (covered by the last elif path), removed duplicate comments diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py --- a/pypy/objspace/descroperation.py +++ b/pypy/objspace/descroperation.py @@ -425,29 +425,21 @@ "'%T' objects are unhashable", w_obj) w_result = space.get_and_call_function(w_hash, w_obj) w_resulttype = space.type(w_result) - + + # issue 2346 : returns now -2 for hashing -1 like cpython if space.is_w(w_resulttype, space.w_int): - # bug 2346 (return -2 for a hashvalue of -1) if space.int_w(w_result) == -1: return space.wrap(-2) return w_result - elif space.is_w(w_resulttype, space.w_long): - # bug 2346 (return -2 for a hashvalue of -1) - w_h = space.hash(w_result) - if space.int_w(w_h) == -1: - return space.wrap(-2) - return w_h elif space.isinstance_w(w_result, space.w_int): # be careful about subclasses of 'int'... int_result = space.int_w(w_result) - # bug 2346 (return -2 for a hashvalue of -1) if int_result == -1: int_result == -2 return space.wrap(int_result) elif space.isinstance_w(w_result, space.w_long): # be careful about subclasses of 'long'... bigint = space.bigint_w(w_result) - # bug 2346 (return -2 for a hashvalue of -1) h = bigint.hash() if h == -1: h = -2 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit