mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Do not assume the src is valid.
This commit is contained in:
parent
53b918e698
commit
edf60aa82f
@ -143,7 +143,10 @@ def copy_tree(src, dst):
|
|||||||
hsrc = host(src)
|
hsrc = host(src)
|
||||||
hdst = host(dst)
|
hdst = host(dst)
|
||||||
|
|
||||||
|
if os.path.exists(src):
|
||||||
names = os.listdir(src)
|
names = os.listdir(src)
|
||||||
|
else:
|
||||||
|
names = []
|
||||||
|
|
||||||
if not os.path.isdir(dst):
|
if not os.path.isdir(dst):
|
||||||
os.makedirs(dst)
|
os.makedirs(dst)
|
||||||
@ -178,6 +181,7 @@ def copy_tree(src, dst):
|
|||||||
try:
|
try:
|
||||||
shutil.copystat(src, dst)
|
shutil.copystat(src, dst)
|
||||||
except OSError, why:
|
except OSError, why:
|
||||||
|
if windows:
|
||||||
if WindowsError is not None and isinstance(why, WindowsError):
|
if WindowsError is not None and isinstance(why, WindowsError):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user