Skip to content

Commit 0c6fa36

Browse files
committed
run black
1 parent c4d5eb5 commit 0c6fa36

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

python_jsonschema_objects/classbuilder.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ def __init__(self, **props):
216216
import sys
217217

218218
e = type(e)(
219-
str(e)
220-
+ " \nwhile setting '{0}' in {1}".format(
221-
prop, self.__class__.__name__
222-
)
219+
str(e)
220+
+ " \nwhile setting '{0}' in {1}".format(
221+
prop, self.__class__.__name__
223222
)
223+
)
224224
raise e.with_traceback(sys.exc_info()[2])
225225

226226
if getattr(self, "__strict__", None):
@@ -638,13 +638,15 @@ def _build_literal(self, nm, clsdata):
638638
# This weird value on the next line is a sentinel value, because we can't use the standard `get(
639639
# "key", None) is not None` motif because sometimes the value is None. If someone has an actual
640640
# value like this (which I generated by having my cat walk on my keyboard), they're out of luck.
641-
"__default__": clsdata["default"]
642-
if clsdata.get(
643-
"default",
644-
"asldkfn24olkjalskdfn e;laishd;1loj;flkansd;iow;naosdinfe;lkamjsdfj",
645-
)
646-
is not "asldkfn24olkjalskdfn e;laishd;1loj;flkansd;iow;naosdinfe;lkamjsdfj"
647-
else clsdata.get("const"),
641+
"__default__": (
642+
clsdata["default"]
643+
if clsdata.get(
644+
"default",
645+
"asldkfn24olkjalskdfn e;laishd;1loj;flkansd;iow;naosdinfe;lkamjsdfj",
646+
)
647+
is not "asldkfn24olkjalskdfn e;laishd;1loj;flkansd;iow;naosdinfe;lkamjsdfj"
648+
else clsdata.get("const")
649+
),
648650
}
649651
},
650652
)
@@ -820,9 +822,11 @@ def _build_object(self, nm, clsdata, parents, **kw):
820822

821823
def construct_objects(self, oneOfList, uri):
822824
return [
823-
self.construct(uri + "_%s" % i, item_detail)
824-
if "$ref" not in item_detail
825-
else self.resolve_type(item_detail["$ref"], uri + "_%s" % i)
825+
(
826+
self.construct(uri + "_%s" % i, item_detail)
827+
if "$ref" not in item_detail
828+
else self.resolve_type(item_detail["$ref"], uri + "_%s" % i)
829+
)
826830
for i, item_detail in enumerate(oneOfList)
827831
]
828832

python_jsonschema_objects/util.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from collections.abc import Mapping, Sequence
88

99

10-
1110
class lazy_format(object):
1211
__slots__ = ("fmt", "args", "kwargs")
1312

@@ -35,7 +34,6 @@ def safe_issubclass(x, y):
3534
return False
3635

3736

38-
3937
class ProtocolJSONEncoder(json.JSONEncoder):
4038
def default(self, obj):
4139
from python_jsonschema_objects import classbuilder, wrapper_types

python_jsonschema_objects/wrapper_types.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ def validate_items(self):
186186
elif util.safe_issubclass(typ, classbuilder.ProtocolBase):
187187
if not isinstance(elem, typ):
188188
try:
189-
if isinstance(
190-
elem, (str, int, float)
191-
):
189+
if isinstance(elem, (str, int, float)):
192190
val = typ(elem)
193191
else:
194192
val = typ(**elem)

0 commit comments

Comments
 (0)