@@ -249,8 +249,6 @@ def expand_url(self,
249
249
(splitbase .scheme , splitbase .netloc , pt , splitbase .query , frg ))
250
250
elif scoped_ref is not None and not split .fragment :
251
251
pass
252
- elif base_url is None :
253
- url = pathlib .Path (os .path .join (os .getcwd (), url )).as_uri ()
254
252
else :
255
253
url = self .fetcher .urljoin (base_url , url )
256
254
@@ -381,6 +379,10 @@ def resolve_ref(self,
381
379
inc = False
382
380
mixin = None # type: Dict[unicode, Any]
383
381
382
+ if not base_url :
383
+ ref = pathlib .Path (os .path .join (os .getcwd (), ref )).as_uri ()
384
+ base_url = pathlib .Path (os .getcwd ()).as_uri () + '/'
385
+
384
386
sl = SourceLine (obj , None , ValueError )
385
387
# If `ref` is a dict, look for special directives.
386
388
if isinstance (ref , CommentedMap ):
@@ -421,7 +423,6 @@ def resolve_ref(self,
421
423
raise ValueError (u"Expected CommentedMap or string, got %s: `%s`" % (type (ref ), unicode (ref )))
422
424
423
425
url = self .expand_url (ref , base_url , scoped_id = (obj is not None ))
424
- base_url = base_url or pathlib .Path (os .getcwd ()).as_uri () + '/'
425
426
# Has this reference been loaded already?
426
427
if url in self .idx and (not mixin ):
427
428
return self .idx [url ], {}
0 commit comments