mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Make xdrlib use floor division instead of classic division.
Makes test_xdrlib pass.
This commit is contained in:
		
							parent
							
								
									686eaeb0b8
								
							
						
					
					
						commit
						b921a84405
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -80,7 +80,7 @@ def pack_fstring(self, n, s): | ||||||
|         if n < 0: |         if n < 0: | ||||||
|             raise ValueError, 'fstring size must be nonnegative' |             raise ValueError, 'fstring size must be nonnegative' | ||||||
|         data = s[:n] |         data = s[:n] | ||||||
|         n = ((n+3)/4)*4 |         n = ((n+3)//4)*4 | ||||||
|         data = data + (n - len(data)) * '\0' |         data = data + (n - len(data)) * '\0' | ||||||
|         self.__buf.write(data) |         self.__buf.write(data) | ||||||
| 
 | 
 | ||||||
|  | @ -192,7 +192,7 @@ def unpack_fstring(self, n): | ||||||
|         if n < 0: |         if n < 0: | ||||||
|             raise ValueError, 'fstring size must be nonnegative' |             raise ValueError, 'fstring size must be nonnegative' | ||||||
|         i = self.__pos |         i = self.__pos | ||||||
|         j = i + (n+3)/4*4 |         j = i + (n+3)//4*4 | ||||||
|         if j > len(self.__buf): |         if j > len(self.__buf): | ||||||
|             raise EOFError |             raise EOFError | ||||||
|         self.__pos = j |         self.__pos = j | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl