MCPcopy Create free account
hub / github.com/dateutil/dateutil / tz_change_allowed

Method tz_change_allowed

tests/_common.py:187–197  ·  view source on GitHub ↗

Class method used to query whether or not this class allows time zone changes.

(cls)

Source from the content-addressed store, hash-verified

185
186 @classmethod
187 def tz_change_allowed(cls):
188 """
189 Class method used to query whether or not this class allows time zone
190 changes.
191 """
192 guard = bool(os.environ.get(cls._guard_var_name, False))
193
194 # _guard_allows_change gives the "default" behavior - if True, the
195 # guard is overcoming a block. If false, the guard is causing a block.
196 # Whether tz_change is allowed is therefore the XNOR of the two.
197 return guard == cls._guard_allows_change
198
199 @classmethod
200 def tz_change_disallowed_message(cls):

Callers 1

__enter__Method · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected