Skip to content

Commit

Permalink
Revert "add pyinstaller support (#92)"
Browse files Browse the repository at this point in the history
This reverts commit 19d3c23.
  • Loading branch information
mdomke committed May 9, 2024
1 parent 99a1dcc commit c0019fa
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions schwifty/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import itertools
import json
import pathlib
import sys
from collections import defaultdict
from pathlib import Path
from typing import Any
Expand All @@ -15,10 +13,8 @@

try:
from importlib.resources import files
from importlib.resources.abc import Traversable
except ImportError:
from importlib_resources import files # type: ignore
from importlib_resources.abc import Traversable # type: ignore


Key = Union[str, tuple]
Expand Down Expand Up @@ -51,13 +47,8 @@ def get(name: Key) -> Value:
return _registry[name]

data = None
package_path: Traversable | Path
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
package_path = Path(sys._MEIPASS)
else:
package_path = files(__package__)
directory = package_path / f"{name}_registry"
assert isinstance(directory, pathlib.Path)
directory = files(__package__) / f"{name}_registry"
assert isinstance(directory, Path)
for entry in sorted(directory.glob("*.json")):
with entry.open(encoding="utf-8") as fp:
chunk = json.load(fp)
Expand Down

0 comments on commit c0019fa

Please sign in to comment.