Skip to content

Commit 1128817

Browse files
committed
skip chown under windows
for: #9
1 parent c65a872 commit 1128817

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

setup.py

+9-13
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ def finalize_options(self):
4141
pass
4242

4343
def run(self):
44-
45-
# Windows lacks Unix functionality
46-
if sys.platform.startswith("win"):
47-
print("Sorry, but creating paths on Windows is currently not supported.")
48-
sys.exit(1)
49-
5044
# set to user-supplied path is available
5145
if self.basepath != None:
5246
drqueue_root = self.basepath
@@ -96,13 +90,15 @@ def run(self):
9690
for template in glob.glob(templates):
9791
shutil.copy(template, drqueue_etc)
9892

99-
# set to user-supplied user / group
100-
if self.owner != None:
101-
uid = pwd.getpwnam(self.owner)[2]
102-
recursive_chown(drqueue_root, uid, -1)
103-
if self.group != None:
104-
gid = grp.getgrnam(self.group)[2]
105-
recursive_chown(drqueue_root, -1, gid)
93+
# Windows lacks Unix functionality
94+
if not sys.platform.startswith("win"):
95+
# set to user-supplied user / group
96+
if self.owner != None:
97+
uid = pwd.getpwnam(self.owner)[2]
98+
recursive_chown(drqueue_root, uid, -1)
99+
if self.group != None:
100+
gid = grp.getgrnam(self.group)[2]
101+
recursive_chown(drqueue_root, -1, gid)
106102

107103
print("\nAdd the following environment variables to your user profile:")
108104
print("DRQUEUE_ROOT=" + drqueue_root)

0 commit comments

Comments
 (0)