summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbumper14
1 files changed, 13 insertions, 1 deletions
diff --git a/bumper b/bumper
index b847f94..bcf8899 100755
--- a/bumper
+++ b/bumper
@@ -17,7 +17,9 @@
# =*= License: GPL-3+ =*=
+import os
import re
+import stat
import time
import cliapp
@@ -104,7 +106,17 @@ class Bumper(cliapp.Application):
return version_files[0]
def run_setup(self, *args):
- return cliapp.runcmd(['python', 'setup.py'] + list(args)).strip()
+ prefix = None
+
+ # If we can run setup.py directly, we do. This takes care of Py2 vs Py3.
+ st = os.lstat('setup.py')
+ if (stat.S_IMODE(st.st_mode) & stat.S_IXUSR) == stat.S_IXUSR:
+ prefix = ['./setup.py']
+
+ if prefix is None:
+ prefix = ['python', 'setup.py']
+
+ return cliapp.runcmd(prefix + list(args)).strip()
def get_current_version(self):
return self.run_setup('--version')