Skip to content

Commit 75399ab

Browse files
committed
Update config file check to use os.path.isfile.
The previous check os.path.exists also checks for directories, os.path.isfile seems to be a cleaner way to check if a file exists.
1 parent dca3384 commit 75399ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

awsshell/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _copy_template_to_config(self, template_path,
7777
existing config file, if it exists.
7878
"""
7979
expanded_config_path = os.path.expanduser(config_path)
80-
if not overwrite and os.path.exists(config_path):
80+
if not overwrite and os.path.isfile(config_path):
8181
return
8282
else:
8383
shutil.copyfile(template_path, config_path)

0 commit comments

Comments
 (0)