fix: use print() function in both Python 2 and Python 3 (#18395)
Legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3. Old style exceptions are syntax errors in Python 3 but new style exceptions work as expected in both Python 2 and Python 3.
This commit is contained in:
		
					parent
					
						
							
								7d0a93858d
							
						
					
				
			
			
				commit
				
					
						1d6e5e6e70
					
				
			
		
					 18 changed files with 62 additions and 894 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
#!/usr/bin/env python
 | 
			
		||||
from __future__ import print_function
 | 
			
		||||
import argparse
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +34,7 @@ def strip_binary(binary_path, target_cpu):
 | 
			
		|||
 | 
			
		||||
def main():
 | 
			
		||||
  args = parse_args()
 | 
			
		||||
  print args
 | 
			
		||||
  print(args)
 | 
			
		||||
  if args.file:
 | 
			
		||||
    strip_binary(args.file, args.target_cpu)
 | 
			
		||||
  else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue