summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rtemstoolkit/path.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rtemstoolkit/path.py b/rtemstoolkit/path.py
index 760f4bd..83fb361 100644
--- a/rtemstoolkit/path.py
+++ b/rtemstoolkit/path.py
@@ -191,10 +191,11 @@ def copy_tree(src, dst):
hsrc = host(src)
hdst = host(dst)
- if os.path.exists(src):
+ if os.path.exists(src) and os.path.isdir(src):
names = os.listdir(src)
else:
- name = []
+ names = [basename(src)]
+ src = dirname(src)
if not os.path.isdir(dst):
os.makedirs(dst)