Преглед на файлове

Protect shutil.copytree call

Adrien Ferrand преди 6 години
родител
ревизия
9077917a96
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      nsist/copymodules.py

+ 1 - 1
nsist/copymodules.py

@@ -162,7 +162,7 @@ def copy_distribution(modname, target):
         return
         return
 
 
     egg_info_path = distribution._provider.egg_info
     egg_info_path = distribution._provider.egg_info
-    if os.path.exists(egg_info_path):
+    if os.path.exists(egg_info_path) and not os.path.exists(dest):
         dest = os.path.join(target, os.path.basename(egg_info_path))
         dest = os.path.join(target, os.path.basename(egg_info_path))
         shutil.copytree(egg_info_path, dest)
         shutil.copytree(egg_info_path, dest)