From c6691358526b7f77e1d23649c765d605b554fb93 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 12 Nov 2013 10:05:08 -0800 Subject: [PATCH] swc-windows-installer.py: Only create the python-scripts dir if it doesn't exist os.makedirs, unlike 'mkdir -p', errors if the target directory already exists [1,2]. [1]: http://docs.python.org/2/library/os.html#os.makedirs "Raises an error exception if the leaf directory already exists or cannot be created" [2]: http://docs.python.org/3/library/os.html#os.makedirs "If exist_ok is False (the default), an OSError is raised if the target directory already exists." --- swc-windows-installer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swc-windows-installer.py b/swc-windows-installer.py index 1904bbb..3d2a790 100755 --- a/swc-windows-installer.py +++ b/swc-windows-installer.py @@ -67,6 +67,8 @@ def create_nosetests_entry_point(python_scripts_directory): ' sys.exit(nose.core.main())', '', ]) + if not os.path.isdir(python_scripts_directory): + os.makedirs(python_scripts_directory) with open(os.path.join(python_scripts_directory, 'nosetests'), 'w') as f: f.write(contents) -- 2.26.2