[gedit-plugins] Fix error only creating module dir if already exists



commit 71e11580da24647e3f9802fa284a92c2ade6999f
Author: Jesse van den Kieboom <jesse icecrew nl>
Date:   Sun Mar 21 22:52:54 2010 +0100

    Fix error only creating module dir if already exists

 plugins/commander/modules/edit.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/commander/modules/edit.py b/plugins/commander/modules/edit.py
index c6ea5e6..c8aed3e 100644
--- a/plugins/commander/modules/edit.py
+++ b/plugins/commander/modules/edit.py
@@ -192,7 +192,9 @@ def new_command(view, entry, name):
 		raise commander.commands.exceptions.Execute('Commander module `' + name + '\' already exists')
 
 	dirname = os.path.dirname(filename)
-	os.makedirs(dirname)
+
+	if not os.path.isdir(dirname):
+		os.makedirs(dirname)
 
 	f = open(filename, 'w')
 	f.write(COMMAND_TEMPLATE)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]