Skip to content

Commit

Permalink
Merge pull request #225 from 0dm/pickling_investigation
Browse files Browse the repository at this point in the history
Use pickle.HIGHEST_PROTOCOL
  • Loading branch information
abrichr authored Jun 9, 2023
2 parents 7db7cc9 + 9ea3953 commit 45b77ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openadapt/window/_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_active_window_state():
}
rval = deepconvert_objc(rval)
try:
pickle.dumps(rval)
pickle.dumps(rval, protocol=pickle.HIGHEST_PROTOCOL)
except Exception as exc:
logger.warning(f"{exc=}")
rval.pop("data")
Expand Down Expand Up @@ -155,7 +155,7 @@ def get_active_element_state(x, y):
state = dump_state(el.ref)
state = deepconvert_objc(state)
try:
pickle.dumps(state)
pickle.dumps(state, protocol=pickle.HIGHEST_PROTOCOL)
except Exception as exc:
logger.warning(f"{exc=}")
state = {}
Expand All @@ -168,7 +168,7 @@ def main():

state = get_active_window_state()
pprint(state)
pickle.dumps(state)
pickle.dumps(state, protocol=pickle.HIGHEST_PROTOCOL)
import ipdb; ipdb.set_trace()


Expand Down

0 comments on commit 45b77ce

Please sign in to comment.