Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pywhat/helper.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Helper utilities"""
import collections.abc
import os.path
import re
from enum import Enum, auto
from functools import lru_cache
from pathlib import Path

try:
import orjson as json
Expand Down Expand Up @@ -33,7 +33,7 @@ class InvalidTag(Exception):

@lru_cache()
def read_json(path: str):
fullpath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Data/" + path)
fullpath = Path(__file__).resolve().parent / "Data" / path
with open(fullpath, "rb") as myfile:
return json.loads(myfile.read())

Expand Down