Skip to content

Commit 0cd2a61

Browse files
authored
Merge pull request #19 from iotamudelta/master
Address more review comments
2 parents f737380 + 00ea583 commit 0cd2a61

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tools/amd_build/pyHIPIFY/hipify-python.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -833,19 +833,18 @@ def main():
833833
# Verify the project directory exists.
834834
if not os.path.exists(args.project_directory):
835835
print("The project folder specified does not exist.")
836-
return
837-
838-
# Make sure output directory exists.
839-
if not os.path.exists(args.output_directory):
840-
print("The output folder already exists.")
841-
return
836+
sys.exit(1)
842837

843838
# If no output directory, provide a default one.
844839
if args.output_directory is "":
845-
args.project_directory = args.project_directory[0:-
846-
1] if args.project_directory.endswith("/") else args.project_directory
840+
args.project_directory.rstrip("/")
847841
args.output_directory = args.project_directory + "_amd"
848842

843+
# Make sure output directory does not exist.
844+
if not os.path.exists(args.output_directory):
845+
print("The output folder already exists.")
846+
sys.exit(2)
847+
849848
# Copy from project directory to output directory if not done already.
850849
if not os.path.exists(args.output_directory):
851850
shutil.copytree(args.project_directory, args.output_directory)
@@ -863,8 +862,8 @@ def main():
863862

864863
# Open YAML file with disable information.
865864
if args.yaml_settings != "":
866-
with openf(args.yaml_settings, "r") as lines:
867-
yaml_data = yaml.load(lines)
865+
with openf(args.yaml_settings, "r") as f:
866+
yaml_data = yaml.load(f)
868867

869868
# Disable functions in certain files according to YAML description
870869
for disable_info in yaml_data["disabled_functions"]:

0 commit comments

Comments
 (0)