Get str(e) once
@@ -31,7 +31,8 @@ class GenericGitLoader(ModuleLoader):
git_getter.temp_dir = self.dest_dir
git_getter.do_get()
except Exception as e:
- if 'File exists' not in str(e) and 'already exists and is not an empty directory' not in str(e):
+ str_e = str(e)
+ if 'File exists' not in str_e and 'already exists and is not an empty directory' not in str_e:
self.logger.error(f"failed to get {self.module_source} because of {e}")
return ModuleContent(dir=None, failed_url=self.module_source)
return_dir = self.dest_dir
