From 4a4a4d7d86d59b6f753cacca9041b4bb5c84e358 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 13 Aug 2018 20:56:48 +0300 Subject: Change: try setup.py with python3 and then python --- ick_helpers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1