You don't have to perform this checks if you use `os.path.join`