6666TOOLS_DIRS = FileNameSet ("scripts" , "i18n" , "pynche" , "demo" , "parser" )
6767TOOLS_FILES = FileSuffixSet (".py" , ".pyw" , ".txt" )
6868
69- def copy_if_modified (src , dest ):
70- try :
71- dest_stat = os .stat (dest )
72- except FileNotFoundError :
73- do_copy = True
74- else :
75- src_stat = os .stat (src )
76- do_copy = (src_stat .st_mtime != dest_stat .st_mtime or
77- src_stat .st_size != dest_stat .st_size )
78-
79- if do_copy :
80- shutil .copy2 (src , dest )
8169
8270def get_lib_layout (ns ):
8371 def _c (f ):
@@ -438,7 +426,7 @@ def copy_files(files, ns):
438426 need_compile .append ((dest , ns .copy / dest ))
439427 else :
440428 (ns .temp / "Lib" / dest ).parent .mkdir (parents = True , exist_ok = True )
441- copy_if_modified (src , ns .temp / "Lib" / dest )
429+ shutil . copy2 (src , ns .temp / "Lib" / dest )
442430 need_compile .append ((dest , ns .temp / "Lib" / dest ))
443431
444432 if src not in EXCLUDE_FROM_CATALOG :
@@ -448,7 +436,7 @@ def copy_files(files, ns):
448436 log_debug ("Copy {} -> {}" , src , ns .copy / dest )
449437 (ns .copy / dest ).parent .mkdir (parents = True , exist_ok = True )
450438 try :
451- copy_if_modified (src , ns .copy / dest )
439+ shutil . copy2 (src , ns .copy / dest )
452440 except shutil .SameFileError :
453441 pass
454442
0 commit comments