mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #19219: Speed up marshal.loads(), and make pyc files slightly (5% to 10%) smaller.
This commit is contained in:
		
							parent
							
								
									4c6ed25b96
								
							
						
					
					
						commit
						1164dfcb86
					
				
					 4 changed files with 3472 additions and 3555 deletions
				
			
		|  | @ -262,11 +262,11 @@ def test_loads_reject_unicode_strings(self): | |||
| 
 | ||||
|     def test_bad_reader(self): | ||||
|         class BadReader(io.BytesIO): | ||||
|             def read(self, n=-1): | ||||
|                 b = super().read(n) | ||||
|             def readinto(self, buf): | ||||
|                 n = super().readinto(buf) | ||||
|                 if n is not None and n > 4: | ||||
|                     b += b' ' * 10**6 | ||||
|                 return b | ||||
|                     n += 10**6 | ||||
|                 return n | ||||
|         for value in (1.0, 1j, b'0123456789', '0123456789'): | ||||
|             self.assertRaises(ValueError, marshal.load, | ||||
|                               BadReader(marshal.dumps(value))) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Antoine Pitrou
						Antoine Pitrou