Author: Philip Jenvey <[email protected]>
Branch: stdlib-2.7.11
Changeset: r83310:2dca7754d180
Date: 2016-03-23 18:51 -0700
http://bitbucket.org/pypy/pypy/changeset/2dca7754d180/

Log:    workaround hasattr masking stack overflow RuntimeErrors expected by
        recursion tests, sigh. only test_recursive_dict_subclass_key seemed
        to trigger this

diff --git a/lib-python/2.7/pickle.py b/lib-python/2.7/pickle.py
--- a/lib-python/2.7/pickle.py
+++ b/lib-python/2.7/pickle.py
@@ -351,7 +351,9 @@
             raise PicklingError("args from reduce() should be a tuple")
 
         # Assert that func is callable
-        if not hasattr(func, '__call__'):
+        try:
+            func.__call__
+        except AttributeError:
             raise PicklingError("func from reduce should be callable")
 
         save = self.save
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to