summaryrefslogtreecommitdiff
path: root/jsonschema/_utils.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2013-12-01 19:52:36 -0500
committerJulian Berman <Julian@GrayVines.com>2013-12-01 20:26:53 -0500
commitbbbc8f8c22638edd1095a21cc1f87b79e782372f (patch)
tree25261450716763d315f7e1be5305ac5970683660 /jsonschema/_utils.py
parent3de5b177c797b35fad243eff5446c0a6e0cd1def (diff)
downloadjsonschema-bbbc8f8c22638edd1095a21cc1f87b79e782372f.tar.gz
Don't mix unicode and bytes when loading schemas.
Get rid of stupid from __future__ import unicode_literals in places, which was causing these to be unicode.
Diffstat (limited to 'jsonschema/_utils.py')
-rw-r--r--jsonschema/_utils.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py
index 44a577a..620dab4 100644
--- a/jsonschema/_utils.py
+++ b/jsonschema/_utils.py
@@ -53,13 +53,12 @@ def load_schema(name):
Load a schema from ./schemas/``name``.json and return it.
"""
- schemadir = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- 'schemas'
+
+ schema_dir = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), "schemas",
)
- schemapath = os.path.join(schemadir, '%s.json' % (name,))
- with open(schemapath) as f:
- return json.load(f)
+ with open(os.path.join(schema_dir, name + ".json")) as schema_file:
+ return json.load(schema_file)
def indent(string, times=1):