mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	timezone: Fix return type in get_timezone.
While it's true `datetime` is implicit via `pytz`, it makes sense that mypy should now complain about the semantics of calling our return type `pytz.datetime.tzinfo`, when such a type doesn't actually exist.
This commit is contained in:
		@@ -2,9 +2,10 @@
 | 
				
			|||||||
from typing import List
 | 
					from typing import List
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import pytz
 | 
					import pytz
 | 
				
			||||||
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_all_timezones() -> List[str]:
 | 
					def get_all_timezones() -> List[str]:
 | 
				
			||||||
    return sorted(pytz.all_timezones)
 | 
					    return sorted(pytz.all_timezones)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_timezone(tz: str) -> pytz.datetime.tzinfo:
 | 
					def get_timezone(tz: str) -> datetime.tzinfo:
 | 
				
			||||||
    return pytz.timezone(tz)
 | 
					    return pytz.timezone(tz)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user