diff options
-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) |