Skip to content
Closed
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
12 changes: 9 additions & 3 deletions jsonschema/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import re
import os
import sys

from jsonschema.compat import str_types, MutableMapping, urlsplit

Expand Down Expand Up @@ -54,9 +55,14 @@ def load_schema(name):

"""

schema_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "schemas",
)
if hasattr(sys, "frozen"):
schema_dir = os.path.join(
os.path.dirname(os.path.abspath(sys.executable)), "schemas",
)
else:
schema_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "schemas",
)
with open(os.path.join(schema_dir, name + ".json")) as schema_file:
return json.load(schema_file)

Expand Down