mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
This commit is contained in:
		
							parent
							
								
									452bf519a7
								
							
						
					
					
						commit
						be19ed77dd
					
				
					 331 changed files with 2567 additions and 2648 deletions
				
			
		|  | @ -76,12 +76,12 @@ def get_children(self): | |||
|         return self.children | ||||
| 
 | ||||
|     def DEBUG(self): | ||||
|         print >> sys.stderr, self.name, self.nested and "nested" or "" | ||||
|         print >> sys.stderr, "\tglobals: ", self.globals | ||||
|         print >> sys.stderr, "\tcells: ", self.cells | ||||
|         print >> sys.stderr, "\tdefs: ", self.defs | ||||
|         print >> sys.stderr, "\tuses: ", self.uses | ||||
|         print >> sys.stderr, "\tfrees:", self.frees | ||||
|         print(self.name, self.nested and "nested" or "", file=sys.stderr) | ||||
|         print("\tglobals: ", self.globals, file=sys.stderr) | ||||
|         print("\tcells: ", self.cells, file=sys.stderr) | ||||
|         print("\tdefs: ", self.defs, file=sys.stderr) | ||||
|         print("\tuses: ", self.uses, file=sys.stderr) | ||||
|         print("\tfrees:", self.frees, file=sys.stderr) | ||||
| 
 | ||||
|     def check_name(self, name): | ||||
|         """Return scope of name. | ||||
|  | @ -429,7 +429,7 @@ def get_names(syms): | |||
|                 if not (s.startswith('_[') or s.startswith('.'))] | ||||
| 
 | ||||
|     for file in sys.argv[1:]: | ||||
|         print file | ||||
|         print(file) | ||||
|         f = open(file) | ||||
|         buf = f.read() | ||||
|         f.close() | ||||
|  | @ -443,10 +443,10 @@ def get_names(syms): | |||
|         names2 = s.scopes[tree].get_names() | ||||
| 
 | ||||
|         if not list_eq(mod_names, names2): | ||||
|             print | ||||
|             print "oops", file | ||||
|             print sorted(mod_names) | ||||
|             print sorted(names2) | ||||
|             print() | ||||
|             print("oops", file) | ||||
|             print(sorted(mod_names)) | ||||
|             print(sorted(names2)) | ||||
|             sys.exit(-1) | ||||
| 
 | ||||
|         d = {} | ||||
|  | @ -460,11 +460,11 @@ def get_names(syms): | |||
|                 l = [sc for sc in scopes | ||||
|                      if sc.name == s.get_name()] | ||||
|                 if len(l) > 1: | ||||
|                     print "skipping", s.get_name() | ||||
|                     print("skipping", s.get_name()) | ||||
|                 else: | ||||
|                     if not list_eq(get_names(s.get_namespace()), | ||||
|                                    l[0].get_names()): | ||||
|                         print s.get_name() | ||||
|                         print sorted(get_names(s.get_namespace())) | ||||
|                         print sorted(l[0].get_names()) | ||||
|                         print(s.get_name()) | ||||
|                         print(sorted(get_names(s.get_namespace()))) | ||||
|                         print(sorted(l[0].get_names())) | ||||
|                         sys.exit(-1) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum