Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 9682817

Browse files
committed
typing: fix all type issues
1 parent 7c9f1a0 commit 9682817

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

linkedin_messaging/api_objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from datetime import datetime
22
from dataclasses import dataclass, field
3-
from typing import Any, List, Optional
3+
from typing import Any, Callable, Dict, List, Optional
44

55
import dataclasses_json
66
from dataclasses_json import (
@@ -41,7 +41,7 @@ def __repr__(self):
4141
datetime: (lambda s: datetime.fromtimestamp(int(s) / 1000) if s else None),
4242
URN: (lambda s: URN(s) if s else None),
4343
}
44-
encoder_functions = {
44+
encoder_functions: Dict[Any, Callable[[Any], Any]] = {
4545
datetime: (lambda d: int(d.timestamp() * 1000) if d else None),
4646
URN: (lambda u: str(u) if u else None),
4747
}

linkedin_messaging/linkedin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,15 @@ def __init__(self):
8080
@staticmethod
8181
def from_pickle(pickle_str: bytes) -> "LinkedInMessaging":
8282
linkedin = LinkedInMessaging()
83+
assert isinstance(linkedin.session.cookie_jar, aiohttp.CookieJar)
8384
linkedin.session.cookie_jar._cookies = pickle.loads(pickle_str)
8485
for c in linkedin.session.cookie_jar:
8586
if c.key == "JSESSIONID":
8687
linkedin.session.headers["csrf-token"] = c.value.strip('"')
8788
return linkedin
8889

8990
def to_pickle(self) -> bytes:
91+
assert isinstance(self.session.cookie_jar, aiohttp.CookieJar)
9092
return pickle.dumps(self.session.cookie_jar._cookies)
9193

9294
async def close(self):

0 commit comments

Comments
 (0)