Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

fix: Typo when setting the state for the pickle deserializer.#1479

Merged
clundin25 merged 3 commits intogoogleapis:mainfrom
clundin25:pickle-typo
Feb 21, 2024
Merged

fix: Typo when setting the state for the pickle deserializer.#1479
clundin25 merged 3 commits intogoogleapis:mainfrom
clundin25:pickle-typo

Conversation

@clundin25
Copy link
Copy Markdown
Contributor

No description provided.

@clundin25 clundin25 requested review from a team February 15, 2024 17:04
def __setstate__(self, state):
"""Pickle helper that deserializes the _lock attribute."""
state["_key"] = threading.Lock()
state["_lock"] = threading.Lock()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a test we could add?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK - Going to wait to hear back on #1478 before doing more

@clundin25 clundin25 requested a review from westarle February 16, 2024 15:59
@clundin25 clundin25 added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 16, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 16, 2024
@clundin25 clundin25 merged commit 08b5cc3 into googleapis:main Feb 21, 2024

def test_pickle():
w = _refresh_worker.RefreshThreadManager()
# For some reason isinstance cannot interpret threading.Lock as a type.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is that threading.Lock is a function, returning instances of _thread.lock (internal class)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants