mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Issue #3360: Fix incorrect parsing of "020000000000.0".
This commit is contained in:
		
							parent
							
								
									c83f113c8a
								
							
						
					
					
						commit
						64b7e501f4
					
				
					 3 changed files with 8 additions and 10 deletions
				
			
		
							
								
								
									
										11
									
								
								Python/ast.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								Python/ast.c
									
										
									
									
									
								
							|  | @ -3139,16 +3139,7 @@ parsenumber(struct compiling *c, const char *s) | |||
| #endif | ||||
|         if (*end == 'l' || *end == 'L') | ||||
|                 return PyLong_FromString((char *)s, (char **)0, 0); | ||||
|         if (s[0] == '0') { | ||||
|                 x = (long) PyOS_strtoul((char *)s, (char **)&end, 0); | ||||
|                 if (x < 0 && errno == 0) { | ||||
|                                 return PyLong_FromString((char *)s, | ||||
|                                                          (char **)0, | ||||
|                                                          0); | ||||
|                 } | ||||
|         } | ||||
|         else | ||||
|                 x = PyOS_strtol((char *)s, (char **)&end, 0); | ||||
|         x = PyOS_strtol((char *)s, (char **)&end, 0); | ||||
|         if (*end == '\0') { | ||||
|                 if (errno != 0) | ||||
|                         return PyLong_FromString((char *)s, (char **)0, 0); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mark Dickinson
						Mark Dickinson