# HG changeset patch # User Augie Fackler # Date 1556913236 14400 # Node ID 970aaf38c3fc296f5901eace8479228b516ac841 # Parent e10b8058da84131c5efcccfc7ab6ffc8f82c6d2f contrib: have byteify-strings explode if run in Python 2 Differential Revision: https://phab.mercurial-scm.org/D6341 diff -r e10b8058da84 -r 970aaf38c3fc contrib/byteify-strings.py --- a/contrib/byteify-strings.py Fri May 03 15:46:09 2019 -0400 +++ b/contrib/byteify-strings.py Fri May 03 15:53:56 2019 -0400 @@ -7,7 +7,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -from __future__ import absolute_import +from __future__ import absolute_import, print_function import argparse import contextlib @@ -227,4 +227,7 @@ process(fin, fout, opts) if __name__ == '__main__': + if sys.version_info.major < 3: + print('This script must be run under Python 3.') + sys.exit(3) main()