diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-13 20:56:48 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-13 20:56:48 +0300 |
commit | 4a4a4d7d86d59b6f753cacca9041b4bb5c84e358 (patch) | |
tree | ecf568913809404bd8d7ab5ea42c2b82e720a1de /ick_helpers.py | |
parent | 417b62d0718a697a338878b2ec721a49b378368b (diff) | |
download | ick-helpers-4a4a4d7d86d59b6f753cacca9041b4bb5c84e358.tar.gz |
Change: try setup.py with python3 and then python
Diffstat (limited to 'ick_helpers.py')
-rw-r--r-- | ick_helpers.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ick_helpers.py b/ick_helpers.py index 99a52a8..00599b7 100644 --- a/ick_helpers.py +++ b/ick_helpers.py @@ -85,12 +85,17 @@ class Exec: def get_project_name(self): setup_py = os.path.join(self.dirname, 'setup.py') - if os.path.exists(setup_py): + if os.path.exists(setup_py) and self.got_command('python3'): + output = self.get_stdout('python3', 'setup.py', '--name') + elif os.path.exists(setup_py) and self.got_command('python'): output = self.get_stdout('python', 'setup.py', '--name') else: output = self.get_stdout('dpkg-parsechangelog', '-S', 'Source') return output.strip() + def got_command(self, cmd): + return self.run_silently('command', '-v', cmd) == 0 + def get_version_from_tag(self, tag): parts = tag.split('-', 1) debug('tag parts:', parts) |