From 63f608d7c05095c16d1a8863b13c55634c0cae8b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 29 Jan 2013 11:08:21 +0000 Subject: Fix cwd parsing in setup.py If __file__ has no directory in it, dirname will return the empty string, which in turn will break subprocess.Popen. The fix is to use '.' instead of the empty string. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 6e8c4c4b..4acb9a6c 100644 --- a/setup.py +++ b/setup.py @@ -61,8 +61,9 @@ class GenerateResources(build): (path, ' '.join(command))) with open(os.path.join(target_dir, filename), 'w') as f: + cwd = os.path.dirname(__file__) or '.' p = subprocess.Popen(command, - cwd=os.path.dirname(__file__), + cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) o = p.communicate() -- cgit v1.2.1