Bug 601649 - Client.py doesn't work with python3, Use a better error message/format. So the user knows why it doesn't work. r=Standard8
authorJustin Wood <Callek@gmail.com>
Wed, 06 Oct 2010 21:25:29 -0400
changeset 6534 426abd4c74c79be95df16f8891c8ba0219fa6936
parent 6533 bfd1320b39acbd8c1aaab876abbd13196f2dfda3
child 6536 b31066adb6749f9cfa1ec2cc47c8949a02d1e727
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs601649
Bug 601649 - Client.py doesn't work with python3, Use a better error message/format. So the user knows why it doesn't work. r=Standard8
client.py
--- a/client.py
+++ b/client.py
@@ -59,17 +59,19 @@ SWITCH_MOZILLA_REPO_REPLACE = '%s://hg.m
 SWITCH_MOZILLA_BASE_REV = "GECKO_1_9_1_BASE"
 
 import sys
 # Test Python Version. 2.4 required for `import subprocess`
 pyver = sys.version_info
 if pyver[0] <= 1 or (pyver[0] == 2 and pyver[1] < 4):
   sys.exit("ERROR: Python 2.4 or newer required")
 elif pyver[0] >= 3:
-  sys.exit("ERROR: Python series 3 is not supported, use series 2 >= 2.4")
+  # Python series 3 will syntax error here, Hack needed per Bug 601649c#8
+  print "ERROR: Python series 3 is not supported, use series 2 >= 2.4"
+  sys.exit() # Do an explicit sys.exit for code clarity.
 del pyver
 
 import os
 import datetime
 from optparse import OptionParser, OptionValueError
 
 topsrcdir = os.path.dirname(__file__)
 if topsrcdir == '':