diff options
author | Jack Lloyd <[email protected]> | 2018-05-24 15:35:19 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-05-24 15:35:19 -0400 |
commit | 0d11526e5979e979b6dc3569714e651f2486bb0f (patch) | |
tree | 57cb013b5ad7022285a9c794ed0cf78e6f801697 | |
parent | 7db21f4b103128f817cb982252ccd08d9f80a9c6 (diff) |
Small cleanup in dist script
-rwxr-xr-x | src/scripts/dist.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/scripts/dist.py b/src/scripts/dist.py index d12ce8d05..36237c42c 100755 --- a/src/scripts/dist.py +++ b/src/scripts/dist.py @@ -355,14 +355,18 @@ def main(args=None): all_files += [os.path.join(curdir, f) for f in files] all_files.sort(key=lambda f: (os.path.dirname(f), os.path.basename(f))) - version_file = None - - # location of file with version information has moved over time - for possible_version_file in ['src/build-data/version.txt', 'version.txt', 'botan_version.py']: - full_path = os.path.join(output_basename, possible_version_file) - if os.access(full_path, os.R_OK): - version_file = full_path - break + def find_version_file(): + + # location of file with version information has moved over time + for possible_version_file in ['src/build-data/version.txt', 'version.txt', 'botan_version.py']: + full_path = os.path.join(output_basename, possible_version_file) + if os.access(full_path, os.R_OK): + return full_path + + logging.error('Cannot locate version file') + return None + + version_file = find_version_file() if not os.access(version_file, os.R_OK): logging.error('Cannot read %s' % (version_file)) |