
                            d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlZ	 d dl	Z	edd       Zy# e
$ r	 d dlm	Z	 Y w xY w)    )annotationsN)contextmanager)zoneinfoc              #    K   | d yt        t        d      st        j                  d       	 t	        j
                  |        t        j                  j                         j                         j                         }|t        d      | t        j                  d<   t        j                          d |t        j                  d<   t        j                          y# t        j                  $ r t        d|       w xY ww)z
    Switch to a locally-known timezone specified by `tzname`.
    On exit, restore the previous timezone.
    If `tzname` is `None`, do nothing.
    Ntzsetz"Timezone patching is not supportedzInvalid timezone specified: z!Cannot determine current timezoneTZ)hasattrtimepytestskipr   ZoneInfoZoneInfoNotFoundError
ValueErrordatetimenow
astimezonetznameOSErrorosenvironr   )r   
old_tznames     3platform/gsutil/third_party/urllib3/test/tz_stub.pystub_timezone_ctxr      s      ~ 4!89D&!
 ""&&(335<<>J9::BJJtJJL	!BJJtJJL )) D7zBCCDs   -DC BD"DD)r   z
str | Nonereturnz"typing.Generator[None, None, None])
__future__r   r   r   r
   typing
contextlibr   r   r   ImportError	backportsr        r   <module>r"      sJ    "  	   % #    #"#s   0 >>