[4.0] bbf9d33 Walk back Python 3 changes, use python2 explicitly.

Lasse Karstensen lkarsten at varnish-software.com
Tue Jun 24 11:31:48 CEST 2014


commit bbf9d33084fef3070b56e207582714baef924fcf
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date:   Wed May 14 10:15:09 2014 +0200

    Walk back Python 3 changes, use python2 explicitly.
    
    None of our automatic build environments have Python 3 currently.

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 3319199..4cc13e1 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python2
 #-
 # Copyright (c) 2010-2014 Varnish Software AS
 # All rights reserved.
@@ -699,8 +699,8 @@ class file_section(object):
 			if opts.strict:
 				raise FormatError(m, details)
 			else:
-				print("WARNING: %s:" % m, file=sys.stderr)
-				print(details, file=sys.stderr)
+				print >>sys.stderr, "WARNING: %s:" % m
+				print >>sys.stderr, details
 		else:
 			for ln, i in self.l:
 				o.doc(i)
@@ -797,12 +797,12 @@ def runmain(inputvcc, outputname="vcc_if"):
 			i.parse(vx)
 			assert len(i.tl) == 0
 	except ParseError as e:
-		print("ERROR: Parse error reading \"%s\":" % inputvcc)
+		print "ERROR: Parse error reading \"%s\":" % inputvcc
 		pprint(str(e))
 		exit(-1)
 	except FormatError as e:
-		print("ERROR: Format error reading \"%s\": %s" % (inputvcc, pformat(e.msg)))
-		print(e.details)
+		print "ERROR: Format error reading \"%s\": %s" % (inputvcc, pformat(e.msg))
+		print e.details
 		exit(-2)
 
 	#######################################################################
@@ -878,7 +878,7 @@ if __name__ == "__main__":
 		if not inputvcc:
 		    inputvcc = "vmod.vcc"
 	else:
-		print("ERROR: No vmod.vcc file supplied or found.", file=sys.stderr)
+		print >>sys.stderr, "ERROR: No vmod.vcc file supplied or found."
 		oparser.print_help()
 		exit(-1)
 



More information about the varnish-commit mailing list