Skip to content

Commit

Permalink
specify exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
donno2048 committed Sep 29, 2022
1 parent 70e33d9 commit a85484b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gitback/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def backup()->None:
if exists(name+'.zip') and args.zip: exit(f'You already have a {name} zip, please move it somewhere else until the process is done')
if args.zip: backup = ZipFile(name+'.zip', 'w', 8)
try: mkdir(name)
except: exit(f'You already have a {name} folder, please move it somewhere else until the process is done')
except FileExistsError: exit(f'You already have a {name} folder, please move it somewhere else until the process is done')
chdir(name)
username, git_command = args.username if args.username is not None else input("Your GitHub username: "), 'git clone '
if not args.full: git_command += '--depth 1 '
Expand Down
2 changes: 1 addition & 1 deletion gitback/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from os import rmdir
if __name__ == '__main__':
try: backup()
except: rmdir("backup")
except Exception: rmdir("backup")

0 comments on commit a85484b

Please sign in to comment.