Skip to content

Commit

Permalink
Replace deprecated pkg_resources
Browse files Browse the repository at this point in the history
importlib.metadata.version() appears to be the anointed replacement.
  • Loading branch information
justinmayer committed Oct 28, 2023
1 parent 91d9ef7 commit 865f7b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pelican/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import importlib.metadata
import json
import logging
import multiprocessing
Expand Down Expand Up @@ -30,8 +31,7 @@
from pelican.writers import Writer

try:
__version__ = __import__('pkg_resources') \
.get_distribution('pelican').version
__version__ = importlib.metadata.version("pelican")
except Exception:
__version__ = "unknown"

Expand Down

0 comments on commit 865f7b1

Please sign in to comment.