From 6b57d9a3b79e56b6b62d86fc09e51c1edb7d206e Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Brunialti Date: Sat, 27 Jan 2018 00:44:27 -0200 Subject: [PATCH] Fix tests when no VERSION file exists --- tests/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index af88266..8c373af 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -148,8 +148,11 @@ def run(*popenargs, **kwargs): # def read_version_file(): - with open("VERSION") as content: - return content.readline().strip() + try: + with open("VERSION") as content: + return content.readline().strip() + except IOError: + return None # @@ -258,6 +261,8 @@ def do_commit(version=None, branch=None, release_tag=None, push=False): commit_date = generate_commit_date() if version is None: version = read_version_file() + if version is None: + version = "0.0.0" msg = "Update to %s.dev%s" % (version, commit_date.strftime("%Y%m%d")) if release_tag is not None: msg = "%s %s" % (PROJECT_NAME, release_tag)