def _create_backup(config, temp_dir):
 backup = os.path.join(temp_dir, 'backup')
 shutil.rmtree(backup, ignore_errors=True)
 shutil.copytree(config, backup, symlinks=True)
 return backup

def _create_backup ( config , temp_dir ) : backup = os . path . join ( temp_dir , 'backup' ) shutil . rmtree ( backup , ignore_errors = True ) shutil . copytree ( config , backup , symlinks = True ) return backup
creates a backup of config in temp_dir .