A context manager that makes ``source`` the only time zone data.
(source)
| 95 | |
| 96 | |
| 97 | def tz_source_context(source): |
| 98 | """A context manager that makes ``source`` the only time zone data.""" |
| 99 | if source == "tzpath": |
| 100 | return set_tzpath(tuple(tz.TZPATH), block_tzdata=True) |
| 101 | else: |
| 102 | return set_tzpath((), block_tzdata=False) |
| 103 | |
| 104 | |
| 105 | class TzSourceMixin: |