Projet

Général

Profil

0001-setup.py-handle-case-of-a-tagged-dirty-workdir.patch

Benjamin Dauvergne, 26 février 2019 13:19

Télécharger (1,07 ko)

Voir les différences:

Subject: [PATCH 1/4] setup.py: handle case of a tagged dirty workdir

 setup.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
setup.py
75 75
        if p.returncode == 0:
76 76
            result = result.decode('ascii').strip()[1:]  # strip spaces/newlines and initial v
77 77
            if '-' in result:  # not a tagged version
78
                real_number, commit_count, commit_hash = result.split('-', 2)
78
                try:
79
                    real_number, commit_count, commit_hash = result.split('-', 2)
80
                except ValueError:
81
                    real_number, commit_hash = result.split('-', 2)
82
                    commit_count = 0
79 83
                version = '%s.post%s+%s' % (real_number, commit_count, commit_hash)
80 84
            else:
81 85
                version = result
82
-