Skip to content

Commit 1abf7c4

Browse files
committed
Fix converter related dill error
dilling a custom converter function causes globals to be converted the root_state attribute on ChainStart instances includes things that can't be dilled
1 parent 4aa4a1a commit 1abf7c4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pythonwhat/sct_syntax.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from protowhat.sct_syntax import EagerChain, ExGen, LazyChainStart, state_dec_gen
1+
from protowhat.sct_syntax import EagerChain, ExGen, LazyChainStart, state_dec_gen, LazyChain
22
from pythonwhat.checks.check_wrappers import scts
33
from pythonwhat.State import State
44
from pythonwhat.probe import Node, Probe, TEST_NAMES
@@ -38,6 +38,10 @@ def Ex(state=None):
3838
return EagerChain(state=state or State.root_state, chainable_functions=sct_dict)
3939

4040

41+
def F():
42+
return LazyChain(chainable_functions=sct_dict)
43+
44+
4145
def get_chains():
4246
return {
4347
"Ex": ExGen(sct_dict, State.root_state),

pythonwhat/test_exercise.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def prep_context():
9494
"from inspect import Parameter as param",
9595
"from pythonwhat.signatures import sig_from_params, sig_from_obj",
9696
"from pythonwhat.State import set_converter",
97+
"from pythonwhat.sct_syntax import LazyChain as F, Ex"
9798
]
9899
[exec(line, None, cntxt) for line in imports]
99100

@@ -105,7 +106,8 @@ def prep_context():
105106
tree = None
106107

107108
cntxt.update(v2_check_functions)
108-
cntxt.update(get_chains())
109+
# TODO: ChainStart instances cause errors when dill tries to pass manual converter functions
110+
# cntxt.update(get_chains())
109111
return tree, cntxt
110112

111113

0 commit comments

Comments
 (0)