summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Ramacher <sebastian@ramacher.at>2012-10-14 13:11:28 +0200
committerDwayne Litzenberger <dlitz@dlitz.net>2013-02-02 19:29:05 -0800
commit68cce56d91a8b96b685d97c937a78b061afbc834 (patch)
tree7fb91b788b873362c2420f14a75ad92c6d9235d2
parentab110a4113f5e8672d80c5845178268774b7ea23 (diff)
downloadpycrypto-68cce56d91a8b96b685d97c937a78b061afbc834.tar.gz
Use os.chmod instead of os.system("chmod ...")
-rw-r--r--setup.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index c36efc2..7ef7928 100644
--- a/setup.py
+++ b/setup.py
@@ -274,8 +274,11 @@ class PCTBuildConfigure(Command):
def run(self):
if not os.path.exists("config.status"):
- if os.system("chmod 0755 configure") != 0:
- raise RuntimeError("chmod error")
+ if hasattr(os, "chmod"):
+ import stat
+ os.chmod("configure", stat.S_IRUSR | stat.S_IWUSR |
+ stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP |
+ stat.S_IROTH | stat.S_IXOTH)
cmd = "sh configure" # we use "sh" here so that it'll work on mingw32 with standard python.org binaries
if self.verbose < 1:
cmd += " -q"