Skip to content
Snippets Groups Projects
Verified Commit 41c7b890 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

error handle chdir

parent ff36d4e3
No related branches found
No related tags found
No related merge requests found
from curses.ascii import isdigit
import os, re
from os import path
from os.path import exists
from sys import exc_info
import yaml
from natsort import natsorted
from generator import helper, format
......@@ -8,7 +10,16 @@ from generator import helper, format
def save_tag(localroot, root, filename, tag):
return_tag = ""
os.chdir(root)
try:
os.chdir(root)
print("Current working directory: {0}".format(os.getcwd()))
except FileNotFoundError:
print("Directory: {0} does not exist".format(root))
except NotADirectoryError:
print("{0} is not a directory".format(root))
except PermissionError:
print("You do not have permissions to change to {0}".format(root))
length_tag = len(tag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment