mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	mypy: Refactor extract_recipients in actions.py to remove type ignore.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							5ab64daecc
						
					
				
				
					commit
					12f3ed12c4
				
			@@ -1945,9 +1945,13 @@ def extract_recipients(
 | 
			
		||||
) -> Union[List[str], List[int]]:
 | 
			
		||||
    # We try to accept multiple incoming formats for recipients.
 | 
			
		||||
    # See test_extract_recipients() for examples of what we allow.
 | 
			
		||||
    try:
 | 
			
		||||
        data = ujson.loads(s)  # type: ignore # This function has a super weird union argument.
 | 
			
		||||
    except (ValueError, TypeError):
 | 
			
		||||
 | 
			
		||||
    if isinstance(s, str):
 | 
			
		||||
        try:
 | 
			
		||||
            data = ujson.loads(s)
 | 
			
		||||
        except (ValueError, TypeError):
 | 
			
		||||
            data = s
 | 
			
		||||
    else:
 | 
			
		||||
        data = s
 | 
			
		||||
 | 
			
		||||
    if isinstance(data, str):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user