Skip to content

Commit b2b6801

Browse files
committed
Remove more unneeded u prefixes.
1 parent fd5de14 commit b2b6801

File tree

7 files changed

+101
-101
lines changed

7 files changed

+101
-101
lines changed

docs/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
master_doc = "index"
4646

4747
# General information about the project.
48-
project = u"jsonschema"
49-
author = u"Julian Berman"
50-
copyright = u"2013, " + author
48+
project = "jsonschema"
49+
author = "Julian Berman"
50+
copyright = "2013, " + author
5151

5252
# The version info for the project you're documenting, acts as replacement for
5353
# |version| and |release|, also used in various other places throughout the
@@ -171,7 +171,7 @@
171171
# Grouping the document tree into LaTeX files. List of tuples (source
172172
# start file, target name, title, author, documentclass [howto/manual]).
173173
latex_documents = [
174-
("index", "jsonschema.tex", u"jsonschema Documentation", author, "manual"),
174+
("index", "jsonschema.tex", "jsonschema Documentation", author, "manual"),
175175
]
176176

177177
# The name of an image file (relative to this directory) to place at the top of
@@ -199,7 +199,7 @@
199199

200200
# One entry per manual page. List of tuples
201201
# (source start file, name, description, authors, manual section).
202-
man_pages = [("index", "jsonschema", u"jsonschema Documentation", [author], 1)]
202+
man_pages = [("index", "jsonschema", "jsonschema Documentation", [author], 1)]
203203

204204
# If true, show URL addresses after external links.
205205
# man_show_urls = False
@@ -214,7 +214,7 @@
214214
(
215215
"index",
216216
"jsonschema",
217-
u"jsonschema Documentation",
217+
"jsonschema Documentation",
218218
author,
219219
"jsonschema",
220220
"One line description of project.",

jsonschema/_legacy_validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ def ignore_ref_siblings(schema):
1010
1111
Suitable for use with `create`'s ``applicable_validators`` argument.
1212
"""
13-
ref = schema.get(u"$ref")
13+
ref = schema.get("$ref")
1414
if ref is not None:
15-
return [(u"$ref", ref)]
15+
return [("$ref", ref)]
1616
else:
1717
return schema.items()
1818

jsonschema/_types.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,19 @@ def remove(self, *types):
166166

167167
draft3_type_checker = TypeChecker(
168168
{
169-
u"any": is_any,
170-
u"array": is_array,
171-
u"boolean": is_bool,
172-
u"integer": is_integer,
173-
u"object": is_object,
174-
u"null": is_null,
175-
u"number": is_number,
176-
u"string": is_string,
169+
"any": is_any,
170+
"array": is_array,
171+
"boolean": is_bool,
172+
"integer": is_integer,
173+
"object": is_object,
174+
"null": is_null,
175+
"number": is_number,
176+
"string": is_string,
177177
},
178178
)
179-
draft4_type_checker = draft3_type_checker.remove(u"any")
179+
draft4_type_checker = draft3_type_checker.remove("any")
180180
draft6_type_checker = draft4_type_checker.redefine(
181-
u"integer",
181+
"integer",
182182
lambda checker, instance: (
183183
is_integer(checker, instance) or
184184
isinstance(instance, float) and instance.is_integer()

jsonschema/_validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ def not_(validator, not_schema, instance, schema):
453453

454454
def if_(validator, if_schema, instance, schema):
455455
if validator.is_valid(instance, if_schema):
456-
if u"then" in schema:
457-
then = schema[u"then"]
456+
if "then" in schema:
457+
then = schema["then"]
458458
for error in validator.descend(instance, then, schema_path="then"):
459459
yield error
460-
elif u"else" in schema:
461-
else_ = schema[u"else"]
460+
elif "else" in schema:
461+
else_ = schema["else"]
462462
for error in validator.descend(instance, else_, schema_path="else"):
463463
yield error
464464

jsonschema/tests/test_exceptions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ def test_if_its_in_the_tree_anyhow_it_does_not_raise_an_error(self):
288288
class TestErrorInitReprStr(TestCase):
289289
def make_error(self, **kwargs):
290290
defaults = dict(
291-
message=u"hello",
292-
validator=u"type",
293-
validator_value=u"string",
291+
message="hello",
292+
validator="type",
293+
validator_value="string",
294294
instance=5,
295-
schema={u"type": u"string"},
295+
schema={"type": "string"},
296296
)
297297
defaults.update(kwargs)
298298
return exceptions.ValidationError(**defaults)
@@ -367,8 +367,8 @@ def test_multiple_item_paths(self):
367367
On instance[0]['a']:
368368
5
369369
""",
370-
path=[0, u"a"],
371-
schema_path=[u"items", 0, 1],
370+
path=[0, "a"],
371+
schema_path=["items", 0, 1],
372372
)
373373

374374
def test_uses_pprint(self):
@@ -425,7 +425,7 @@ def test_uses_pprint(self):
425425
""",
426426
instance=list(range(25)),
427427
schema=dict(zip(range(20), range(20))),
428-
validator=u"maxLength",
428+
validator="maxLength",
429429
)
430430

431431
def test_str_works_with_instances_having_overriden_eq_operator(self):

jsonschema/tests/test_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_object_can_be_extended(self):
142142
Point = namedtuple("Point", ["x", "y"])
143143

144144
type_checker = Draft4Validator.TYPE_CHECKER.redefine(
145-
u"object", is_object_or_named_tuple,
145+
"object", is_object_or_named_tuple,
146146
)
147147

148148
CustomValidator = extend(Draft4Validator, type_checker=type_checker)
@@ -154,7 +154,7 @@ def test_object_extensions_require_custom_validators(self):
154154
schema = {"type": "object", "required": ["x"]}
155155

156156
type_checker = Draft4Validator.TYPE_CHECKER.redefine(
157-
u"object", is_object_or_named_tuple,
157+
"object", is_object_or_named_tuple,
158158
)
159159

160160
CustomValidator = extend(Draft4Validator, type_checker=type_checker)
@@ -173,7 +173,7 @@ def test_object_extensions_can_handle_custom_validators(self):
173173
}
174174

175175
type_checker = Draft4Validator.TYPE_CHECKER.redefine(
176-
u"object", is_object_or_named_tuple,
176+
"object", is_object_or_named_tuple,
177177
)
178178

179179
CustomValidator = extend(

0 commit comments

Comments
 (0)