diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-05-09 11:24:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-05-09 11:24:13 -0700 |
commit | ad11863b6a26c4da4e500da165ea35e5a52c95b2 (patch) | |
tree | 0a7bbe1e2332383f6c9c91b4fcfa2f78f8f89d70 /tools | |
parent | 3aca411f788bf6db0e4eebacf4b8cf40076e11f6 (diff) |
remove some warnings on moving files to directories
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py index 826baa83..5305d46b 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -1836,7 +1836,11 @@ def unsuffixed_basename(name): return os.path.basename(unsuffixed(name)) def safe_move(src, dst): - if os.path.abspath(src) == os.path.abspath(dst): + src = os.path.abspath(src) + dst = os.path.abspath(dst) + if os.path.isdir(dst): + dst = os.path.join(dst, os.path.basename(src)) + if src == dst: return shutil.move(src, dst) |