summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/pyvenv
blob: 1043efcfa7d1289f182379b0fba55917e769488a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3
if __name__ == '__main__':
    import sys
    import pathlib

    executable = pathlib.Path(sys.executable or 'python3').name
    print('WARNING: the pyenv script is deprecated in favour of '
          '`{} -m venv`'.format(exeutable, file=sys.stderr))

    rc = 1
    try:
        import venv
        venv.main()
        rc = 0
    except Exception as e:
        print('Error: %s' % e, file=sys.stderr)
    sys.exit(rc)