Skip to content

Commit 0c5996a

Browse files
committed
Provide a sensible error message if pickling is required
1 parent 42364c1 commit 0c5996a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

simvue/run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ def save(self, filename, category, filetype=None, preserve_path=False, name=None
557557

558558
if not is_file:
559559
data['pickled'], data['type'] = Serializer().serialize(filename, allow_pickle)
560+
if not data['type'] and not allow_pickle:
561+
self._error('Unable to save Python object, set allow_pickle to True')
560562
data['checksum'] = calculate_sha256(data['pickled'], False)
561563
data['originalPath'] = ''
562564
data['size'] = sys.getsizeof(data['pickled'])

0 commit comments

Comments
 (0)