mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Change a test to be more predictable.
The problem with using random.random is that several modules and tests do "from random in random" which confuses pickle.whichmodule().
This commit is contained in:
		
							parent
							
								
									61c31b07b9
								
							
						
					
					
						commit
						4f7ac2e800
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -2050,10 +2050,10 @@ highest protocol among opcodes = 1
 | 
			
		|||
Exercise the INST/OBJ/BUILD family.
 | 
			
		||||
 | 
			
		||||
>>> import random
 | 
			
		||||
>>> dis(pickle.dumps(random.random, 0))
 | 
			
		||||
    0: c    GLOBAL     'random random'
 | 
			
		||||
   15: p    PUT        0
 | 
			
		||||
   18: .    STOP
 | 
			
		||||
>>> dis(pickle.dumps(random.getrandbits, 0))
 | 
			
		||||
    0: c    GLOBAL     'random getrandbits'
 | 
			
		||||
   20: p    PUT        0
 | 
			
		||||
   23: .    STOP
 | 
			
		||||
highest protocol among opcodes = 0
 | 
			
		||||
 | 
			
		||||
>>> from pickletools import _Example
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue