Always convert gem_path to pathlib.Path and check it isFile() in case it is a str

Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
nggieber
2021-10-22 17:33:30 -07:00
parent 06f893edf1
commit 182a7b98b7
+1 -1
View File
@@ -502,7 +502,7 @@ def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None
if gem_name and not gem_path:
gem_path = get_registered(gem_name=gem_name, project_path=project_path)
if isinstance(gem_path, pathlib.Path) and gem_path.is_file():
if pathlib.Path(gem_path).is_file():
return get_json_data_file(gem_path, 'gem', validation.valid_o3de_gem_json)
else:
return get_json_data('gem', gem_path, validation.valid_o3de_gem_json)