Skip to content

Commit 8bfde09

Browse files
committed
Update variation selector generator to use importlib.resources
1 parent e4ab162 commit 8bfde09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mautrix/util/variation_selector.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ async def fetch_data() -> dict[str, str]:
4343

4444
if __name__ == "__main__":
4545
import asyncio
46+
import importlib.resources
47+
import pathlib
4648
import sys
4749

48-
import pkg_resources
49-
50-
path = pkg_resources.resource_filename("mautrix.util", "variation_selector.json")
50+
path = importlib.resources.files("mautrix.util").joinpath("variation_selector.json")
51+
assert isinstance(path, pathlib.Path)
5152
emojis = asyncio.run(fetch_data())
5253
with open(path, "w") as file:
5354
json.dump(emojis, file, indent=" ", ensure_ascii=False)

0 commit comments

Comments
 (0)