mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #8343: Named group error msgs did not show the group name.
This commit is contained in:
		
							parent
							
								
									f6f78e1d9d
								
							
						
					
					
						commit
						1c99bc84bd
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -616,7 +616,8 @@ def _parse(source, state): | |||
|                                         "%r" % name) | ||||
|                         gid = state.groupdict.get(name) | ||||
|                         if gid is None: | ||||
|                             raise error("unknown group name") | ||||
|                             msg = "unknown group name: {0!r}".format(name) | ||||
|                             raise error(msg) | ||||
|                         subpatternappend((GROUPREF, gid)) | ||||
|                         continue | ||||
|                     else: | ||||
|  | @ -669,7 +670,8 @@ def _parse(source, state): | |||
|                     if condname.isidentifier(): | ||||
|                         condgroup = state.groupdict.get(condname) | ||||
|                         if condgroup is None: | ||||
|                             raise error("unknown group name") | ||||
|                             msg = "unknown group name: {0!r}".format(condname) | ||||
|                             raise error(msg) | ||||
|                     else: | ||||
|                         try: | ||||
|                             condgroup = int(condname) | ||||
|  | @ -806,7 +808,8 @@ def addgroup(index): | |||
|                     try: | ||||
|                         index = pattern.groupindex[name] | ||||
|                     except KeyError: | ||||
|                         raise IndexError("unknown group name") | ||||
|                         msg = "unknown group name: {0!r}".format(name) | ||||
|                         raise IndexError(msg) | ||||
|                 addgroup(index) | ||||
|             elif c == "0": | ||||
|                 if s.next in OCTDIGITS: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Raymond Hettinger
						Raymond Hettinger