diff options
author | hut <hut@lepus.uberspace.de> | 2015-05-07 21:25:48 +0200 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2015-05-07 21:25:48 +0200 |
commit | 599419ce8c67761b6c660e80be98cb5baade7622 (patch) | |
tree | cd57b9db72e46bc4431000032880e9cc01eacb40 | |
parent | fa7cb5b8145d005286312ca69da9d254683b5ea7 (diff) | |
download | ranger-599419ce8c67761b6c660e80be98cb5baade7622.tar.gz |
core.actions: don't remove empty dirs on :rename
-rw-r--r-- | ranger/core/actions.py | 6 |
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 |