From b73af1f636d16d10e3c5dd760b9b5f5c36479ee4 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 14 Jan 2018 22:16:47 +0200 Subject: [PATCH] checkout: check if dirname actually returned directory Signed-off-by: Ruslan Kuprieiev --- dvc/command/checkout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvc/command/checkout.py b/dvc/command/checkout.py index c8c171d38..28a588e27 100644 --- a/dvc/command/checkout.py +++ b/dvc/command/checkout.py @@ -18,7 +18,7 @@ class CmdCheckout(CmdBase): os.remove(file) dir = os.path.dirname(file) - if not os.listdir(dir): + if len(dir) != 0 and not os.listdir(dir): Logger.info(u'Remove empty directory \'{}\''.format(dir)) os.removedirs(dir) pass