summaryrefslogtreecommitdiffstats
path: root/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py')
-rwxr-xr-xansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py b/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py
index 5e8eb8d4c..783e745d8 100755
--- a/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py
+++ b/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/time-command.py
@@ -1,8 +1,7 @@
#!/usr/bin/env python
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
-from __future__ import (absolute_import, division, print_function)
-__metaclass__ = type
+from __future__ import annotations
import sys
import time
@@ -12,14 +11,14 @@ def main():
"""Main program entry point."""
start = time.time()
- sys.stdin.reconfigure(errors='surrogateescape')
- sys.stdout.reconfigure(errors='surrogateescape')
+ sys.stdin.reconfigure(errors="surrogateescape")
+ sys.stdout.reconfigure(errors="surrogateescape")
for line in sys.stdin:
seconds = time.time() - start
- sys.stdout.write('%02d:%02d %s' % (seconds // 60, seconds % 60, line))
+ sys.stdout.write("%02d:%02d %s" % (seconds // 60, seconds % 60, line))
sys.stdout.flush()
-if __name__ == '__main__':
+if __name__ == "__main__":
main()