# Callers sometimes specify a filename which includes .json or .idl - if
# so, believe them. They may even include the 'api/' prefix.
if os.path.splitext(api_name)[1] in ('.json', '.idl'):
- if not api_name.startswith(API + '/'):
+ if not api_name.startswith(API):
api_name = posixpath.join(API, api_name)
return self._model_cache.GetFromFile(api_name)
'devtools', file_name.replace(basename,
basename.replace('devtools_' , '')))
- futures = [self._model_cache.GetFromFile('%s/%s.%s' % (API, file_name, ext))
+ futures = [self._model_cache.GetFromFile(
+ posixpath.join(API, '%s.%s' % (file_name, ext)))
for ext in ('json', 'idl')]
def resolve():
for future in futures: