(self)
| 262 | variable to a truthy value before using this context manager. |
| 263 | """ |
| 264 | def get_current_tz(self): |
| 265 | p = subprocess.Popen(['tzutil', '/g'], stdout=subprocess.PIPE) |
| 266 | |
| 267 | ctzname, err = p.communicate() |
| 268 | ctzname = ctzname.decode() # Popen returns |
| 269 | |
| 270 | if p.returncode: |
| 271 | raise OSError('Failed to get current time zone: ' + err) |
| 272 | |
| 273 | return ctzname |
| 274 | |
| 275 | def set_current_tz(self, tzname): |
| 276 | p = subprocess.Popen('tzutil /s "' + tzname + '"') |
nothing calls this directly
no outgoing calls
no test coverage detected