mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Use random instead of whrandom
This commit is contained in:
		
							parent
							
								
									9a62448d2f
								
							
						
					
					
						commit
						a9745611de
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -7,7 +7,7 @@
 | 
			
		|||
 | 
			
		||||
import sys
 | 
			
		||||
import time
 | 
			
		||||
import whrandom
 | 
			
		||||
import random
 | 
			
		||||
import marshal
 | 
			
		||||
import tempfile
 | 
			
		||||
import operator
 | 
			
		||||
| 
						 | 
				
			
			@ -23,7 +23,7 @@ def randrange(n):
 | 
			
		|||
    except IOError:
 | 
			
		||||
        result = []
 | 
			
		||||
        for i in range(n):
 | 
			
		||||
            result.append(whrandom.random())
 | 
			
		||||
            result.append(random.random())
 | 
			
		||||
        try:
 | 
			
		||||
            try:
 | 
			
		||||
                fp = open(fn, "wb")
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ def randrange(n):
 | 
			
		|||
        ##assert len(result) == n
 | 
			
		||||
        # Shuffle it a bit...
 | 
			
		||||
        for i in range(10):
 | 
			
		||||
            i = whrandom.randint(0, n-1)
 | 
			
		||||
            i = random.randrange(0, n)
 | 
			
		||||
            temp = result[:i]
 | 
			
		||||
            del result[:i]
 | 
			
		||||
            temp.reverse()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue