Skip to content

Commit

Permalink
Just forbidding the sly Parser objects. They are just sloppy.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Oct 29, 2024
1 parent 06137b4 commit 6163536
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions montepy/mcnp_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,10 @@ def allowed_keywords(self): # pragma: no cover

def __getstate__(self):
state = self.__dict__.copy()
weakref_key = "_problem_ref"
if weakref_key in state:
del state[weakref_key]
bad_keys = {"_problem_ref", "_parser"}
for key in bad_keys:
if key in state:
del state[key]
return state

def __setstate__(self, crunchy_data):
Expand Down

0 comments on commit 6163536

Please sign in to comment.