summaryrefslogtreecommitdiff
path: root/test/LedgerHarness.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/LedgerHarness.py')
-rwxr-xr-xtest/LedgerHarness.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/LedgerHarness.py b/test/LedgerHarness.py
index ea8290d4..44e4e61c 100755
--- a/test/LedgerHarness.py
+++ b/test/LedgerHarness.py
@@ -6,6 +6,27 @@ import re
from subprocess import Popen, PIPE
+import copy_reg
+import types
+
+def _pickle_method(method):
+ func_name = method.im_func.__name__
+ obj = method.im_self
+ cls = method.im_class
+ return _unpickle_method, (func_name, obj, cls)
+
+def _unpickle_method(func_name, obj, cls):
+ for cls in cls.mro():
+ try:
+ func = cls.__dict__[func_name]
+ except KeyError:
+ pass
+ else:
+ break
+ return func.__get__(obj, cls)
+
+copy_reg.pickle(types.MethodType, _pickle_method, _unpickle_method)
+
class LedgerHarness:
ledger = None
sourcepath = None