26.2. Verifying the SCons Version: the `EnsureSConsVersion` Function
Prev | Chapter 26. Miscellaneous Functionality | Next

## 26.2. Verifying the SCons Version: the `EnsureSConsVersion` Function

You may, of course, write your `SConscript` files to use features that were only added in recent versions of SCons. When you publicly distribute software that is built using SCons, it's helpful to have SCons verify the version being used and exit gracefully with an error message if the user's version of SCons won't work with your `SConscript` files. SCons provides an `EnsureSConsVersion` function that verifies the version of SCons in the same the `EnsurePythonVersion` function verifies the version of Python, by passing in the major and minor versions numbers of the version of SCons you require:

    EnsureSConsVersion(1, 0)

And then SCons will exit with the following error message when a user runs it with an unsupported earlier version of SCons:

    % scons -Q
    SCons 1.0 or greater required, but you have SCons 0.98.5

Prev | Up | Next
Chapter 26. Miscellaneous Functionality | Home | 26.3. Accessing SCons Version: the `GetSConsVersion` Function