Skip to content

Commit b314e72

Browse files
cloudpickle isinstance() (#487)
* cloudpickle isinstance() * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update backend.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 649ef6c commit b314e72

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

executorlib/cache/backend.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def backend_load_file(file_name: str) -> dict:
1818
"""
1919
apply_dict = load(file_name=file_name)
2020
apply_dict["args"] = [
21-
arg if not isinstance(arg, FutureItem) else arg.result()
21+
arg if not _isinstance(arg, FutureItem) else arg.result()
2222
for arg in apply_dict["args"]
2323
]
2424
apply_dict["kwargs"] = {
25-
key: arg if not isinstance(arg, FutureItem) else arg.result()
25+
key: arg if not _isinstance(arg, FutureItem) else arg.result()
2626
for key, arg in apply_dict["kwargs"].items()
2727
}
2828
return apply_dict
@@ -62,3 +62,7 @@ def backend_execute_task_in_file(file_name: str) -> None:
6262
file_name=file_name,
6363
output=result,
6464
)
65+
66+
67+
def _isinstance(obj: Any, cls: type) -> bool:
68+
return str(obj.__class__) == str(cls)

0 commit comments

Comments
 (0)