Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r87080:709d1b5a8b17
Date: 2016-09-13 16:45 +0200
http://bitbucket.org/pypy/pypy/changeset/709d1b5a8b17/

Log:    Fix some pickling tests

diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py
--- a/pypy/interpreter/function.py
+++ b/pypy/interpreter/function.py
@@ -690,6 +690,9 @@
     def descr_function_repr(self):
         return self.space.wrap('<built-in function %s>' % (self.name,))
 
+    def descr__reduce__(self, space):
+        return space.wrap(self.qualname)
+
 def is_builtin_code(w_func):
     from pypy.interpreter.gateway import BuiltinCode
     if isinstance(w_func, Method):
diff --git a/pypy/interpreter/typedef.py b/pypy/interpreter/typedef.py
--- a/pypy/interpreter/typedef.py
+++ b/pypy/interpreter/typedef.py
@@ -762,6 +762,7 @@
     '__self__': GetSetProperty(always_none, cls=BuiltinFunction),
     '__repr__': interp2app(BuiltinFunction.descr_function_repr),
     '__doc__': getset_func_doc,
+    '__reduce__': interp2app(BuiltinFunction.descr__reduce__),
     })
 del BuiltinFunction.typedef.rawdict['__get__']
 BuiltinFunction.typedef.acceptable_as_base_class = False
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to