@@ -106,17 +106,17 @@ def run(self):
106
106
env .note_dependency (relpath )
107
107
108
108
schema = JSONSchema .loadfromfile (
109
- abspath ,
110
- allow_external_refs = ('allowexternalrefs' in self .options ),
111
- loader = (partial (urnjsonloader , abspath .rsplit ("/" , 1 )[0 ])
112
- if 'allowurnrefs' in self .options else None )
109
+ abspath ,
110
+ allow_external_refs = ('allowexternalrefs' in self .options ),
111
+ loader = (partial (urnjsonloader , abspath .rsplit ("/" , 1 )[0 ])
112
+ if 'allowurnrefs' in self .options else None )
113
113
)
114
114
else :
115
115
schema = JSONSchema .loadfromfile (
116
116
'' .join (self .content ),
117
117
allow_external_refs = ('allowexternalrefs' in self .options ),
118
118
loader = (partial (urnjsonloader , abspath .rsplit ("/" , 1 )[0 ])
119
- if 'allowurnrefs' in self .options else None )
119
+ if 'allowurnrefs' in self .options else None )
120
120
)
121
121
except ValueError as exc :
122
122
raise self .error ('Failed to parse JSON Schema: %s' % exc )
@@ -271,7 +271,8 @@ def load(cls, reader, allow_external_refs=False, base_uri="", loader=None):
271
271
args = {}
272
272
if not allow_external_refs :
273
273
args ['loader' ] = custom_jsonref_jsonloader
274
- if loader : args ['loader' ] = loader
274
+ if loader :
275
+ args ['loader' ] = loader
275
276
obj = jsonref .load (reader , object_pairs_hook = OrderedDict , base_uri = base_uri , ** args )
276
277
return cls .instantiate (None , obj )
277
278
@@ -287,7 +288,8 @@ def loadfromfile(cls, filename, allow_external_refs=False, loader=None):
287
288
if allow_external_refs :
288
289
args ['allow_external_refs' ] = True
289
290
args ['base_uri' ] = Path (os .path .realpath (filename )).as_uri ()
290
- if loader : args ['loader' ] = loader
291
+ if loader :
292
+ args ['loader' ] = loader
291
293
return cls .load (reader , ** args )
292
294
293
295
@classmethod
0 commit comments