Patchwork D6341: contrib: have byteify-strings explode if run in Python 2

login
register
mail settings
Submitter phabricator
Date May 4, 2019, 2:37 p.m.
Message ID <differential-rev-PHID-DREV-xffzyz3lpzctpe3wnqmy-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39947/
State Superseded
Headers show

Comments

phabricator - May 4, 2019, 2:37 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6341

AFFECTED FILES
  contrib/byteify-strings.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/byteify-strings.py b/contrib/byteify-strings.py
--- a/contrib/byteify-strings.py
+++ b/contrib/byteify-strings.py
@@ -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()