Skip to content

Commit

Permalink
Handle error when importlib can't get the package version
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Dec 7, 2024
1 parent 02f8e19 commit 4d30355
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions polybot/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
from atproto import Client, models # type: ignore
from atproto_client.exceptions import RequestException # type: ignore
from mastodon import Mastodon as MastodonClient # type: ignore
from importlib.metadata import version
from importlib.metadata import PackageNotFoundError, version
import httpx

from .image import Image

POLYBOT_VERSION = version("polybot")
try:
POLYBOT_VERSION = version("polybot")
except PackageNotFoundError:
POLYBOT_VERSION = "dev"


class PostError(Exception):
Expand Down

0 comments on commit 4d30355

Please sign in to comment.