Skip to content

Commit

Permalink
Address pyright warning about overload
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Feb 25, 2024
1 parent aa49078 commit 1df68e6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tasks/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@
"user_agent": "Package Control Crawler 4.0"
}


class JsonDatetimeEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime('%Y-%m-%d %H:%M:%S')
def default(self, o):
if isinstance(o, datetime.datetime):
return o.strftime('%Y-%m-%d %H:%M:%S')

if isinstance(obj, Decimal):
return float(obj)
if isinstance(o, Decimal):
return float(o)

return json.JSONEncoder.default(self, obj)
return json.JSONEncoder.default(self, o)


def store_asset(path: Path, content: str):
Expand Down

0 comments on commit 1df68e6

Please sign in to comment.