o
    ˜"4g¢  ã                   @  sp   U d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	m
Z
 e d¡Zejejd	œZd
ed< ddd„ZdS )z
Timezone utility functions.
é    )ÚannotationsN)ÚtimezoneÚtzinfoé   )ÚPGconn)ÚZoneInfoÚpsycopg)Ns   UTCzdict[bytes | None, tzinfo]Ú
_timezonesÚpgconnúPGconn | NoneÚreturnr   c                 C  sÀ   | r|   d¡nd}zt| W S  ty_   |r| ¡ nd}zt|ƒ}W n3 ttfy7   t d|¡ tj	}Y n  t
yV } zt d|t|ƒj|¡ tj	}W Y d}~nd}~ww |t|< | Y S w )z=Return the Python timezone info of the connection's timezone.s   TimeZoneNÚUTCz-unknown PostgreSQL timezone: %r; will use UTCz>error handling PostgreSQL timezone: %r; will use UTC (%s - %s))Úparameter_statusr	   ÚKeyErrorÚdecoder   ÚOSErrorÚloggerÚwarningr   ÚutcÚ	ExceptionÚtypeÚ__name__)r
   ÚtznameÚsnameÚziÚex© r   úT/var/www/html/authentication-server/venv/lib/python3.10/site-packages/psycopg/_tz.pyÚ
get_tzinfo   s.   

ü€ù	ïr   )r
   r   r   r   )Ú__doc__Ú
__future__r   ÚloggingÚdatetimer   r   Úpq.abcr   Ú_compatr   Ú	getLoggerr   r   r	   Ú__annotations__r   r   r   r   r   Ú<module>   s    
þ