Skip to content

Commit a66a4d6

Browse files
committed
init code before pickle code (for any user imports)
1 parent 724266d commit a66a4d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/wvpy/jtools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,12 @@ def render_as_html(
347347
pickle.dump(sheet_vars, file=ntf)
348348
if (init_code is None) or (len(init_code) <= 0):
349349
init_code = ""
350-
init_code = f"""
350+
pickle_code = f"""
351351
import pickle
352352
with open({tmp_path.__repr__()}, 'rb') as pf:
353353
sheet_vars = pickle.load(pf)
354-
""" + "\n\n" + init_code
354+
"""
355+
init_code = init_code + "\n\n" + pickle_code
355356
if (init_code is not None) and (len(init_code) > 0):
356357
assert isinstance(init_code, str)
357358
nb = prepend_code_cell_to_notebook(

0 commit comments

Comments
 (0)