about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-05-07 21:25:48 +0200
committerhut <hut@lepus.uberspace.de>2015-05-07 21:25:48 +0200
commit599419ce8c67761b6c660e80be98cb5baade7622 (patch)
treecd57b9db72e46bc4431000032880e9cc01eacb40 /ranger
parentfa7cb5b8145d005286312ca69da9d254683b5ea7 (diff)
downloadranger-599419ce8c67761b6c660e80be98cb5baade7622.tar.gz
core.actions: don't remove empty dirs on :rename
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 58f7aa20..a13d0977 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1258,7 +1258,11 @@ class Actions(FileManagerAware, SettingsAware):
             src = src.path
 
         try:
-            os.renames(src, dest)
+            os.makedirs(os.path.dirname(dest))
+        except OSError:
+            pass
+        try:
+            os.rename(src, dest)
         except OSError as err:
             self.notify(err)
             return False